resolve #26 add hide_skipped flag

This commit is contained in:
Hugh Rundle 2020-06-20 21:05:06 +10:00
parent 669d276f81
commit 2263a9fc54
2 changed files with 36 additions and 29 deletions

View File

@ -41,6 +41,9 @@ parser.add_argument(
parser.add_argument(
"--datestamp", action="store_true", help="include a datetime stamp for every action (e.g. deleting a toot)"
)
parser.add_argument(
"--hide_skipped", action="store_true", help="do not write to log when skipping saved toots"
)
parser.add_argument(
"--schedule", action="store", metavar="'filepath'", nargs="?", const=".", help="save and load plist file on MacOS"
)

View File

@ -69,39 +69,43 @@ def checkToots(config, options, retry_count=0):
toot_tags.add(tag.name)
try:
if keep_pinned and hasattr(toot, "pinned") and toot.pinned:
if options.datestamp:
print(str( datetime.now(timezone.utc).strftime('%a %d %b %Y %H:%M:%S %z') ), end=' : ')
if not options.hide_skipped:
if options.datestamp:
print(str( datetime.now(timezone.utc).strftime('%a %d %b %Y %H:%M:%S %z') ), end=' : ')
print(
"📌 skipping pinned toot - "
+ str(toot.id)
)
print(
"📌 skipping pinned toot - "
+ str(toot.id)
)
elif toot.id in toots_to_keep:
if options.datestamp:
print(str( datetime.now(timezone.utc).strftime('%a %d %b %Y %H:%M:%S %z') ), end=' : ')
print(
"💾 skipping saved toot - "
+ str(toot.id)
)
if not options.hide_skipped:
if options.datestamp:
print(str( datetime.now(timezone.utc).strftime('%a %d %b %Y %H:%M:%S %z') ), end=' : ')
print(
"💾 skipping saved toot - "
+ str(toot.id)
)
elif toot.visibility in visibility_to_keep:
if options.datestamp:
print(str( datetime.now(timezone.utc).strftime('%a %d %b %Y %H:%M:%S %z') ), end=' : ')
print(
"👀 skipping "
+ toot.visibility
+ " toot - "
+ str(toot.id)
)
if not options.hide_skipped:
if options.datestamp:
print(str( datetime.now(timezone.utc).strftime('%a %d %b %Y %H:%M:%S %z') ), end=' : ')
print(
"👀 skipping "
+ toot.visibility
+ " toot - "
+ str(toot.id)
)
elif len(hashtags_to_keep.intersection(toot_tags)) > 0:
if options.datestamp:
print(str( datetime.now(timezone.utc).strftime('%a %d %b %Y %H:%M:%S %z') ), end=' : ')
print(
"#️⃣ skipping toot with hashtag - "
+ str(toot.id)
)
if not options.hide_skipped:
if options.datestamp:
print(str( datetime.now(timezone.utc).strftime('%a %d %b %Y %H:%M:%S %z') ), end=' : ')
print(
"#️⃣ skipping toot with hashtag - "
+ str(toot.id)
)
elif cutoff_date > toot.created_at:
if hasattr(toot, "reblog") and toot.reblog:
if options.datestamp: