]> gitweb.michael.orlitzky.com - dead/pictar.git/blobdiff - Mime/SupportedType.py
Updated XmlDataParser to use the Python 2.5 ElementTree interface.
[dead/pictar.git] / Mime / SupportedType.py
index 9ab2f3e217c2e31e572cf9c52f67d46aef7f7fd6..c0f2267686522c9aed2dea3bef27b29c2e5de1d2 100644 (file)
@@ -1,12 +1,10 @@
-
-"""
-Wrapper class for the 'filetype' elements in the config file. Nothing
-tricky here, except that the accessor for the template should
-intelligently determine which of the two fields (template_file,
-template_data) is used as the template source.
-"""
-
 class SupportedType:
+    """
+    Wrapper class for the 'filetype' elements in the config
+    file. Nothing tricky here, except that the accessor for the
+    template should intelligently determine which of the two fields
+    (template_file, template_data) is used as the template source.
+    """
 
     def __init__(self,
                  name = "",
@@ -15,62 +13,23 @@ class SupportedType:
                  template_file = "",
                  template_data = ""):
         
-        self.__name = name
-        self.__description = description
-        self.__extensions = extensions
-        self.__template_file = template_file
-        self.__template_data = template_data
+        self.name = name
+        self.description = description
+        self.extensions = extensions
+        self.template_file = template_file
+        self.template_data = template_data
 
         return
 
 
-
-    def GetName(self):
-        return self.__name
-
-
-    def GetDescription(self):
-        return self.__description
-
-    
-    def GetExtensions(self):
-        return self.__extensions
-
-    
     def GetTemplate(self):
-        if (self.__template_data == None or self.__template_data == ""):
+        if (self.template_data == None or self.template_data == ''):
             # The data is not given explicitly, so rely on the
             # template file to provide it.
-            template_file = open(self.__template_file, "r")
+            template_file = open(self.template_file, 'r')
             template = template_file.read()
             template_file.close()
             return template
         else:
-            return self.__template_data
-        
-
-
-    def SetName(self, name):
-        self.__name = name
-        return
-
-
-    def SetDescription(self, description):
-        self.__description = description
-        return
-
-
-    def SetExtensions(self, extensions):
-        self.__extensions = extensions
-        return
-
-    
-    def SetTemplateData(self, template_data):
-        self.__template_data = template_data
-        return
-
-    
-    def SetTemplateFile(self, template_file):
-        self.__template_file = template_file
-        return
+            return self.template_data