5 # TODO: put these in a config file, obviously
7 cfg_config_dir
= "~/.recordtv"
8 #cfg_xmltv_command = "/usr/local/bin/tv_grab_uk_rt"
9 cfg_xmltv_command
= "tv_grab_uk_rt"
15 def __init__( self
, options
, args
):
16 self
.options
= options
19 self
.extra_recording_time_mins
= 10
21 self
.config_dir
= os
.path
.expanduser( cfg_config_dir
)
23 self
.xmltv_configs_dir
= os
.path
.join( self
.config_dir
,
26 self
.xmltv_files_dir
= os
.path
.join( self
.config_dir
,
29 self
.xmltv_config_file
= os
.path
.join( self
.xmltv_configs_dir
,
30 "tv_grab_uk_rt.conf" )
32 self
.xmltv_download_command
= ( cfg_xmltv_command
, "--quiet",
33 "--config-file", self
.xmltv_config_file
)
35 self
.xmltv_config_command
= ( cfg_xmltv_command
, "--quiet",
36 "--configure", "--gui",
37 "--config-file", self
.xmltv_config_file
)
39 self
.recorded_progs_dir
= "/home/andy/Videos/Recorded"
40 self
.converted_progs_dir
= "/home/andy/Videos/Wii"
41 self
.converted_audio_dir
= "/home/andy/PodCasts"
43 self
.record_start_command
= (
44 '/home/andy/code/public/recordtv/scripts/record_dvb_to_ts.sh ' +
45 '"%s" "%s" "%d" "%s" "%s" >> "%s" 2>&1' )
47 self
.convert_command
= (
48 '/home/andy/code/public/recordtv/scripts/convert_ts_to_mp4.sh ' +
49 '"%s" "%s" "%s" "%s"' )
51 self
.audio_convert_command
= (
52 '/home/andy/code/public/recordtv/scripts/convert_audiots_to_ogg.sh ' +
53 '"%s" "%s" "%s" "%s"' )
55 self
.tvguide_dir
= os
.path
.join( self
.converted_progs_dir
, "tvguide" )
57 self
.scheduled_events_dir
= os
.path
.join( self
.config_dir
,
60 self
.recording_log_dir
= os
.path
.join( self
.config_dir
,
63 self
.favourites_dir
= os
.path
.join( self
.config_dir
,"favourites" )
64 self
.selections_dir
= os
.path
.join( self
.config_dir
,"selections" )
65 self
.config_config_dir
= os
.path
.join( self
.config_dir
, "config" )
67 self
.channel_xmltv2tzap_file
= os
.path
.join( self
.config_config_dir
,
68 "xmltv_channel_to_tzap.rtvcfg" )
70 self
.channels_order_file
= os
.path
.join( self
.config_config_dir
,
71 "channels_order.rtvcfg" )
73 self
.html_templates_dir
= os
.path
.join( self
.config_dir
,
76 self
.html_single_day_file
= os
.path
.join( self
.html_templates_dir
,
77 "doc_single_day.html" )
78 self
.html_programme_small_normal_file
= os
.path
.join(
79 self
.html_templates_dir
, "div_programme_normal.html" )
80 self
.html_programme_small_highlight_file
= os
.path
.join(
81 self
.html_templates_dir
, "div_programme_highlight.html" )
82 self
.html_programme_small_remind_file
= os
.path
.join(
83 self
.html_templates_dir
, "div_programme_remind.html" )
84 self
.html_programme_small_record_file
= os
.path
.join(
85 self
.html_templates_dir
, "div_programme_record.html" )
87 self
.html_programme_full_normal_file
= os
.path
.join(
88 self
.html_templates_dir
, "full_programme_normal.html" )
89 self
.html_programme_full_highlight_file
= os
.path
.join(
90 self
.html_templates_dir
, "full_programme_highlight.html" )
91 self
.html_programme_full_remind_file
= os
.path
.join(
92 self
.html_templates_dir
, "full_programme_remind.html" )
93 self
.html_programme_full_record_file
= os
.path
.join(
94 self
.html_templates_dir
, "full_programme_record.html" )
95 self
.html_time_file
= os
.path
.join(
96 self
.html_templates_dir
, "div_time.html" )
98 def get_listings_filename( self
, struct_time
):
99 return os
.path
.join( self
.xmltv_files_dir
,
100 time
.strftime( "tv-%Y-%m-%d.xmltv", struct_time
) )