changeset 34:1fefedfb77df

Separate a generic base class from Status
author Bernhard Herzog <bh@intevation.de>
date Thu, 15 Mar 2007 12:02:28 +0100
parents 9b10c81ffd0f
children de7c1237220c
files treepkg/status.py
diffstat 1 files changed, 12 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/treepkg/status.py	Thu Mar 15 11:49:17 2007 +0100
+++ b/treepkg/status.py	Thu Mar 15 12:02:28 2007 +0100
@@ -51,17 +51,12 @@
         return datetime.datetime(*time.strptime(string.strip(),
                                                 self.date_format)[:6])
 
-
-class Status(object):
+class BaseStatus(object):
 
-    fields = dict(status=StringFieldDesc(default="unknown"),
-                  start=DateFieldDesc(default=None),
-                  stop=DateFieldDesc(default=None))
+    magic = "Status 0.0\n"
 
     attrs = set(["filename", "values"])
 
-    magic = "TreePackagerStatus 0.0\n"
-
     def __init__(self, filename):
         assert os.path.isabs(filename)
         self.filename = filename
@@ -110,3 +105,13 @@
             self.__dict__[attr] = value
         else:
             raise AttributeError(attr)
+
+
+class Status(BaseStatus):
+
+    magic = "TreePackagerStatus 0.0\n"
+
+    fields = dict(status=StringFieldDesc(default="unknown"),
+                  start=DateFieldDesc(default=None),
+                  stop=DateFieldDesc(default=None))
+
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)