Changeset 1483 for trunk/peppy/plugins/project.py
- Timestamp:
- 07/10/08 18:14:45 (4 months ago)
- Files:
-
- 1 modified
-
trunk/peppy/plugins/project.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/peppy/plugins/project.py
r1480 r1483 160 160 StrParam('build_command', '', 'shell command to build project, relative to working directory', fullwidth=True), 161 161 DirParam('run_dir', '', 'working directory in which to execute the project', fullwidth=True), 162 StrParam('run_command', '', 'shell command to execute e project, relative to working directory', fullwidth=True),162 StrParam('run_command', '', 'shell command to execute project, absolute path needed or will search current PATH environment variable', fullwidth=True), 163 163 ) 164 164 … … 169 169 self.loadPrefs() 170 170 self.loadTags() 171 self.process = None 171 172 172 173 def __str__(self): … … 200 201 dprint("Failed writing project config file") 201 202 202 def build(self): 203 def registerProcess(self, job): 204 self.process = job 205 206 def deregisterProcess(self, job): 207 self.process = None 208 209 def isRunning(self): 210 return bool(self.process) 211 212 def build(self, frame): 203 213 dprint("Compiling %s in %s" % (self.build_command, self.build_dir)) 204 205 def run(self): 214 output = JobOutputSidebarController(frame, self.registerProcess, self.deregisterProcess) 215 ProcessManager().run(self.build_command, self.build_dir, output) 216 217 def run(self, frame): 206 218 dprint("Running %s in %s" % (self.run_command, self.run_dir)) 219 output = JobOutputSidebarController(frame, self.registerProcess, self.deregisterProcess) 220 ProcessManager().run(self.run_command, self.run_dir, output) 221 222 def stop(self): 223 if self.process: 224 self.process.kill() 207 225 208 226 … … 327 345 328 346 def isEnabled(self): 329 return bool(self.mode.project_info and self.mode.project_info.build_command )330 331 def action(self, index=-1, multiplier=1): 332 self.mode.project_info.build( )347 return bool(self.mode.project_info and self.mode.project_info.build_command and not self.mode.project_info.isRunning()) 348 349 def action(self, index=-1, multiplier=1): 350 self.mode.project_info.build(self.frame) 333 351 334 352 … … 337 355 name = "Run..." 338 356 icon = 'icons/application.png' 339 default_menu = ("Project", 10 0)357 default_menu = ("Project", 101) 340 358 341 359 def isEnabled(self): 342 return bool(self.mode.project_info and self.mode.project_info.run_command) 343 344 def action(self, index=-1, multiplier=1): 345 self.mode.project_info.run() 360 return bool(self.mode.project_info and self.mode.project_info.run_command and not self.mode.project_info.isRunning()) 361 362 def action(self, index=-1, multiplier=1): 363 self.mode.project_info.run(self.frame) 364 365 366 class StopProject(SelectAction): 367 """Stop the build or run of the project""" 368 name = "Stop" 369 icon = 'icons/stop.png' 370 default_menu = ("Project", 109) 371 372 def isEnabled(self): 373 return bool(self.mode.project_info and self.mode.project_info.run_command and self.mode.project_info.isRunning()) 374 375 def action(self, index=-1, multiplier=1): 376 self.mode.project_info.stop() 346 377 347 378 … … 622 653 actions.append(SaveGlobalTemplate) 623 654 if mode.buffer.url in self.known_project_dirs: 624 actions.extend([SaveProjectTemplate, BuildProject, RunProject, 655 actions.extend([SaveProjectTemplate, 656 657 BuildProject, RunProject, StopProject, 625 658 626 659 RebuildCtags, LookupCtag])
