PluginProjectPyramid.py

changeset 25
2dd3d1cf573a
parent 22
c358b356b214
child 32
107e51521b1e
equal deleted inserted replaced
24:cf9fc78bb1c8 25:2dd3d1cf573a
27 # Start-of-Header 27 # Start-of-Header
28 name = "Pyramid Project Plugin" 28 name = "Pyramid Project Plugin"
29 author = "Detlev Offenbach <detlev@die-offenbachs.de>" 29 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
30 autoactivate = True 30 autoactivate = True
31 deactivateable = True 31 deactivateable = True
32 version = "0.3.0" 32 version = "0.4.0"
33 className = "ProjectPyramidPlugin" 33 className = "ProjectPyramidPlugin"
34 packageName = "ProjectPyramid" 34 packageName = "ProjectPyramid"
35 shortDescription = "Project support for Pyramid projects." 35 shortDescription = "Project support for Pyramid projects."
36 longDescription = """This plugin implements project support for Pyramid projects.""" 36 longDescription = """This plugin implements project support for Pyramid projects."""
37 needsRestart = False 37 needsRestart = False
90 90
91 def prepareUninstall(): 91 def prepareUninstall():
92 """ 92 """
93 Module function to prepare for an uninstallation. 93 Module function to prepare for an uninstallation.
94 """ 94 """
95 pyramid = ProjectPyramidPlugin(None) 95 Preferences.removeProjectBrowserFlags(ProjectPyramidPlugin.PreferencesKey)
96 pyramid.prepareUninstall() 96 Preferences.Prefs.settings.remove(ProjectPyramidPlugin.PreferencesKey)
97 97
98 98
99 class ProjectPyramidPlugin(QObject): 99 class ProjectPyramidPlugin(QObject):
100 """ 100 """
101 Class implementing the Pyramid project plugin. 101 Class implementing the Pyramid project plugin.
102 """ 102 """
103 PreferencesKey = "Pyramid"
104
103 lexerAssociations = { 105 lexerAssociations = {
104 "*.mako": "Pygments|HTML+Mako", 106 "*.mako": "Pygments|HTML+Mako",
105 "*.pt": "Pygments|HTML+Genshi", 107 "*.pt": "Pygments|HTML+Genshi",
106 "*.txt": "Pygments|Genshi", 108 "*.txt": "Pygments|Genshi",
107 "*.html": "Pygments|HTML+Genshi", 109 "*.html": "Pygments|HTML+Genshi",
334 336
335 @param key the key of the value to get 337 @param key the key of the value to get
336 @param prefClass preferences class used as the storage area 338 @param prefClass preferences class used as the storage area
337 @return the requested setting 339 @return the requested setting
338 """ 340 """
339 return Preferences.Prefs.settings.value("Pyramid/" + key, 341 return Preferences.Prefs.settings.value(self.PreferencesKey + "/" + key,
340 self.__defaults[key]) 342 self.__defaults[key])
341 343
342 def setPreferences(self, key, value): 344 def setPreferences(self, key, value):
343 """ 345 """
344 Public method to store the various settings. 346 Public method to store the various settings.
346 @param key the key of the setting to be set (string) 348 @param key the key of the setting to be set (string)
347 @param value the value to be set 349 @param value the value to be set
348 @param prefClass preferences class used as the storage area 350 @param prefClass preferences class used as the storage area
349 """ 351 """
350 Preferences.Prefs.settings.setValue("Pyramid/" + key, value) 352 Preferences.Prefs.settings.setValue("Pyramid/" + key, value)
351
352 def prepareUninstall(self):
353 """
354 Public method to prepare for an uninstallation.
355 """
356 Preferences.removeProjectBrowserFlags("Pyramid")
357 Preferences.Prefs.settings.remove("Pyramid")

eric ide

mercurial