Author: poeml Date: Tue Apr 17 00:20:29 2012 New Revision: 8275 URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=8275&view=rev Log: mb edit: - respect VISUAL environment variable (issue #96) Modified: trunk/docs/mirrors.rst trunk/mb/mb.py trunk/mb/mb/util.py Modified: trunk/docs/mirrors.rst URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/docs/mirrors.rst?rev=8275&r1=8274&r2=8275&view=diff ============================================================================== --- trunk/docs/mirrors.rst (original) +++ trunk/docs/mirrors.rst Tue Apr 17 00:20:29 2012 _at_@ -268,8 +268,8 @@ A mirror (in the mirror database) can be edited with the :program:`mb edit` command. The command will bring up an editor with the mirror's metadata. The -:envvar:`EDITOR` environmental variable is respected, and the editor defaults -to :program:`vim`. +:envvar:`EDITOR` and :envvar:`VISUAL` environmental variable is respected, and +the editor defaults to :program:`vim`. For fields where a Boolean is expected, you can type the value (while editing) in the form of 0/1 instead of true/false (shorter to type). Modified: trunk/mb/mb.py URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/mb/mb.py?rev=8275&r1=8274&r2=8275&view=diff ============================================================================== --- trunk/mb/mb.py (original) +++ trunk/mb/mb.py Tue Apr 17 00:20:29 2012 _at_@ -572,7 +572,7 @@ def do_edit(self, subcmd, opts, identifier): - """${cmd_name}: edit a new mirror entry in $EDITOR + """${cmd_name}: edit a new mirror entry in $EDITOR/$VISUAL Usage: mb edit IDENTIFIER Modified: trunk/mb/mb/util.py URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/mb/mb/util.py?rev=8275&r1=8274&r2=8275&view=diff ============================================================================== --- trunk/mb/mb/util.py (original) +++ trunk/mb/mb/util.py Tue Apr 17 00:20:29 2012 _at_@ -129,7 +129,7 @@ f.close() hash_orig = dgst(filename) - editor = os.getenv('EDITOR', default='vim') + editor = os.getenv('EDITOR', os.getenv('VISUAL', default='vim')) while 1: os.system('%s %s' % (editor, filename)) hash = dgst(filename) _______________________________________________ mirrorbrain-commits mailing list Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/ Note: To remove yourself from this list, send a mail with the content unsubscribe to the address mirrorbrain-commits-request_at_mirrorbrain.orgReceived on Mon Apr 16 2012 - 22:20:31 GMT
This archive was generated by hypermail 2.3.0 : Mon Apr 16 2012 - 22:32:03 GMT