1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00

More refactoring

This commit is contained in:
krateng 2022-01-04 20:45:15 +01:00
parent f88852ee6a
commit 03186bc49f
4 changed files with 12 additions and 9 deletions

View File

@ -2,14 +2,14 @@
from bottle import request, response, FormsDict, HTTPError
# rest of the project
from .cleanup import CleanerAgent, CollectorAgent
from . import utilities
from .malojatime import register_scrobbletime, time_stamps, ranges
from .malojauri import uri_to_internal, internal_to_uri, compose_querystring
from .thirdparty import proxy_scrobble_all
from .globalconf import data_dir, malojaconfig, apikeystore
from ..cleanup import CleanerAgent, CollectorAgent
from .. import utilities
from ..malojatime import register_scrobbletime, time_stamps, ranges
from ..malojauri import uri_to_internal, internal_to_uri, compose_querystring
from ..thirdparty import proxy_scrobble_all
from ..globalconf import data_dir, malojaconfig, apikeystore
#db
from .db import sqldb
from . import sqldb
# doreah toolkit
from doreah.logging import log
@ -544,7 +544,7 @@ def get_predefined_rulesets():
def start_db():
from . import upgrade
from .. import upgrade
upgrade.upgrade_db(sqldb.add_scrobbles)
dbstatus['healthy'] = True
dbstatus['complete'] = True

View File

View File

@ -124,8 +124,11 @@ def main(*args,**kwargs):
else:
try:
action, *args = args
actions[action](*args,**kwargs)
action = actions[action]
except (ValueError, KeyError):
print("Valid commands: " + " ".join(a for a in actions))
return
return action(*args,**kwargs)
return True