pywaybackup 3.3.0__tar.gz → 3.3.1__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 (23) hide show
  1. {pywaybackup-3.3.0/pywaybackup.egg-info → pywaybackup-3.3.1}/PKG-INFO +1 -3
  2. {pywaybackup-3.3.0 → pywaybackup-3.3.1}/README.md +1 -3
  3. {pywaybackup-3.3.0 → pywaybackup-3.3.1}/pyproject.toml +1 -1
  4. {pywaybackup-3.3.0 → pywaybackup-3.3.1}/pywaybackup/SnapshotCollection.py +17 -13
  5. {pywaybackup-3.3.0 → pywaybackup-3.3.1}/pywaybackup/archive_download.py +1 -0
  6. {pywaybackup-3.3.0 → pywaybackup-3.3.1/pywaybackup.egg-info}/PKG-INFO +1 -3
  7. {pywaybackup-3.3.0 → pywaybackup-3.3.1}/LICENSE +0 -0
  8. {pywaybackup-3.3.0 → pywaybackup-3.3.1}/pywaybackup/Arguments.py +0 -0
  9. {pywaybackup-3.3.0 → pywaybackup-3.3.1}/pywaybackup/Converter.py +0 -0
  10. {pywaybackup-3.3.0 → pywaybackup-3.3.1}/pywaybackup/Exception.py +0 -0
  11. {pywaybackup-3.3.0 → pywaybackup-3.3.1}/pywaybackup/Verbosity.py +0 -0
  12. {pywaybackup-3.3.0 → pywaybackup-3.3.1}/pywaybackup/Worker.py +0 -0
  13. {pywaybackup-3.3.0 → pywaybackup-3.3.1}/pywaybackup/__init__.py +0 -0
  14. {pywaybackup-3.3.0 → pywaybackup-3.3.1}/pywaybackup/archive_save.py +0 -0
  15. {pywaybackup-3.3.0 → pywaybackup-3.3.1}/pywaybackup/db.py +0 -0
  16. {pywaybackup-3.3.0 → pywaybackup-3.3.1}/pywaybackup/helper.py +0 -0
  17. {pywaybackup-3.3.0 → pywaybackup-3.3.1}/pywaybackup/main.py +0 -0
  18. {pywaybackup-3.3.0 → pywaybackup-3.3.1}/pywaybackup.egg-info/SOURCES.txt +0 -0
  19. {pywaybackup-3.3.0 → pywaybackup-3.3.1}/pywaybackup.egg-info/dependency_links.txt +0 -0
  20. {pywaybackup-3.3.0 → pywaybackup-3.3.1}/pywaybackup.egg-info/entry_points.txt +0 -0
  21. {pywaybackup-3.3.0 → pywaybackup-3.3.1}/pywaybackup.egg-info/requires.txt +0 -0
  22. {pywaybackup-3.3.0 → pywaybackup-3.3.1}/pywaybackup.egg-info/top_level.txt +0 -0
  23. {pywaybackup-3.3.0 → pywaybackup-3.3.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pywaybackup
3
- Version: 3.3.0
3
+ Version: 3.3.1
4
4
  Summary: Query and download archive.org as simple as possible.
5
5
  Author-email: bitdruid <bitdruid@outlook.com>
6
6
  License: MIT License
@@ -313,5 +313,3 @@ Exceptions will be written into `waybackup_error.log` (each run overwrites the f
313
313
 
314
314
  I'm always happy for some feature requests to improve the usability of this tool.
315
315
  Feel free to give suggestions and report issues. Project is still far from being perfect.
316
-
317
- > Please PR from dev into dev.
@@ -273,6 +273,4 @@ Exceptions will be written into `waybackup_error.log` (each run overwrites the f
273
273
  ## Contributing
274
274
 
275
275
  I'm always happy for some feature requests to improve the usability of this tool.
276
- Feel free to give suggestions and report issues. Project is still far from being perfect.
277
-
278
- > Please PR from dev into dev.
276
+ Feel free to give suggestions and report issues. Project is still far from being perfect.
@@ -7,7 +7,7 @@ packages = ["pywaybackup"]
7
7
 
8
8
  [project]
9
9
  name = "pywaybackup"
10
- version = "3.3.0"
10
+ version = "3.3.1"
11
11
  description = "Query and download archive.org as simple as possible."
12
12
  authors = [
13
13
  { name = "bitdruid", email = "bitdruid@outlook.com" }
@@ -70,15 +70,21 @@ class SnapshotCollection:
70
70
  cls.db.set_index_complete()
71
71
  else:
72
72
  vb.write(verbose=True, content="\nAlready indexed snapshots")
73
- if cls.MODE_LAST or cls.MODE_FIRST:
74
- if not cls.db.get_filter_complete():
75
- vb.write(content="\nFiltering snapshots (last or first version)...")
76
- cls.filter_snapshots() # filter: keep newest or oldest based on MODE
77
- cls.db.set_filter_complete()
78
- else:
79
- vb.write(verbose=True, content="\nAlready filtered snapshots (last or first version)")
73
+ if not cls.db.get_filter_complete():
74
+ vb.write(content="\nFiltering snapshots (last or first version)...")
75
+ cls.filter_snapshots() # filter: keep newest or oldest based on MODE
76
+ cls.db.set_filter_complete()
77
+ else:
78
+ vb.write(verbose=True, content="\nAlready filtered snapshots (last or first version)")
80
79
 
81
80
  cls.skip_set(csvfile) # set response to NULL or read csv file and write values into db
81
+
82
+
83
+
84
+
85
+
86
+ @classmethod
87
+ def calculate(cls):
82
88
  cls.SNAPSHOT_UNHANDLED = cls.count_totals(unhandled=True) # count all unhandled in db
83
89
  cls.SNAPSHOT_HANDLED = cls.count_totals(handled=True) # count all handled in db
84
90
  cls.SNAPSHOT_TOTAL = cls.count_totals(total=True) # count all in db
@@ -96,7 +102,8 @@ class SnapshotCollection:
96
102
  if cls.FILTER_RESPONSE > 0:
97
103
  vb.write(content=f"-----> {'skip statuscode'.ljust(18)}: {cls.FILTER_RESPONSE}")
98
104
 
99
- vb.write(content=f"\n-----> {'to utilize'.ljust(18)}: {cls.SNAPSHOT_UNHANDLED:,}")
105
+ if cls.SNAPSHOT_UNHANDLED > 0:
106
+ vb.write(content=f"\n-----> {'to utilize'.ljust(18)}: {cls.SNAPSHOT_UNHANDLED:,}")
100
107
 
101
108
 
102
109
 
@@ -179,9 +186,6 @@ class SnapshotCollection:
179
186
  cls.db.cursor.execute("UPDATE snapshot_tbl SET response = NULL WHERE response = 'LOCK'") # reset locked to unprocessed
180
187
  cls.db.cursor.execute("SELECT * FROM csv_view WHERE response IS NOT NULL") # only write processed snapshots
181
188
  headers = [description[0] for description in cls.db.cursor.description]
182
- if "snapshot_id" in headers:
183
- snapshot_id_index = headers.index("snapshot_id")
184
- headers.pop(snapshot_id_index)
185
189
  with open(csvfile, "w", encoding="utf-8") as f:
186
190
  writer = csv.writer(f)
187
191
  writer.writerow(headers)
@@ -341,9 +345,9 @@ class SnapshotCollection:
341
345
  if unhandled:
342
346
  return cls.db.cursor.execute("SELECT COUNT(rowid) FROM snapshot_tbl WHERE response IS NULL").fetchone()[0]
343
347
  if success:
344
- return cls.db.cursor.execute("SELECT COUNT(rowid) FROM snapshot_tbl WHERE file IS NOT NULL").fetchone()[0]
348
+ return cls.db.cursor.execute("SELECT COUNT(rowid) FROM snapshot_tbl WHERE file IS NOT NULL AND file != ''").fetchone()[0]
345
349
  if fail:
346
- return cls.db.cursor.execute("SELECT COUNT(rowid) FROM snapshot_tbl WHERE file IS NULL").fetchone()[0]
350
+ return cls.db.cursor.execute("SELECT COUNT(rowid) FROM snapshot_tbl WHERE file IS NULL OR file = ''").fetchone()[0]
347
351
 
348
352
  @staticmethod
349
353
  def modify_snapshot(connection, snapshot_id, column, value):
@@ -115,6 +115,7 @@ def query_list(csvfile: str, cdxfile: str,queryrange: int,limit: int,start: int,
115
115
  cdxquery = create_query(queryrange, limit, filter_filetype, filter_statuscode, start, end, explicit)
116
116
  cdxfile = run_query(cdxfile, cdxquery)
117
117
  sc.process_cdx(cdxfile, csvfile)
118
+ sc.calculate()
118
119
 
119
120
 
120
121
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pywaybackup
3
- Version: 3.3.0
3
+ Version: 3.3.1
4
4
  Summary: Query and download archive.org as simple as possible.
5
5
  Author-email: bitdruid <bitdruid@outlook.com>
6
6
  License: MIT License
@@ -313,5 +313,3 @@ Exceptions will be written into `waybackup_error.log` (each run overwrites the f
313
313
 
314
314
  I'm always happy for some feature requests to improve the usability of this tool.
315
315
  Feel free to give suggestions and report issues. Project is still far from being perfect.
316
-
317
- > Please PR from dev into dev.
File without changes
File without changes