X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Fpictar.git;a=blobdiff_plain;f=Mime%2FSupportedType.py;fp=Mime%2FSupportedType.py;h=c0f2267686522c9aed2dea3bef27b29c2e5de1d2;hp=9ab2f3e217c2e31e572cf9c52f67d46aef7f7fd6;hb=a913a82677784cb48487a37e05ffb04c98dee0ad;hpb=c21bdc3222daa73da76c057ee00106e04ace4c77 diff --git a/Mime/SupportedType.py b/Mime/SupportedType.py index 9ab2f3e..c0f2267 100644 --- a/Mime/SupportedType.py +++ b/Mime/SupportedType.py @@ -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