Beispiel #1
0
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,
    )
Beispiel #2
0
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,
    )
Beispiel #3
0
def show_stats(config, args):
    from covid_chance.show_stats import main

    main(config)
Beispiel #4
0
def print_format(config, args):
    from covid_chance.print_format import main

    output_dir = Path(args.output)
    main(config, output_dir)
Beispiel #5
0
def print_export(config, args):
    from covid_chance.print_export import main

    cache_path = Path(args.cache)
    main(config, cache_path, approved=args.approved)
Beispiel #6
0
def parse_lines(config, args):
    from covid_chance.parse_lines import main

    main(config)
Beispiel #7
0
def review_tweets(config, args):
    from covid_chance.review_tweets import main

    main(config, review_all=args.all, incl_approved=args.approved)
Beispiel #8
0
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)
Beispiel #9
0
def match_lines(config, args):
    from covid_chance.match_lines import main

    main(config)
Beispiel #10
0
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)
Beispiel #11
0
def download_feeds(config, args):
    from covid_chance.download_feeds import main

    main(config)
Beispiel #12
0
def download_archives(config, args):
    from covid_chance.download_archives import main

    main(config)
Beispiel #13
0
def migrate(config, args):
    from covid_chance.migrate import main

    main(config)
Beispiel #14
0
                                                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()