Browse Source
Merge branch 'master' into try-before-quit
pull/115/head
as
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
27 additions and
15 deletions
-
.gitignore
-
deletefb/tools/archive.py
|
|
@ -2,3 +2,4 @@ |
|
|
|
__pycache__ |
|
|
|
venv |
|
|
|
.mypy_cache |
|
|
|
deletefb.log |
|
|
|
|
|
@ -49,9 +49,20 @@ class Archive: |
|
|
|
self._bloom_filter.add(content.name) |
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
class FakeArchive: |
|
|
|
def archive(self, content): |
|
|
|
""" |
|
|
|
Do not archive an object |
|
|
|
""" |
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
@contextmanager |
|
|
|
def archiver(archive_type): |
|
|
|
|
|
|
|
if not settings["ARCHIVE"]: |
|
|
|
yield FakeArchive() |
|
|
|
else: |
|
|
|
archive_file = open( |
|
|
|
str((Path(".") / Path(archive_type).name).with_suffix(".log.{0}".format(time()))), |
|
|
|
mode="ta", |
|
|
|