mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
More refactoring
This commit is contained in:
parent
f88852ee6a
commit
03186bc49f
@ -2,14 +2,14 @@
|
|||||||
from bottle import request, response, FormsDict, HTTPError
|
from bottle import request, response, FormsDict, HTTPError
|
||||||
|
|
||||||
# rest of the project
|
# rest of the project
|
||||||
from .cleanup import CleanerAgent, CollectorAgent
|
from ..cleanup import CleanerAgent, CollectorAgent
|
||||||
from . import utilities
|
from .. import utilities
|
||||||
from .malojatime import register_scrobbletime, time_stamps, ranges
|
from ..malojatime import register_scrobbletime, time_stamps, ranges
|
||||||
from .malojauri import uri_to_internal, internal_to_uri, compose_querystring
|
from ..malojauri import uri_to_internal, internal_to_uri, compose_querystring
|
||||||
from .thirdparty import proxy_scrobble_all
|
from ..thirdparty import proxy_scrobble_all
|
||||||
from .globalconf import data_dir, malojaconfig, apikeystore
|
from ..globalconf import data_dir, malojaconfig, apikeystore
|
||||||
#db
|
#db
|
||||||
from .db import sqldb
|
from . import sqldb
|
||||||
|
|
||||||
# doreah toolkit
|
# doreah toolkit
|
||||||
from doreah.logging import log
|
from doreah.logging import log
|
||||||
@ -544,7 +544,7 @@ def get_predefined_rulesets():
|
|||||||
|
|
||||||
|
|
||||||
def start_db():
|
def start_db():
|
||||||
from . import upgrade
|
from .. import upgrade
|
||||||
upgrade.upgrade_db(sqldb.add_scrobbles)
|
upgrade.upgrade_db(sqldb.add_scrobbles)
|
||||||
dbstatus['healthy'] = True
|
dbstatus['healthy'] = True
|
||||||
dbstatus['complete'] = True
|
dbstatus['complete'] = True
|
@ -124,8 +124,11 @@ def main(*args,**kwargs):
|
|||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
action, *args = args
|
action, *args = args
|
||||||
actions[action](*args,**kwargs)
|
action = actions[action]
|
||||||
except (ValueError, KeyError):
|
except (ValueError, KeyError):
|
||||||
print("Valid commands: " + " ".join(a for a in actions))
|
print("Valid commands: " + " ".join(a for a in actions))
|
||||||
|
return
|
||||||
|
|
||||||
|
return action(*args,**kwargs)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
Loading…
Reference in New Issue
Block a user