This forces every format to have a regex too as it will blow up otherwise.
Signed-off-by: Chris Lamb <lamby@debian.org>
srcformats = []
class SourceFormat(type):
srcformats = []
class SourceFormat(type):
klass = super(SourceFormat, cls).__new__(cls, name, bases, attrs)
srcformats.append(klass)
klass = super(SourceFormat, cls).__new__(cls, name, bases, attrs)
srcformats.append(klass)
+ klass.re_format = re.compile(klass.format)
+
return klass
class FormatOne(object):
__metaclass__ = SourceFormat
return klass
class FormatOne(object):
__metaclass__ = SourceFormat
class FormatThree(object):
__metaclass__ = SourceFormat
class FormatThree(object):
__metaclass__ = SourceFormat
+ format = r'3\.\d+ \(native\)'
+
class FormatThreeQuilt(object):
__metaclass__ = SourceFormat
class FormatThreeQuilt(object):
__metaclass__ = SourceFormat
+
+ format = r'3\.\d+ \(quilt\)'