]>
gitweb.michael.orlitzky.com - dead/pictar.git/blob - Mime/SupportedType.py
3 Wrapper class for the 'filetype' elements in the config file. Nothing
4 tricky here, except that the accessor for the template should
5 intelligently determine which of the two fields (template_file,
6 template_data) is used as the template source.
19 self
.__description
= description
20 self
.__extensions
= extensions
21 self
.__template
_file
= template_file
22 self
.__template
_data
= template_data
32 def GetDescription(self
):
33 return self
.__description
36 def GetExtensions(self
):
37 return self
.__extensions
40 def GetTemplate(self
):
41 if (self
.__template
_data
== None or self
.__template
_data
== ""):
42 # The data is not given explicitly, so rely on the
43 # template file to provide it.
44 template_file
= open(self
.__template
_file
, "r")
45 template
= template_file
.read()
49 return self
.__template
_data
53 def SetName(self
, name
):
58 def SetDescription(self
, description
):
59 self
.__description
= description
63 def SetExtensions(self
, extensions
):
64 self
.__extensions
= extensions
68 def SetTemplateData(self
, template_data
):
69 self
.__template
_data
= template_data
73 def SetTemplateFile(self
, template_file
):
74 self
.__template
_file
= template_file