Skip to content
Snippets Groups Projects
Commit c5bba911 authored by roadscape's avatar roadscape
Browse files

fix doc gen, move run_mode to conf #49

parent 4ac9276b
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ PROJECT_DOCKER_RUN_ARGS := --link db:db ...@@ -7,7 +7,7 @@ PROJECT_DOCKER_RUN_ARGS := --link db:db
default: build default: build
.PHONY: test run test-without-lint test-pylint fmt test-without-build build .PHONY: test run test-without-lint test-pylint fmt test-without-build build docs
docs: docs:
pdoc --html hive --html-dir docs pdoc --html hive --html-dir docs
......
...@@ -42,6 +42,13 @@ class Conf(): ...@@ -42,6 +42,13 @@ class Conf():
assert cls._args, "run init_argparse()" assert cls._args, "run init_argparse()"
return getattr(cls._args, param) return getattr(cls._args, param)
@classmethod
def run_mode(cls):
mode = '/'.join(cls.get('mode'))
valid = ['server', 'sync', 'status']
assert mode in valid, "invalid run mode %s" % mode
return mode
@classmethod @classmethod
def log_level(cls): def log_level(cls):
str_log_level = cls.get('log_level') str_log_level = cls.get('log_level')
......
...@@ -7,7 +7,7 @@ from hive.server.serve import run_server ...@@ -7,7 +7,7 @@ from hive.server.serve import run_server
def run(): def run():
Conf.init_argparse() Conf.init_argparse()
mode = '/'.join(Conf.get('mode')) mode = Conf.run_mode()
if mode == 'server': if mode == 'server':
run_server() run_server()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment