Skip to content

Commit

Permalink
Looking for all python interpreters available instead
Browse files Browse the repository at this point in the history
of using sys.executable
  • Loading branch information
clarete committed Jul 17, 2008
1 parent 4a243ec commit cd7995f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
9 changes: 9 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2008-07-17 Lincoln de Sousa <lincoln@minaslivre.org>

Bug #48 - /usr/bin/guake is selectable as "default interpreter"

* src/guake.py (PrefsDialog.populate_shell_combo): Now it lists
all found python interpreters in path.

* NEWS: Just telling to the world about this new feature =)

2008-07-10 Lincoln de Sousa <lincoln@minaslivre.org>

* src/guake.py (Guake.on_window_lostfocus): Testing if the main
Expand Down
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ changes since 0.2
* Making easier to grab keybinging shortcuts from the prefs
screen by using eggcellrendererkeys lib.

* Now we look for more python interpreters when filling
interpreters combo.

* Fixing a lot of bugs.
19 changes: 18 additions & 1 deletion src/guake.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import gconf
import dbus

import re
import os
import signal
import sys
Expand All @@ -50,7 +51,19 @@
# Loading translation
bindtextdomain(guake_globals.name, guake_globals.locale_dir)

# Path to the shells file, it will be used to start to populate
# interpreters combo, see the next variable, its important to fill the
# rest of the combo too.

SHELLS_FILE = '/etc/shells'

# A regular expression to match possible python interpreters when
# filling interpreters combo in preferences

PYTHONS = re.compile('^python\d\.\d$')

# Sconf stuff

GCONF_PATH = '/apps/guake/'
GCONF_KEYS = GCONF_PATH + 'keybindings/'

Expand Down Expand Up @@ -290,7 +303,11 @@ def populate_shell_combo(self):
if possible and not possible.startswith('#') and \
os.path.exists(possible):
cb.append_text(possible)
cb.append_text(sys.executable)

for i in os.environ.get('PATH', '').split(os.pathsep):
for j in os.listdir(i):
if PYTHONS.match(j):
cb.append_text(os.path.join(i, j))

def populate_keys_tree(self):
model = self.get_widget('treeview-keys').get_model()
Expand Down

0 comments on commit cd7995f

Please sign in to comment.