From 4c25cba290f85a228f362f877c3948ae1004738b Mon Sep 17 00:00:00 2001 From: Richard Baltrusch Date: Sat, 13 Aug 2022 01:37:39 +0200 Subject: [PATCH] Add fast DB gen at initial startup --- desktop_shop/__main__.py | 10 ++++++++++ setup.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/desktop_shop/__main__.py b/desktop_shop/__main__.py index 38fc8c1..6d8ba94 100644 --- a/desktop_shop/__main__.py +++ b/desktop_shop/__main__.py @@ -4,10 +4,20 @@ @author: Korean_Crimson """ +import os + +from desktop_shop.datagen import generate_data + from .gui import app from .gui import db_conn from .gui import init +# fast db generation if not present +if not os.path.isdir("main.db"): + generate_data.generate( + hash_iterations=1, transactions=100_000, users=10_000, products=20 + ) + try: init.init() app.views_dict['main_menu'].pack() diff --git a/setup.py b/setup.py index 4712d25..2c5ce7e 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setuptools.setup( name="desktop_shop", - version="1.0.0", + version="1.0.1", description="Desktop shop application", long_description=project_dir.joinpath("README.md").read_text(encoding="utf-8"), long_description_content_type="text/markdown",