metaTED / metaTED / __init__.py

SITE_URL = 'http://www.ted.com/'

__version__ = '2.0.1'


def main():
    # Setup command line option parser
    import logging
    from optparse import OptionParser
    parser = OptionParser(prog='metaTED', version=__version__)
    parser.add_option(
        '-q',
        '--quiet',
        action='store_const',
        const=logging.WARN,
        dest='verbosity',
        help='Be quiet, show only warnings and errors'
    )
    parser.add_option(
        '-v',
        '--verbose',
        action='store_const',
        const=logging.DEBUG,
        dest='verbosity',
        help='Be very verbose, show debug information'
    )
    parser.add_option(
        '-o',
        '--output-directory',
        dest='output_dir',
        help='Write generated metalinks to specified output directory'
    )
    (options, _) = parser.parse_args()
    
    # Configure logging
    log_level = options.verbosity or logging.INFO
    logging.basicConfig(level=log_level, format="[%(levelname)s] %(message)s")
    
    # Generate metalinks
    from metaTED.metalink import generate_metalinks
    generate_metalinks(options.output_dir)

if __name__ == '__main__':
    main()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.