ProjectPyramid/Project.py

changeset 9
0ebc5b152c6c
parent 8
ac62d7dc6a37
child 10
3330f7087434
equal deleted inserted replaced
8:ac62d7dc6a37 9:0ebc5b152c6c
60 def initActions(self): 60 def initActions(self):
61 """ 61 """
62 Public method to define the Pyramid actions. 62 Public method to define the Pyramid actions.
63 """ 63 """
64 # TODO: create action for: prequest 64 # TODO: create action for: prequest
65 # TODO: create action for: proutes
66 # TODO: create action for: ptweens 65 # TODO: create action for: ptweens
67 self.actions = [] 66 self.actions = []
68 67
69 self.selectProjectAct = E5Action(self.trUtf8('Current Pyramid Project'), 68 self.selectProjectAct = E5Action(self.trUtf8('Current Pyramid Project'),
70 "", 69 "",
207 """<b>Show Matching Views</b>""" 206 """<b>Show Matching Views</b>"""
208 """<p>Show views matching a given URL.</p>""" 207 """<p>Show views matching a given URL.</p>"""
209 )) 208 ))
210 self.showViewsAct.triggered[()].connect(self.__showMatchingViews) 209 self.showViewsAct.triggered[()].connect(self.__showMatchingViews)
211 self.actions.append(self.showViewsAct) 210 self.actions.append(self.showViewsAct)
211
212 self.showRoutesAct = E5Action(self.trUtf8('Show All Routes'),
213 self.trUtf8('Show All &Routes'),
214 0, 0,
215 self,'pyramid_show_routes')
216 self.showRoutesAct.setStatusTip(self.trUtf8(
217 'Show all URL dispatch routes used by a Pyramid application'))
218 self.showRoutesAct.setWhatsThis(self.trUtf8(
219 """<b>Show All Routes</b>"""
220 """<p>Show all URL dispatch routes used by a Pyramid application"""
221 """ in the order in which they are evaluated.</p>"""
222 ))
223 self.showRoutesAct.triggered[()].connect(self.__showRoutes)
224 self.actions.append(self.showRoutesAct)
212 225
213 ################################## 226 ##################################
214 ## distribution actions below ## 227 ## distribution actions below ##
215 ################################## 228 ##################################
216 229
284 menu.addAction(self.setupDevelopAct) 297 menu.addAction(self.setupDevelopAct)
285 menu.addSeparator() 298 menu.addSeparator()
286 menu.addAction(self.initializeDbAct) 299 menu.addAction(self.initializeDbAct)
287 menu.addSeparator() 300 menu.addSeparator()
288 menu.addAction(self.showViewsAct) 301 menu.addAction(self.showViewsAct)
302 menu.addAction(self.showRoutesAct)
289 menu.addSeparator() 303 menu.addSeparator()
290 menu.addAction(self.runPythonShellAct) 304 menu.addAction(self.runPythonShellAct)
291 menu.addSeparator() 305 menu.addSeparator()
292 menu.addAction(self.buildDistroAct) 306 menu.addAction(self.buildDistroAct)
293 menu.addSeparator() 307 menu.addSeparator()
919 dia = PyramidDialog(title, fixed=True, linewrap=False) 933 dia = PyramidDialog(title, fixed=True, linewrap=False)
920 res = dia.startProcess(cmd, args, projectPath) 934 res = dia.startProcess(cmd, args, projectPath)
921 if res: 935 if res:
922 dia.exec_() 936 dia.exec_()
923 937
938 def __showRoutes(self):
939 """
940 Private slot showing all URL dispatch routes.
941 """
942 # TODO: use a specialized dialog parsing the output of proutes
943 title = self.trUtf8("Show All Routes")
944 try:
945 projectPath = self.__projectPath()
946 except PyramidNoProjectSelectedException:
947 E5MessageBox.warning(self.__ui,
948 title,
949 self.trUtf8('No current Pyramid project selected or no Pyramid project'
950 ' created yet. Aborting...'))
951 return
952
953 cmd = self.getPyramidCommand("proutes")
954 args = []
955 args.append("development.ini")
956
957 dia = PyramidDialog(title, fixed=True, linewrap=False)
958 res = dia.startProcess(cmd, args, projectPath)
959 if res:
960 dia.exec_()
961
924 ################################################################## 962 ##################################################################
925 ## slots below implement documentation functions 963 ## slots below implement documentation functions
926 ################################################################## 964 ##################################################################
927 965
928 def __showDocumentation(self): 966 def __showDocumentation(self):

eric ide

mercurial