[Debconf-video-commits] r429 - in package/trunk/src: . debconfvideo
Ben Hutchings
benh at alioth.debian.org
Sat Jun 20 14:45:27 UTC 2009
Author: benh
Date: 2009-06-20 14:45:26 +0000 (Sat, 20 Jun 2009)
New Revision: 429
Modified:
package/trunk/src/dc-do-transcoding
package/trunk/src/debconfvideo/__init__.py
Log:
Move target filename generation to the debconfvideo module
Modified: package/trunk/src/dc-do-transcoding
===================================================================
--- package/trunk/src/dc-do-transcoding 2009-06-20 14:40:22 UTC (rev 428)
+++ package/trunk/src/dc-do-transcoding 2009-06-20 14:45:26 UTC (rev 429)
@@ -8,6 +8,7 @@
if __name__ == '__main__':
sys.path.insert(0, '/usr/share/debconf-video-store')
+import debconfvideo
from debconfvideo import config, database
class Job(object):
@@ -76,11 +77,7 @@
def try_prepare_job(job):
# Generate target_filename.
- # XXX This should really be defined in a view.
- job.target_filename = '%s/%s/%s%s' % (config['FILE_BASE'],
- job.target_format_abbr,
- job.event_recording_base_name,
- job.filename_extension)
+ job.target_filename = debconfvideo.target_filename(job, job)
if os.path.exists(job.recording_filename):
source_container_name = 'dv'
Modified: package/trunk/src/debconfvideo/__init__.py
===================================================================
--- package/trunk/src/debconfvideo/__init__.py 2009-06-20 14:40:22 UTC (rev 428)
+++ package/trunk/src/debconfvideo/__init__.py 2009-06-20 14:45:26 UTC (rev 429)
@@ -3,3 +3,10 @@
__all__ = ['config', 'database']
config = shellconfig.read_file('/etc/default/debconf-video')
+
+def target_filename(video_event_recording, video_target_format):
+ return ('%s/%s/%s%s' %
+ (config['FILE_BASE'],
+ video_target_format.target_format_abbr,
+ video_event_recording.event_recording_base_name,
+ video_target_format.filename_extension))
More information about the Debconf-video-commits
mailing list