Skip to content

Commit 6ea8b5e

Browse files
authored
Merge pull request #9 from icfly2/move_to_class
Move to class
2 parents 2fa90b4 + f958edf commit 6ea8b5e

File tree

10 files changed

+357
-186
lines changed

10 files changed

+357
-186
lines changed

.github/workflows/pytest.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ jobs:
2727
run: |
2828
python -m pip install --upgrade pip
2929
python -m pip install flake8 pytest
30-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
30+
python -m pip install jinja2>=2.10.3 py2neo>=2020.0.0 IPython
31+
3132
- name: Lint with flake8
3233
run: |
3334
# stop the build if there are Python syntax errors or undefined names

docker-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ services:
44
graphviz:
55
image: neographviz:latest
66
environment:
7-
#- VIRTUAL_HOST= results.thebeast.sxp.saxopayments.com
8-
#- PYTHONFILESHARE=/data/git/
97
- env=$env
108
ports:
119
- 5002:5000

neographviz/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
from py2neo import Graph
2-
3-
__version__ = "0.4.6"
4-
from .vis import plot, vis_network
1+
__version__ = "0.5.0"
2+
from .vis import plot, Plot

neographviz/app.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,28 @@
1111
@app.route("/")
1212
def index():
1313
"Main graph page"
14-
query = request.args.get('query', 'match p= ()--() return p limit 25')
14+
query = request.args.get("query", "match p= ()--() return p limit 25")
1515
out = plot(graph, query=query, template_file="vis.html", app=True)
1616
return out
1717

1818

1919
if __name__ == "__main__":
20-
parser = argparse.ArgumentParser(description='Launch a graph visalisation app.')
21-
parser.add_argument('--debug', type=bool, default='True',
22-
help='Flag for debugging')
23-
parser.add_argument('--host', default='', type=str,
24-
help='Path to the graph DB, defaults to localhost')
25-
parser.add_argument('--port', default=5000, type=int,
26-
help='POrt on which to serve the app')
20+
parser = argparse.ArgumentParser(description="Launch a graph visalisation app.")
21+
parser.add_argument("--debug", type=bool, default="True", help="Flag for debugging")
22+
parser.add_argument(
23+
"--host",
24+
default="",
25+
type=str,
26+
help="Path to the graph DB, defaults to localhost",
27+
)
28+
parser.add_argument(
29+
"--port", default=5000, type=int, help="POrt on which to serve the app"
30+
)
2731
options = parser.parse_args()
2832
graph = Graph(options.host)
2933
if options.debug:
3034
app.run(debug=True, port=5000)
3135
else:
3236
import waitress
37+
3338
waitress.serve(app, host="0.0.0.0", port=5000)

0 commit comments

Comments
 (0)