X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Fsrcformats.py;h=8bea377591e4c38ff1efc42e63e46338f71ac613;hb=46434f2a671e5382758899140fbbd0fca2fff9b2;hp=51df1c60224c66ca16a0e1868bd8c60a8188c612;hpb=d2a4effa7138d04402928b843ca8ca4ba45e3380;p=dak.git diff --git a/daklib/srcformats.py b/daklib/srcformats.py index 51df1c60..8bea3775 100644 --- a/daklib/srcformats.py +++ b/daklib/srcformats.py @@ -1,3 +1,5 @@ +import re + srcformats = [] class SourceFormat(type): @@ -5,13 +7,21 @@ class SourceFormat(type): 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 + format = r'1.0' + class FormatThree(object): __metaclass__ = SourceFormat + format = r'3\.\d+ \(native\)' + class FormatThreeQuilt(object): __metaclass__ = SourceFormat + + format = r'3\.\d+ \(quilt\)'