Mercurial > python-cmd2
comparison cmd2.py @ 407:f5aa16a22b52
was detecting first absent editor, not first presnt
author | Catherine Devlin <catherine.devlin@gmail.com> |
---|---|
date | Sun, 07 Nov 2010 09:24:11 -0500 |
parents | cc5c68e15a83 |
children | a53ba40b9848 |
comparison
equal
deleted
inserted
replaced
406:cc5c68e15a83 | 407:f5aa16a22b52 |
---|---|
422 if not editor: | 422 if not editor: |
423 if sys.platform[:3] == 'win': | 423 if sys.platform[:3] == 'win': |
424 editor = 'notepad' | 424 editor = 'notepad' |
425 else: | 425 else: |
426 for editor in ['gedit', 'kate', 'vim', 'emacs', 'nano', 'pico']: | 426 for editor in ['gedit', 'kate', 'vim', 'emacs', 'nano', 'pico']: |
427 if not subprocess.Popen(['which', editor], stdout=subprocess.PIPE).communicate()[0]: | 427 if subprocess.Popen(['which', editor], stdout=subprocess.PIPE).communicate()[0]: |
428 break | 428 break |
429 | 429 |
430 colorcodes = {'bold':{True:'\x1b[1m',False:'\x1b[22m'}, | 430 colorcodes = {'bold':{True:'\x1b[1m',False:'\x1b[22m'}, |
431 'cyan':{True:'\x1b[36m',False:'\x1b[39m'}, | 431 'cyan':{True:'\x1b[36m',False:'\x1b[39m'}, |
432 'blue':{True:'\x1b[34m',False:'\x1b[39m'}, | 432 'blue':{True:'\x1b[34m',False:'\x1b[39m'}, |