+
+class PackagesFileWriter(BaseFileWriter):
+ def __init__(self, **keywords):
+ '''
+ The value of the keywords suite, component, debtype and architecture
+ are strings. Output files are gzip compressed only.
+ '''
+ flags = {
+ 'compression': ['gzip', 'xz'],
+ }
+ flags.update(keywords)
+ if flags['debtype'] == 'deb':
+ template = "%(archive)s/dists/%(suite)s/%(component)s/binary-%(architecture)s/Packages"
+ else: # udeb
+ template = "%(archive)s/dists/%(suite)s/%(component)s/debian-installer/binary-%(architecture)s/Packages"
+ BaseFileWriter.__init__(self, template, **flags)
+
+class SourcesFileWriter(BaseFileWriter):
+ def __init__(self, **keywords):
+ '''
+ The value of the keywords suite and component are strings. Output
+ files are gzip compressed only.
+ '''
+ flags = {
+ 'compression': ['gzip', 'xz'],
+ }
+ flags.update(keywords)
+ template = "%(archive)s/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 = {
+ 'compression': ['bzip2'],
+ 'language': 'en',
+ }
+ flags.update(keywords)
+ template = "%(archive)s/dists/%(suite)s/%(component)s/i18n/Translation-%(language)s"
+ super(TranslationFileWriter, self).__init__(template, **flags)