You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by dk...@apache.org on 2015/06/27 04:44:21 UTC

incubator-tinkerpop git commit: made OSX even happier

Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/master 413fe982e -> 18cd7bcaa


made OSX even happier


Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/18cd7bca
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/18cd7bca
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/18cd7bca

Branch: refs/heads/master
Commit: 18cd7bcaaa2d810ce6d2601079b1008f9c159b8c
Parents: 413fe98
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Sat Jun 27 04:42:52 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Sat Jun 27 04:42:52 2015 +0200

----------------------------------------------------------------------
 bin/gephi-mock.py   | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 bin/gephi.mock      | 34 ----------------------------------
 bin/process-docs.sh | 15 ++++++++++-----
 3 files changed, 58 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/18cd7bca/bin/gephi-mock.py
----------------------------------------------------------------------
diff --git a/bin/gephi-mock.py b/bin/gephi-mock.py
new file mode 100755
index 0000000..746fdfc
--- /dev/null
+++ b/bin/gephi-mock.py
@@ -0,0 +1,48 @@
+#!/usr/bin/env python
+#
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
+
+class GephiHandler(BaseHTTPRequestHandler):
+
+    def respond(self):
+        self.send_response(200)
+        self.send_header('Content-Type', 'text/plain')
+        self.end_headers()
+        self.wfile.write("{}")
+
+    def do_GET(self):
+        self.respond()
+
+    def do_POST(self):
+        self.respond()
+
+def main():
+    try:
+        server = HTTPServer(('', 8080), GephiHandler)
+        print 'listening on port 8080...'
+        server.serve_forever()
+    except KeyboardInterrupt:
+        print '^C received, shutting down server'
+        server.socket.close()
+
+if __name__ == '__main__':
+    main()

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/18cd7bca/bin/gephi.mock
----------------------------------------------------------------------
diff --git a/bin/gephi.mock b/bin/gephi.mock
deleted file mode 100755
index 981eed8..0000000
--- a/bin/gephi.mock
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/bash
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-PID=
-
-function cleanup {
-  [ ${PID} ] && kill ${PID}
-}
-
-trap cleanup EXIT
-
-while true
-do
-  echo -e "HTTP/1.1 200 OK\nConnection: close\n\n{}" | nc -l 8080 &
-  PID=$!
-  wait ${PID}
-done

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/18cd7bca/bin/process-docs.sh
----------------------------------------------------------------------
diff --git a/bin/process-docs.sh b/bin/process-docs.sh
index 220683d..d88da74 100755
--- a/bin/process-docs.sh
+++ b/bin/process-docs.sh
@@ -20,15 +20,20 @@
 
 pushd "$(dirname $0)/.." > /dev/null
 
+GEPHI_MOCK=
+
+trap cleanup EXIT
+
+function cleanup() {
+  [ ${GEPHI_MOCK} ] && kill ${GEPHI_MOCK}
+}
+
+
 if [ ! `nc -z localhost 8080` ]; then
-  bin/gephi.mock > /dev/null 2>&1 &
+  bin/gephi-mock.py > /dev/null 2>&1 &
   GEPHI_MOCK=$!
 fi
 
 docs/preprocessor/preprocess.sh && mvn process-resources -Dasciidoc && docs/postprocessor/postprocess.sh
 
-if [ "${GEPHI_MOCK}" ]; then
-  kill ${GEPHI_MOCK}
-fi
-
 popd > /dev/null