linkarchivetools 0.1.11__py3-none-any.whl → 0.1.13__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- linkarchivetools/backup.py +8 -4
- linkarchivetools/tableconfig.py +7 -1
- linkarchivetools/utils/reflected.py +5 -0
- {linkarchivetools-0.1.11.dist-info → linkarchivetools-0.1.13.dist-info}/METADATA +2 -3
- {linkarchivetools-0.1.11.dist-info → linkarchivetools-0.1.13.dist-info}/RECORD +7 -7
- {linkarchivetools-0.1.11.dist-info → linkarchivetools-0.1.13.dist-info}/WHEEL +1 -1
- {linkarchivetools-0.1.11.dist-info → linkarchivetools-0.1.13.dist-info}/LICENSE +0 -0
linkarchivetools/backup.py
CHANGED
|
@@ -22,12 +22,13 @@ from sqlalchemy.dialects.postgresql.types import BYTEA
|
|
|
22
22
|
from sqlalchemy.orm import sessionmaker
|
|
23
23
|
|
|
24
24
|
from linkarchivetools.utils.reflected import *
|
|
25
|
-
from linkarchivetools.tableconfig import get_backup_tables
|
|
25
|
+
from linkarchivetools.tableconfig import get_backup_tables, get_tables
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
output_directory = Path(__file__).parents[1]
|
|
29
29
|
|
|
30
30
|
|
|
31
|
+
tables_to_create = get_tables()
|
|
31
32
|
tables_to_backup = get_backup_tables()
|
|
32
33
|
|
|
33
34
|
|
|
@@ -540,7 +541,7 @@ def backup_workspace(run_info):
|
|
|
540
541
|
|
|
541
542
|
workspace = run_info["workspace"]
|
|
542
543
|
|
|
543
|
-
for table in
|
|
544
|
+
for table in tables_to_create:
|
|
544
545
|
new_run_info = dict(run_info)
|
|
545
546
|
new_key = "instance_" + table
|
|
546
547
|
|
|
@@ -551,11 +552,14 @@ def backup_workspace(run_info):
|
|
|
551
552
|
new_run_info["tables"].append(table_name)
|
|
552
553
|
|
|
553
554
|
if new_run_info["format"] == "sqlite":
|
|
555
|
+
if table not in tables_to_backup:
|
|
556
|
+
new_run_info["empty"] = True
|
|
554
557
|
if not run_db_copy_backup(new_run_info):
|
|
555
558
|
return False
|
|
556
559
|
else:
|
|
557
|
-
if
|
|
558
|
-
|
|
560
|
+
if table in tables_to_backup:
|
|
561
|
+
if not run_pg_dump_backup(new_run_info):
|
|
562
|
+
return False
|
|
559
563
|
|
|
560
564
|
if run_info["format"] == "custom":
|
|
561
565
|
new_run_info = dict(run_info)
|
linkarchivetools/tableconfig.py
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
def get_tables():
|
|
2
|
-
|
|
2
|
+
tables = [
|
|
3
|
+
"apikeys",
|
|
4
|
+
"applogging",
|
|
5
|
+
"backgroundjob",
|
|
6
|
+
"backgroundjobhistory",
|
|
7
|
+
"keywords",
|
|
3
8
|
"credentials",
|
|
4
9
|
"sourcecategories",
|
|
5
10
|
"sourcesubcategories",
|
|
6
11
|
"sourcedatamodel",
|
|
12
|
+
"sourceoperationaldata",
|
|
7
13
|
"userconfig",
|
|
8
14
|
"configurationentry",
|
|
9
15
|
"linkdatamodel",
|
|
@@ -373,6 +373,11 @@ class ReflectedUserTags(ReflectedGenericTable):
|
|
|
373
373
|
return tags
|
|
374
374
|
|
|
375
375
|
|
|
376
|
+
class ReflectedUserTags(ReflectedGenericTable):
|
|
377
|
+
def get_table_name(self):
|
|
378
|
+
return "usertags"
|
|
379
|
+
|
|
380
|
+
|
|
376
381
|
class ReflectedEntryCompactedTags(ReflectedGenericTable):
|
|
377
382
|
def get_table_name(self):
|
|
378
383
|
return "entrycompactedtags"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
2
|
Name: linkarchivetools
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.13
|
|
4
4
|
Summary: Link Archive Tools
|
|
5
5
|
License: GPL3
|
|
6
6
|
Author: Iwan Grozny
|
|
@@ -11,7 +11,6 @@ Classifier: Programming Language :: Python :: 3
|
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.10
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.11
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
15
14
|
Requires-Dist: psycopg2-binary
|
|
16
15
|
Requires-Dist: python-dateutil (>=2.8.2,<3.0.0)
|
|
17
16
|
Requires-Dist: requests (>=2.32.5,<3.0.0)
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
linkarchivetools/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
2
2
|
linkarchivetools/README.md,sha256=hYJbfGP-dXswX6qyVi8yoZTdeq-G1vtihhplZa-_CSc,87
|
|
3
3
|
linkarchivetools/__init__.py,sha256=2kG06KRRM9wwa0WbsL1yAthqSMo_e3ibSm7yQFfSv9U,238
|
|
4
|
-
linkarchivetools/backup.py,sha256=
|
|
4
|
+
linkarchivetools/backup.py,sha256=xUDpC0YZou0y2X1aa-Js8pS_3TnC_NmVfKSrVihQd8A,24250
|
|
5
5
|
linkarchivetools/db2feeds.py,sha256=P5ZvvyLoEEOPPU_a50VlWw9FNMw8MyFg1TBR_ftdgQ4,8871
|
|
6
6
|
linkarchivetools/db2json.py,sha256=gCuCVqn4n40i1-6-k_Hb809bq2q8VgfIEHrFWp6nBT8,5666
|
|
7
7
|
linkarchivetools/dbanalyzer.py,sha256=BD59Ieg7Xv9pMgLZzWlN--8uReEYovfJ2XMbTsV5-Jg,10125
|
|
8
8
|
linkarchivetools/dbfilter.py,sha256=yE3FK80dRs7c5mzrvZG4NHh24UhvysbAiZkrVIKU2bI,4520
|
|
9
9
|
linkarchivetools/dbmerge.py,sha256=dEkvnYfiRDV3Od8qVQJWP_qJ7SKOYqKCndeX2HAJKFE,2510
|
|
10
10
|
linkarchivetools/json2db.py,sha256=IF01_KhMmHcdm4jfagU_kuJGCEtRwgwjZDuxLtlT7EQ,7607
|
|
11
|
-
linkarchivetools/tableconfig.py,sha256=
|
|
11
|
+
linkarchivetools/tableconfig.py,sha256=TsYYl2kbAkP035XElHUmeJqH5Kugl7bwi4ClIwJ6MSA,1731
|
|
12
12
|
linkarchivetools/utils/alchemysearch.py,sha256=voUDEBP4RShlGj8E0iHg83jP8JYJQKLOaJjCZNi4LMY,5689
|
|
13
13
|
linkarchivetools/utils/omnisearch.py,sha256=7HVzz8LesS3Yo6exdlPf4WdPbi2DQekPR2CmkJcfBbI,10115
|
|
14
|
-
linkarchivetools/utils/reflected.py,sha256=
|
|
15
|
-
linkarchivetools-0.1.
|
|
16
|
-
linkarchivetools-0.1.
|
|
17
|
-
linkarchivetools-0.1.
|
|
18
|
-
linkarchivetools-0.1.
|
|
14
|
+
linkarchivetools/utils/reflected.py,sha256=128AobfGS8EaNWzojzRCwUf2RVXJVfjiFBxGnHKqOXc,15551
|
|
15
|
+
linkarchivetools-0.1.13.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
16
|
+
linkarchivetools-0.1.13.dist-info/METADATA,sha256=SxghPXKys8iNp32QIlRrARXEYUGDFYLyfqNYbCG4dDk,1203
|
|
17
|
+
linkarchivetools-0.1.13.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
18
|
+
linkarchivetools-0.1.13.dist-info/RECORD,,
|
|
File without changes
|