Skip to content

Commit

Permalink
add printing version when start server
Browse files Browse the repository at this point in the history
  • Loading branch information
gxtrobot committed Oct 7, 2019
1 parent 3b3356e commit d3beef0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 4 additions & 2 deletions bustag/app/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,12 @@ def start_app():
if __name__ == "__main__":
try:
freeze_support()
from bustag import __version__
print(f"Bustag server starting: version: {__version__}\n\n")
import bustag.model.classifier as clf
from bustag.util import logger, get_cwd, get_now_time, get_data_path
from bustag.spider.db import (get_items, get_local_items, RATE_TYPE, RATE_VALUE, ItemRate,
Item, LocalItem, DBError, db as dbconn)
Item, LocalItem, DBError, db as dbconn)
from bustag.spider import db
from bustag.app.schedule import start_scheduler, add_download_job
from bustag.spider import bus_spider
Expand All @@ -216,4 +218,4 @@ def start_app():
print('system error')
finally:
print("Press Enter to continue ...")
input()
input()
2 changes: 1 addition & 1 deletion bustag/model/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from bustag.model.persist import dump_model, load_model
from bustag.util import logger, get_data_path, MODEL_PATH

BINARIZER_PATH = MODEL_PATH + ' label_binarizer.pkl'
BINARIZER_PATH = MODEL_PATH + 'label_binarizer.pkl'


def load_data():
Expand Down
7 changes: 4 additions & 3 deletions bustag/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,10 @@ def to_localtime(utc_dt):

def check_model_folder():
model_path = os.path.join(DATA_PATH, MODEL_PATH)
if not os.path.exists(model_path):
logger.info('created model folder')
os.mkdir(model_path)
abs_path = os.path.abspath(model_path)
if not os.path.exists(abs_path):
print(f'created model folder: {abs_path}')
os.mkdir(abs_path)


def init():
Expand Down

0 comments on commit d3beef0

Please sign in to comment.