Browse Source

Merge branch 'master' of github.com:weskerfoot/DeleteFB into chrome-driver-refactor

pull/105/head
Wesley Kerfoot 4 years ago
parent
commit
cf39fd78ec
  1. 1
      .gitignore
  2. 2
      README.md
  3. 0
      deletefb/deletefb.log
  4. 41
      deletefb/tools/archive.py
  5. 2
      requirements.txt

1
.gitignore

@ -1,3 +1,4 @@
.envrc
__pycache__
venv
deletefb.log

2
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.

0
deletefb/deletefb.log

41
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()

2
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

Loading…
Cancel
Save