set a default editor (closes #557)

This commit is contained in:
Juke 2011-03-15 23:41:32 +01:00
commit fa8a4f8fe3

View file

@ -73,9 +73,10 @@ class WebContentEdit(ReplApplication):
paths[path] = content paths[path] = content
params = '' params = ''
if os.environ['EDITOR'] == 'vim': editor = os.environ.get('EDITOR', 'vim')
if editor == 'vim':
params = '-p' params = '-p'
os.system("$EDITOR %s %s" % (params, ' '.join(paths.iterkeys()))) os.system("%s %s %s" % (editor, params, ' '.join(paths.iterkeys())))
for path, content in paths.iteritems(): for path, content in paths.iteritems():
with open(path, 'r') as f: with open(path, 'r') as f: