]> err.no Git - dak/commitdiff
Add SourceFormat class and track definitions with metaclass
authorChris Lamb <lamby@debian.org>
Tue, 27 Oct 2009 10:25:59 +0000 (10:25 +0000)
committerChris Lamb <lamby@debian.org>
Tue, 27 Oct 2009 10:25:59 +0000 (10:25 +0000)
Signed-off-by: Chris Lamb <lamby@debian.org>
daklib/srcformats.py [new file with mode: 0644]

diff --git a/daklib/srcformats.py b/daklib/srcformats.py
new file mode 100644 (file)
index 0000000..51df1c6
--- /dev/null
@@ -0,0 +1,17 @@
+srcformats = []
+
+class SourceFormat(type):
+    def __new__(cls, name, bases, attrs):
+        klass = super(SourceFormat, cls).__new__(cls, name, bases, attrs)
+        srcformats.append(klass)
+
+        return klass
+
+class FormatOne(object):
+    __metaclass__ = SourceFormat
+
+class FormatThree(object):
+    __metaclass__ = SourceFormat
+
+class FormatThreeQuilt(object):
+    __metaclass__ = SourceFormat