3 from optparse
import OptionParser
4 import rtv_download
, rtv_schedule
, rtv_tvguide
, rtv_delete
, rtv_convert
5 from rtv_config
import GTVGConfig
8 parser
= OptionParser()
10 parser
.add_option( "-d", "--download-listings", action
="store_true",
11 dest
="download", default
= False,
12 help="download listings using XMLTV" )
14 parser
.add_option("-s", "--schedule-recordings", action
="store_true",
15 dest
="schedule", default
=False,
16 help="schedule today's recordings")
18 parser
.add_option("-e", "--delete-old", action
="store_true",
19 dest
="delete", default
=False,
20 help="delete recordings marked as deleted in web interface")
22 parser
.add_option("-c", "--convert", action
="store_true",
23 dest
="convert", default
=False,
24 help="convert recorded programmes to a different format")
26 parser
.add_option("-r", "--rename", action
="store_true",
27 dest
="rename", default
=False,
28 help="renamed converted programmes to the current naming scheme")
30 parser
.add_option("-i", "--interactive", action
="store_true",
31 dest
="interactive", default
=False,
32 help="ask the user if input is needed")
34 parser
.add_option("-n", "--install-dir", dest
="install_dir",
35 help="supply the install directory", metavar
="INSTDIR" )
37 parser
.add_option("-g", "--generate-html-guide", action
="store_true",
38 dest
="generate_html", default
=False,
39 help="generate a TV guide in HTML form")
41 parser
.add_option("-t", "--test-all", action
="store_true",
42 dest
="test_all", default
=False,
45 parser
.set_defaults( install_dir
=".." )
47 ( options
, args
) = parser
.parse_args()
49 config
= GTVGConfig( options
, args
)
52 rtv_download
.download( config
)
55 rtv_schedule
.schedule( config
)
58 rtv_delete
.delete( config
)
61 rtv_convert
.convert( config
)
64 rtv_convert
.rename( config
)
66 if options
.generate_html
:
67 rtv_tvguide
.generate( config
)
70 rtv_schedule
.test_schedule( config
)
72 if __name__
== "__main__":