-
-"""
-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 = "",
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