diff --git a/maloja/__init__.py b/maloja/__init__.py index 6d7b188..46e9d61 100644 --- a/maloja/__init__.py +++ b/maloja/__init__.py @@ -1,6 +1,15 @@ -name = "maloja" +### PACKAGE DATA + +name = "maloja" +desc = "Self-hosted music scrobble database" +author = { + "name":"Johannes Krattenmacher", + "email":"maloja@krateng.dev", + "github": "krateng" +} +version = 2,0,3 +versionstr = ".".join(str(n) for n in version) -from .info import author,version,versionstr requires = [ "bottle>=0.12.16", @@ -22,6 +31,8 @@ commands = { "maloja":"controller:main" } +### DOREAH CONFIGURATION + from doreah import config config( logging={ @@ -40,3 +51,17 @@ config( "autostart": False } ) + + +### USER DATA FOLDER + + +import os +try: + DATA_DIR = os.environ["XDG_DATA_HOME"].split(":")[0] + assert os.path.exists(DATA_DIR) +except: + DATA_DIR = os.path.join(os.environ["HOME"],".local/share/") + +DATA_DIR = os.path.join(DATA_DIR,"maloja") +os.makedirs(DATA_DIR,exist_ok=True) diff --git a/maloja/controller.py b/maloja/controller.py index f4ad4cf..37692f0 100755 --- a/maloja/controller.py +++ b/maloja/controller.py @@ -11,7 +11,7 @@ import pathlib import pkg_resources from doreah.control import mainfunction -from .info import DATA_DIR +from .__init__ import DATA_DIR diff --git a/maloja/database.py b/maloja/database.py index f58f26a..646caa4 100644 --- a/maloja/database.py +++ b/maloja/database.py @@ -7,7 +7,7 @@ from .malojatime import register_scrobbletime, time_stamps, ranges from .urihandler import uri_to_internal, internal_to_uri, compose_querystring from . import compliant_api from .external import proxy_scrobble -from . import info +from .__init__ import version # doreah toolkit from doreah.logging import log from doreah import tsv @@ -240,7 +240,7 @@ def server_info(): return { "name":settings.get_settings("NAME"), - "version":info.version + "version":version } ## All database functions are separated - the external wrapper only reads the request keys, converts them into lists and renames them where necessary, and puts the end result in a dict if not already so it can be returned as json diff --git a/maloja/info.py b/maloja/info.py deleted file mode 100644 index b204cec..0000000 --- a/maloja/info.py +++ /dev/null @@ -1,19 +0,0 @@ -import os - -author = { - "name":"Johannes Krattenmacher", - "email":"maloja@krateng.dev", - "github": "krateng" -} -version = 2,0,2 -versionstr = ".".join(str(n) for n in version) - - -try: - DATA_DIR = os.environ["XDG_DATA_HOME"].split(":")[0] - assert os.path.exists(DATA_DIR) -except: - DATA_DIR = os.path.join(os.environ["HOME"],".local/share/") - -DATA_DIR = os.path.join(DATA_DIR,"maloja") -os.makedirs(DATA_DIR,exist_ok=True) diff --git a/maloja/server.py b/maloja/server.py index 9b4181f..c8389b6 100755 --- a/maloja/server.py +++ b/maloja/server.py @@ -1,6 +1,6 @@ #!/usr/bin/env python import os -from .info import DATA_DIR +from .__init__ import DATA_DIR os.chdir(DATA_DIR) diff --git a/setup.py b/setup.py index 2272aa3..267f0d5 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ setuptools.setup( version=".".join(str(n) for n in module.version), author=module.author["name"], author_email=module.author["email"], - description="Self-hosted music scrobble database", + description=module.desc, license="GPLv3", long_description=long_description, long_description_content_type="text/markdown",