Skip to content
This repository was archived by the owner on Sep 24, 2025. It is now read-only.

Commit 42ab77d

Browse files
author
platipusica
committed
args
1 parent b288d37 commit 42ab77d

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

utils/scaffold_mysql.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import sqlparse
55
import os
66
import argparse
7-
import mysql.connector
7+
#import mysql.connector
88

99
# === CONFIGURATION ===
1010
ADMIN_FILE = 'admin.sqlite'
@@ -159,6 +159,7 @@ def connect_to_database(db_path):
159159
print(f"\n❌ Error connecting to database: {e}")
160160
return None
161161
def connect_to_database(db_info):
162+
import mysql.connector
162163
try:
163164
args = {
164165
'db': db_info['database'],
@@ -299,7 +300,13 @@ def my_database_procedure(connection, db_info):
299300
print(f"\n✅ Inserted {item_id - ITEM_START_ID} items and {field_id - FIELD_START_ID} fields.")
300301

301302
def main():
302-
parser = argparse.ArgumentParser(description='Connect to MySQL database.')
303+
parser = argparse.ArgumentParser(
304+
description="""Install jam.py-v7 and create a new project with jam-project.py!
305+
306+
Then run this script to connect to a MySQL database, list its tables,
307+
and scaffold Jam.py V7 front-end.""",
308+
formatter_class=argparse.RawTextHelpFormatter
309+
)
303310
parser.add_argument('--database', required=True, help='Database name')
304311
parser.add_argument('--user', required=True, help='Username')
305312
parser.add_argument('--password', required=True, help='Password')

utils/scaffold_sqlite3.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,11 @@ def my_database_procedure(db_info):
426426
def main():
427427
global args # Declare it global so it modifies the outer 'args'
428428
parser = argparse.ArgumentParser(
429-
description="Connect to a SQLite database, list its tables and scaffold Jam.py V7 front-end."
429+
description="""Install jam.py-v7 and create a new project with jam-project.py!
430+
431+
Then run this script to connect to a SQLite database, list its tables,
432+
and scaffold Jam.py V7 front-end.""",
433+
formatter_class=argparse.RawTextHelpFormatter
430434
)
431435
parser.add_argument('--db', required=True, help='Database name')
432436
parser.add_argument('--prefix', default='', help='Tables name prefix to remove for Captions')

0 commit comments

Comments
 (0)