Skip to content

Commit de19a7d

Browse files
committed
WinPython Control Panel: added shortcut to command prompt
1 parent 76f5b9f commit de19a7d

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

make.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -677,5 +677,5 @@ def make_all(build_number, release_level, pyver,
677677

678678

679679
if __name__ == '__main__':
680-
make_all(0, '', pyver='2.7', simulation=True, create_installer=False)
681-
make_all(0, '', pyver='3.3', simulation=True, create_installer=False)
680+
make_all(1, '', pyver='2.7')
681+
make_all(1, '', pyver='3.3')

winpython/controlpanel.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,11 @@ def setup_window(self):
464464
unregister_action = create_action(self, "Unregister distribution...",
465465
tip="Unregister file extensions, icons and context menu",
466466
triggered=self.unregister_distribution)
467-
add_actions(option_menu, (register_action, unregister_action))
467+
open_console_action = create_action(self, "Open console here",
468+
triggered=lambda: os.startfile(self.command_prompt_path))
469+
open_console_action.setEnabled(osp.exists(self.command_prompt_path))
470+
add_actions(option_menu, (register_action, unregister_action,
471+
None, open_console_action))
468472

469473
# View menu
470474
# view_menu = self.menuBar().addMenu("&View")
@@ -570,6 +574,11 @@ def unregister_distribution(self):
570574
if answer == QMessageBox.Yes:
571575
associate.unregister(self.distribution.target)
572576

577+
@property
578+
def command_prompt_path(self):
579+
return osp.join(self.distribution.target, osp.pardir,
580+
"WinPython Command Prompt.exe")
581+
573582
def distribution_changed(self, path):
574583
"""Distribution path has just changed"""
575584
for package in self.table.model.packages:

0 commit comments

Comments
 (0)