Thumbnail programmes as we convert them
[recordtv.git] / src / recordtv
blob7ee7dba3ce899b8578266afbb6128db64fcb2854
1 #!/usr/bin/python
3 import warnings
4 warnings.filterwarnings( "ignore", "", DeprecationWarning )
6 from optparse import OptionParser
7 import rtv_download, rtv_schedule, rtv_tvguide, rtv_delete, rtv_convert
8 from rtv_config import GTVGConfig
10 def main():
11 parser = OptionParser()
13 parser.add_option( "-d", "--download-listings", action="store_true",
14 dest="download", default = False,
15 help="download listings using XMLTV" )
17 parser.add_option("-s", "--schedule-recordings", action="store_true",
18 dest="schedule", default=False,
19 help="schedule today's recordings")
21 parser.add_option("-a", "--days-to-schedule",metavar="DAYS",
22 dest="days", default=1,
23 help="how many days to schedule recordings for")
25 parser.add_option("-e", "--delete-old", action="store_true",
26 dest="delete", default=False,
27 help="delete recordings marked as deleted in web interface")
29 parser.add_option("-c", "--convert", action="store_true",
30 dest="convert", default=False,
31 help="convert recorded programmes to a different format")
33 parser.add_option("-r", "--rename", action="store_true",
34 dest="rename", default=False,
35 help="renamed converted programmes to the current naming scheme")
37 parser.add_option("-i", "--interactive", action="store_true",
38 dest="interactive", default=False,
39 help="ask the user if input is needed")
41 parser.add_option("-n", "--install-dir", dest="install_dir",
42 help="supply the install directory", metavar="INSTDIR" )
44 parser.add_option("-g", "--generate-html-guide", action="store_true",
45 dest="generate_html", default=False,
46 help="generate a TV guide in HTML form")
48 parser.set_defaults( install_dir=".." )
50 ( options, args ) = parser.parse_args()
52 config = GTVGConfig( options, args )
54 if options.download:
55 rtv_download.download( config )
57 if options.schedule:
58 rtv_schedule.schedule( config )
60 if options.delete:
61 rtv_delete.delete( config )
63 if options.convert:
64 rtv_convert.convert( config )
66 if options.rename:
67 rtv_convert.rename( config )
69 if options.generate_html:
70 rtv_tvguide.generate( config )
72 if __name__ == "__main__":
73 main()