You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
twitter_setup=input("Would you like the bot to post to Twitter? (Y/n) ")
316
304
iftwitter_setup.lower().startswith("n"):
317
305
returnconfig
@@ -425,24 +413,20 @@ def setup_matchlist():
425
413
withopen(path, "w") asf:
426
414
f.write("")
427
415
print(
428
-
"A new matchlist has been generated at {path}. You can add case insensitive entries to match, one per line.".format(
429
-
**locals()
430
-
)
416
+
"A new matchlist has been generated at {path}."
417
+
" You can add case insensitive entries to match, one per line.".format(**locals())
431
418
)
432
419
433
420
ifos.path.isfile(path_case_sensitive):
434
421
print(
435
-
"A case-sensitive matchlist already exists at {path_case_sensitive}.".format(
436
-
**locals()
437
-
)
422
+
"A case-sensitive matchlist already exists at {path_case_sensitive}.".format(**locals())
438
423
)
439
424
else:
440
425
withopen(path_case_sensitive, "w") asf:
441
426
f.write("")
442
427
print(
443
-
"A new case-sensitive matchlist has been generated at {path_case_sensitive}. You can add case-sensitive entries to match, one per line.".format(
444
-
**locals()
445
-
)
428
+
"A new case-sensitive matchlist has been generated at {path_case_sensitive}."
429
+
" You can add case-sensitive entries to match, one per line.".format(**locals())
446
430
)
447
431
448
432
return
@@ -457,9 +441,7 @@ def setup_rssfeedsfile():
457
441
else:
458
442
withopen(path, "w") asf:
459
443
f.write("")
460
-
print(
461
-
"A new RSS feeds file has been generated at {path}.".format(**locals())
462
-
)
444
+
print("A new RSS feeds file has been generated at {path}.".format(**locals()))
463
445
464
446
return
465
447
@@ -472,9 +454,9 @@ def initial_setup():
472
454
config=yaml.full_load(f)
473
455
else:
474
456
to_configure=input(
475
-
"It looks like this is the first time you've run trackthenews, or you've moved or deleted its configuration files.\nWould you like to create a new configuration in {}? (Y/n) ".format(
476
-
home
477
-
)
457
+
"It looks like this is the first time you've run trackthenews,"
458
+
" or you've moved or deleted its configuration files.\n"
459
+
"Would you like to create a new configuration in {}? (Y/n) ".format(home)
478
460
)
479
461
480
462
config= {}
@@ -487,15 +469,17 @@ def initial_setup():
487
469
else:
488
470
try:
489
471
os.makedirs(home)
490
-
except:
472
+
exceptException:
491
473
pass
492
474
493
475
if"db"notinconfig:
494
476
config["db"] ="trackthenews.db"
495
477
496
478
if"user-agent"notinconfig:
497
479
ua=input(
498
-
"What would you like your script's user-agent to be?\nThis should be something that is meaningful to you and may show up in the logs of the sites you are tracking: "
480
+
"What would you like your script's user-agent to be?\n"
481
+
"This should be something that is meaningful to you and"
482
+
" may show up in the logs of the sites you are tracking: "
499
483
)
500
484
501
485
ua=ua+" / powered by trackthenews (a project of freedom.press)"
@@ -516,9 +500,7 @@ def initial_setup():
516
500
517
501
# check if either Twitter or Mastodon has been configured
518
502
if"twitter"notinconfigand"mastodon"notinconfig:
519
-
print(
520
-
"Error: The bot must have at least one of Twitter or Mastodon configured."
521
-
)
503
+
print("Error: The bot must have at least one of Twitter or Mastodon configured.")
522
504
sys.exit(1)
523
505
524
506
withopen(configfile, "w") asf:
@@ -540,12 +522,11 @@ def apply_migrations(conn):
540
522
541
523
defmain():
542
524
parser=argparse.ArgumentParser(
543
-
description="Track articles from RSS feeds for a custom list of keywords and act on the matches."
525
+
description="Track articles from RSS feeds for a custom list of keywords"
0 commit comments