linkarchivetools 0.1.11__tar.gz → 0.1.14__tar.gz

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.
Files changed (18) hide show
  1. {linkarchivetools-0.1.11 → linkarchivetools-0.1.14}/PKG-INFO +2 -3
  2. {linkarchivetools-0.1.11 → linkarchivetools-0.1.14}/linkarchivetools/backup.py +8 -4
  3. {linkarchivetools-0.1.11 → linkarchivetools-0.1.14}/linkarchivetools/tableconfig.py +7 -1
  4. {linkarchivetools-0.1.11 → linkarchivetools-0.1.14}/linkarchivetools/utils/reflected.py +10 -0
  5. {linkarchivetools-0.1.11 → linkarchivetools-0.1.14}/pyproject.toml +1 -1
  6. {linkarchivetools-0.1.11 → linkarchivetools-0.1.14}/LICENSE +0 -0
  7. {linkarchivetools-0.1.11 → linkarchivetools-0.1.14}/README.md +0 -0
  8. {linkarchivetools-0.1.11 → linkarchivetools-0.1.14}/linkarchivetools/LICENSE +0 -0
  9. {linkarchivetools-0.1.11 → linkarchivetools-0.1.14}/linkarchivetools/README.md +0 -0
  10. {linkarchivetools-0.1.11 → linkarchivetools-0.1.14}/linkarchivetools/__init__.py +0 -0
  11. {linkarchivetools-0.1.11 → linkarchivetools-0.1.14}/linkarchivetools/db2feeds.py +0 -0
  12. {linkarchivetools-0.1.11 → linkarchivetools-0.1.14}/linkarchivetools/db2json.py +0 -0
  13. {linkarchivetools-0.1.11 → linkarchivetools-0.1.14}/linkarchivetools/dbanalyzer.py +0 -0
  14. {linkarchivetools-0.1.11 → linkarchivetools-0.1.14}/linkarchivetools/dbfilter.py +0 -0
  15. {linkarchivetools-0.1.11 → linkarchivetools-0.1.14}/linkarchivetools/dbmerge.py +0 -0
  16. {linkarchivetools-0.1.11 → linkarchivetools-0.1.14}/linkarchivetools/json2db.py +0 -0
  17. {linkarchivetools-0.1.11 → linkarchivetools-0.1.14}/linkarchivetools/utils/alchemysearch.py +0 -0
  18. {linkarchivetools-0.1.11 → linkarchivetools-0.1.14}/linkarchivetools/utils/omnisearch.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.1
2
2
  Name: linkarchivetools
3
- Version: 0.1.11
3
+ Version: 0.1.14
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)
@@ -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 tables_to_backup:
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 not run_pg_dump_backup(new_run_info):
558
- return False
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)
@@ -1,9 +1,15 @@
1
1
  def get_tables():
2
- table_names = [
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"
@@ -479,6 +484,11 @@ class ReflectedSocialData(ReflectedGenericTable):
479
484
  return data
480
485
 
481
486
 
487
+ class ReflectedEntryRules(ReflectedGenericTable):
488
+ def get_table_name(self):
489
+ return "entryrules"
490
+
491
+
482
492
  class EntryCopier(object):
483
493
  def __init__(self, src_engine, src_connection, dst_engine, dst_connection):
484
494
  self.src_engine = src_engine
@@ -3,7 +3,7 @@
3
3
 
4
4
  [tool.poetry]
5
5
  name = "linkarchivetools"
6
- version = "0.1.11"
6
+ version = "0.1.14"
7
7
  description = "Link Archive Tools"
8
8
  authors = ["Iwan Grozny <renegat@renegat0x0.ddns.net>"]
9
9
  license = "GPL3"