diff --git a/specdb/specdb b/arch/specdb similarity index 100% rename from specdb/specdb rename to arch/specdb diff --git a/specdb/specdb.py b/arch/specdb.py similarity index 99% rename from specdb/specdb.py rename to arch/specdb.py index 5862e22..88f6235 100644 --- a/specdb/specdb.py +++ b/arch/specdb.py @@ -113,7 +113,7 @@ def forms(table=None, num=None): comment_split = line.split(' -- ') comment = comment_split[-1] form_dic[table_name] = ruamel.yaml.comments.CommentedMap() - form_dic.yaml_add_eol_comment(comment, table_name) + form_dic.yaml_add_eol_comment(comment, table_name, column=25) elif re.search(r' -- ', line): if table_name in table: @@ -127,7 +127,7 @@ def forms(table=None, num=None): form_dic[table_name][column] = SQL_TYPES[sql_type] pad = 30 - len(column) form_dic[table_name].yaml_add_eol_comment( - f"{' '*pad}{comment}", column) + comment, column, column=35) yaml = ruamel.yaml.YAML() yaml.preserve_quotes = True @@ -238,6 +238,7 @@ def find_uniq_constraint(table=None, cursor=None): sql = f"SELECT sql FROM sqlite_master WHERE type='table' AND name='{table}'" cursor.execute(sql) schema = cursor.fetchone() + print(schema) entries = [ tmp.strip() for tmp in schema[0].splitlines() if tmp.find("UNIQUE")>=0 ] @@ -1538,6 +1539,7 @@ def backup(db=None, object_dir='objects', backup_file='backup.txt'): return True + def restore(backup=None, backup_file=None, object_dir=None): """ This function performs the restore function from an incremental backup @@ -1574,38 +1576,3 @@ def restore(backup=None, backup_file=None, object_dir=None): # Restoration is complete return True - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/specdb/__pycache__/__init__.cpython-37.pyc b/specdb/__pycache__/__init__.cpython-37.pyc index aedb228..3aa4caa 100644 Binary files a/specdb/__pycache__/__init__.cpython-37.pyc and b/specdb/__pycache__/__init__.cpython-37.pyc differ diff --git a/specdb/__pycache__/specdb.cpython-37.pyc b/specdb/__pycache__/specdb.cpython-37.pyc index 5e020cf..d56c035 100644 Binary files a/specdb/__pycache__/specdb.cpython-37.pyc and b/specdb/__pycache__/specdb.cpython-37.pyc differ