From abde7e72c4ff7e6594de503bafb5a9873a9ee2fa Mon Sep 17 00:00:00 2001 From: krateng Date: Sat, 9 Apr 2022 21:24:48 +0200 Subject: [PATCH] Moved scrobble generation to dev package --- maloja/__main__.py | 3 ++- maloja/{proccontrol/tasks => dev}/generate.py | 7 ++++--- maloja/proccontrol/tasks/__init__.py | 1 - 3 files changed, 6 insertions(+), 5 deletions(-) rename maloja/{proccontrol/tasks => dev}/generate.py (97%) diff --git a/maloja/__main__.py b/maloja/__main__.py index 981ad26..b1bdf23 100644 --- a/maloja/__main__.py +++ b/maloja/__main__.py @@ -13,6 +13,7 @@ from . import __pkginfo__ as pkginfo from . import globalconf from .proccontrol import tasks from .setup import setup +from .dev import generate @@ -142,7 +143,7 @@ def main(*args,**kwargs): # admin scripts "import":tasks.import_scrobbles, # maloja import /x/y.csv "backup":tasks.backup, # maloja backup --targetfolder /x/y --include_images - "generate":tasks.generate, # maloja generate 400 + "generate":generate.generate_scrobbles, # maloja generate 400 "export":tasks.export, # maloja export # aux "info":print_info diff --git a/maloja/proccontrol/tasks/generate.py b/maloja/dev/generate.py similarity index 97% rename from maloja/proccontrol/tasks/generate.py rename to maloja/dev/generate.py index 225b6ce..0083f67 100644 --- a/maloja/proccontrol/tasks/generate.py +++ b/maloja/dev/generate.py @@ -1,5 +1,6 @@ import random import datetime + from doreah.io import ask @@ -66,10 +67,10 @@ def generate_track(): -def generate(n=200): +def generate_scrobbles(n=200): + + from ..database.sqldb import add_scrobbles - from ...database.sqldb import add_scrobbles - n = int(n) if ask("Generate random scrobbles?",default=False): diff --git a/maloja/proccontrol/tasks/__init__.py b/maloja/proccontrol/tasks/__init__.py index eda907d..cf2cd85 100644 --- a/maloja/proccontrol/tasks/__init__.py +++ b/maloja/proccontrol/tasks/__init__.py @@ -1,4 +1,3 @@ from .import_scrobbles import import_scrobbles from .backup import backup -from .generate import generate from .export import export # read that line out loud