Skip to content

Commit

Permalink
Version in a server __init__.py file
Browse files Browse the repository at this point in the history
  • Loading branch information
pmdartus committed Dec 23, 2014
1 parent 8fb97ed commit 6235dfe
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ __pycache__/
# Distribution / packaging
.Python
env/
env27/
build/
develop-eggs/
dist/
Expand Down
2 changes: 1 addition & 1 deletion server/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__author__ = 'pmdartus'
__version__ = "0.4.1"
12 changes: 10 additions & 2 deletions server/server.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import argparse
import logging

from . import __version__
from .serializer import dump
from .loader import create_nanocube, load_data_in_cube, load_from_nano_file
from .interface import Interface
Expand All @@ -12,9 +13,16 @@ def init_parser():
help="Start in Debug mode")
parser.add_argument('--port', '-p', type=int, default=5000,
help="Interface port")
parser.add_argument('--version', '-v', action='store_true',
help="Current version of NanoDB")

args = parser.parse_args()
s = ServerManager(args)
s.start()

if args.version:
print("NanoDB version: v{}".format(__version__))
else:
s = ServerManager(args)
s.start()


class ServerManager(Interface):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def readme():

setup(
name="nanodb",
version="0.4.1",
version="0.4.2",
license="Apache License 2.0",
author="Pierre-Marie Dartus",
author_email="[email protected]",
Expand Down

0 comments on commit 6235dfe

Please sign in to comment.