Show More
@@ -31,11 +31,12 b' def install_editor(run_template, wait=False):' | |||||
31 | the call. |
|
31 | the call. | |
32 | """ |
|
32 | """ | |
33 |
|
33 | |||
34 | for substitution in ['$file', '$line']: |
|
34 | # not all editors support $line, so we'll leave out this check | |
35 |
|
|
35 | # for substitution in ['$file', '$line']: | |
36 | raise ValueError(('run_template should contain %s' |
|
36 | # if not substitution in run_template: | |
37 | ' for string substitution. You supplied "%s"' % (substitution, |
|
37 | # raise ValueError(('run_template should contain %s' | |
38 | run_template))) |
|
38 | # ' for string substitution. You supplied "%s"' % (substitution, | |
|
39 | # run_template))) | |||
39 |
|
40 | |||
40 | template = Template(run_template) |
|
41 | template = Template(run_template) | |
41 |
|
42 | |||
@@ -76,14 +77,19 b" def jed(exe='jed'):" | |||||
76 | install_editor(exe + ' +$line "$file"') |
|
77 | install_editor(exe + ' +$line "$file"') | |
77 |
|
78 | |||
78 |
|
79 | |||
79 |
def idle(exe= |
|
80 | def idle(exe='idle'): | |
80 | """ Idle, the editor bundled with python |
|
81 | """ Idle, the editor bundled with python | |
81 |
|
82 | |||
82 | Should be pretty smart about finding the executable. |
|
83 | Parameters | |
|
84 | ---------- | |||
|
85 | exe : str, None | |||
|
86 | If none, should be pretty smart about finding the executable. | |||
83 | """ |
|
87 | """ | |
84 | if exe is None: |
|
88 | if exe is None: | |
85 | import idlelib |
|
89 | import idlelib | |
86 | p = os.path.dirname(idlelib.__file__) |
|
90 | p = os.path.dirname(idlelib.__file__) | |
|
91 | # i'm not sure if this actually works. Is this idle.py script guarenteed | |||
|
92 | # to be executable? | |||
87 | exe = os.path.join(p, 'idle.py') |
|
93 | exe = os.path.join(p, 'idle.py') | |
88 | install_editor(exe + ' "$file"') |
|
94 | install_editor(exe + ' "$file"') | |
89 |
|
95 |
General Comments 0
You need to be logged in to leave comments.
Login now