From 428c354683bcf6abdbb868722a30540f551f9e0b Mon Sep 17 00:00:00 2001 From: as Date: Thu, 13 Feb 2020 21:56:45 +0100 Subject: [PATCH 1/4] respect --no-archive in wall mode (#112) --- deletefb/tools/archive.py | 41 +++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/deletefb/tools/archive.py b/deletefb/tools/archive.py index 718ee65..cd6c046 100644 --- a/deletefb/tools/archive.py +++ b/deletefb/tools/archive.py @@ -49,21 +49,32 @@ class Archive: self._bloom_filter.add(content.name) return -@contextmanager -def archiver(archive_type): - archive_file = open( - str((Path(".") / Path(archive_type).name).with_suffix(".log.{0}".format(time()))), - mode="ta", - buffering=1 - ) +class FakeArchive: + def archive(self, content): + """ + Do not archive an object + """ + return - archiver_instance = Archive( - archive_type=archive_type, - archive_file=archive_file - ) - try: - yield archiver_instance - finally: - archive_file.close() +@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", + buffering=1 + ) + + archiver_instance = Archive( + archive_type=archive_type, + archive_file=archive_file + ) + + try: + yield archiver_instance + finally: + archive_file.close() From 95ac5252d4e8dd69f6b7838f7ec5bd1fb925f01d Mon Sep 17 00:00:00 2001 From: as Date: Thu, 13 Feb 2020 22:00:27 +0100 Subject: [PATCH 2/4] clean and gitignore deletefb.log (#113) --- .gitignore | 1 + deletefb/deletefb.log | 0 2 files changed, 1 insertion(+) delete mode 100644 deletefb/deletefb.log diff --git a/.gitignore b/.gitignore index c45468f..80c1faa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .envrc __pycache__ venv +deletefb.log diff --git a/deletefb/deletefb.log b/deletefb/deletefb.log deleted file mode 100644 index e69de29..0000000 From 03f7aad731d65bca33ca53d9ec7168fdb6ca24bb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2020 14:58:34 -0500 Subject: [PATCH 3/4] Bump bleach from 3.1.0 to 3.1.1 (#116) Bumps [bleach](https://github.com/mozilla/bleach) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/mozilla/bleach/releases) - [Changelog](https://github.com/mozilla/bleach/blob/master/CHANGES) - [Commits](https://github.com/mozilla/bleach/compare/v3.1.0...v3.1.1) Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 04533f9..6a0398b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ attrs==19.1.0 bitarray==0.9.3 -bleach==3.1.0 +bleach==3.1.1 cattrs-3.8==0.9.1 certifi==2018.11.29 chardet==3.0.4 From e4967a677667fed45ab3984ebc7cd935ec711152 Mon Sep 17 00:00:00 2001 From: Wesley Kerfoot Date: Thu, 27 Feb 2020 17:02:24 -0500 Subject: [PATCH 4/4] Update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 98542b5..5ff2a57 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Personally, I did this so I would feel less attached to my Facebook profile ## Installation You have several options to run it. -1) Install from PyPI with `pip3 install --user delete-facebook-posts` (recommended) +1) Install from PyPI with `pip3 install --user delete-facebook-posts` (recommended you do this in a virtualenv to avoid incompatibilities) 2) Clone this repo and run `pip3 install --user .` or do `pip3 install --user git+https://github.com/weskerfoot/DeleteFB.git` 3) Set up a Python virtualenv, activate it, and run `pip3 install -r requirements.txt`, then you can just run `python -m deletefb.deletefb` in the DeleteFB directory.