PluginProjectDjango.py

branch
eric7
changeset 192
a4b66a1acea6
parent 191
7b03dfe583e3
child 193
bf4c1a7833b4
equal deleted inserted replaced
191:7b03dfe583e3 192:a4b66a1acea6
58 else: 58 else:
59 apis = [] 59 apis = []
60 return apis 60 return apis
61 61
62 62
63 def createDjangoPage(configDlg): 63 def createDjangoPage(configDlg): # noqa: U100
64 """ 64 """
65 Module function to create the Django configuration page. 65 Module function to create the Django configuration page.
66 66
67 @param configDlg reference to the configuration dialog 67 @param configDlg reference to the configuration dialog
68 @type ConfigurationWidget 68 @type ConfigurationWidget
69 @return reference to the configuration page 69 @return reference to the configuration page
70 @rtype DjangoPage 70 @rtype DjangoPage
71 """ 71 """
72 from ProjectDjango.ConfigurationPage.DjangoPage import DjangoPage
73
72 global djangoPluginObject 74 global djangoPluginObject
73 from ProjectDjango.ConfigurationPage.DjangoPage import DjangoPage
74 75
75 page = DjangoPage(djangoPluginObject) 76 page = DjangoPage(djangoPluginObject)
76 return page 77 return page
77 78
78 79
204 lexerAssociationCallback=self.lexerAssociationCallback, 205 lexerAssociationCallback=self.lexerAssociationCallback,
205 binaryTranslationsCallback=self.binaryTranslationsCallback, 206 binaryTranslationsCallback=self.binaryTranslationsCallback,
206 progLanguages=self.__supportedVariants[:], 207 progLanguages=self.__supportedVariants[:],
207 ) 208 )
208 209
209 try: 210 Preferences.setProjectBrowsersDefault(
210 # backward compatibility for eric7 < 22.12 211 "Django",
211 from eric7.Project.ProjectBrowser import ( 212 ("sources", "forms", "translations", "others"),
212 FormsBrowserFlag, 213 )
213 OthersBrowserFlag,
214 SourcesBrowserFlag,
215 TranslationsBrowserFlag,
216 )
217
218 Preferences.setProjectBrowserFlagsDefault(
219 "Django",
220 SourcesBrowserFlag
221 | FormsBrowserFlag
222 | TranslationsBrowserFlag
223 | OthersBrowserFlag,
224 )
225 except ImportError:
226 Preferences.setProjectBrowsersDefault(
227 "Django",
228 ("sources", "forms", "translations", "others"),
229 )
230 214
231 if self.__ericProject.isOpen(): 215 if self.__ericProject.isOpen():
232 self.__projectOpened() 216 self.__projectOpened()
233 self.__object.projectOpenedHooks() 217 self.__object.projectOpenedHooks()
234 218
461 445
462 def getMenu(self, name): 446 def getMenu(self, name):
463 """ 447 """
464 Public method to get a reference to the requested menu. 448 Public method to get a reference to the requested menu.
465 449
466 @param name name of the menu (string) 450 @param name name of the menu
467 @return reference to the menu (QMenu) or None, if no 451 @type str
468 menu with the given name exists 452 @return reference to the menu or None, if no menu with the given name exists
453 @rtype QMenu
469 """ 454 """
470 if self.__object is not None: 455 if self.__object is not None:
471 return self.__object.getMenu(name) 456 return self.__object.getMenu(name)
472 else: 457 else:
473 return None 458 return None
474 459
475 def getMenuNames(self): 460 def getMenuNames(self):
476 """ 461 """
477 Public method to get the names of all menus. 462 Public method to get the names of all menus.
478 463
479 @return menu names (list of string) 464 @return menu names
465 @rtype list of str
480 """ 466 """
481 if self.__object is not None: 467 if self.__object is not None:
482 return list(self.__menus.keys()) 468 return list(self.__menus.keys())
483 else: 469 else:
484 return [] 470 return []
485 471
486 472
487 # 473 #
488 # eflag: noqa = M801 474 # eflag: noqa = M801, U200

eric ide

mercurial