def check_posted_tweets(config, args): from covid_chance.check_posted_tweets import main with open(args.secrets, 'r') as f: secrets = json.load(f) main( config, secrets, dry_run=args.dry_run, )
def post_tweet(config, args): from covid_chance.post_tweet import main with open(args.secrets, 'r') as f: secrets = json.load(f) main( config, secrets, interactive=args.interactive, dry_run=args.dry_run, )
def show_stats(config, args): from covid_chance.show_stats import main main(config)
def print_format(config, args): from covid_chance.print_format import main output_dir = Path(args.output) main(config, output_dir)
def print_export(config, args): from covid_chance.print_export import main cache_path = Path(args.cache) main(config, cache_path, approved=args.approved)
def parse_lines(config, args): from covid_chance.parse_lines import main main(config)
def review_tweets(config, args): from covid_chance.review_tweets import main main(config, review_all=args.all, incl_approved=args.approved)
def download_pages(config, args): from covid_chance.download_pages import main cache_path = Path(args.cache) main(config, cache_path, dry_run=args.dry_run)
def match_lines(config, args): from covid_chance.match_lines import main main(config)
def download_feeds_from_archives(config, args): from covid_chance.download_feeds_from_archives import main cache_path = Path(args.cache) main(config, cache_path)
def download_feeds(config, args): from covid_chance.download_feeds import main main(config)
def download_archives(config, args): from covid_chance.download_archives import main main(config)
def migrate(config, args): from covid_chance.migrate import main main(config)
help='Print format') print_format_parser.set_defaults(func=print_format) print_format_parser.add_argument( '-o', '--output', help='Output directory', required=True, ) show_stats_parser = subparsers.add_parser('show-stats', help='Show statistics') show_stats_parser.set_defaults(func=show_stats) migrate_parser = subparsers.add_parser('migrate', help='Migrate database') migrate_parser.set_defaults(func=migrate) args = parser.parse_args() if args.verbose: logging.basicConfig(stream=sys.stderr, level=logging.INFO, format='%(message)s') with open(args.config, 'r') as f: config = json.load(f) args.func(config, args) if __name__ == '__main__': main()