]> git.decadent.org.uk Git - dak.git/commitdiff
add TranslationFileWriter
authorAnsgar Burchardt <ansgar@debian.org>
Fri, 19 Aug 2011 15:37:20 +0000 (15:37 +0000)
committerAnsgar Burchardt <ansgar@debian.org>
Fri, 19 Aug 2011 17:56:44 +0000 (17:56 +0000)
daklib/filewriter.py

index b44fc2a5775c0fac1e21cb56af3585c6691a31ab..d26636dc347a36510d1d21223e8a602a1320199b 100755 (executable)
@@ -151,3 +151,19 @@ class SourcesFileWriter(BaseFileWriter):
         flags.update(keywords)
         template = "dists/%(suite)s/%(component)s/source/Sources"
         BaseFileWriter.__init__(self, template, **flags)
+
+class TranslationFileWriter(BaseFileWriter):
+    def __init__(self, **keywords):
+        '''
+        The value of the keywords suite, component and language are strings.
+        Output files are bzip2 compressed only.
+        '''
+        flags = {
+            'uncompressed': False,
+            'gzip':         False,
+            'bzip2':        True,
+            'language':     'en',
+        }
+        flags.update(keywords)
+        template = "dists/%(suite)s/%(component)s/i18n/Translation-%(language)s"
+        super(TranslationFileWriter, self).__init__(template, **flags)