diff --git a/maloja/database.py b/maloja/database/__init__.py similarity index 98% rename from maloja/database.py rename to maloja/database/__init__.py index 5bcc712..0c4b786 100644 --- a/maloja/database.py +++ b/maloja/database/__init__.py @@ -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 diff --git a/maloja/db/sqldb.py b/maloja/database/sqldb.py similarity index 100% rename from maloja/db/sqldb.py rename to maloja/database/sqldb.py diff --git a/maloja/db/convert.py b/maloja/db/convert.py deleted file mode 100644 index e69de29..0000000 diff --git a/maloja/proccontrol/control.py b/maloja/proccontrol/control.py index dd0eff6..d68f4b3 100644 --- a/maloja/proccontrol/control.py +++ b/maloja/proccontrol/control.py @@ -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