From: <Z3...@us...> - 2011-04-14 19:51:36
|
Revision: 335 http://spd.svn.sourceforge.net/spd/?rev=335&view=rev Author: Z3po Date: 2011-04-14 19:51:29 +0000 (Thu, 14 Apr 2011) Log Message: ----------- multiline support in add and edit entry function. start a multiline with """ and end with it too. Modified Paths: -------------- branches/spd-ng/src/spdCLI.py Modified: branches/spd-ng/src/spdCLI.py =================================================================== --- branches/spd-ng/src/spdCLI.py 2011-04-13 18:51:47 UTC (rev 334) +++ branches/spd-ng/src/spdCLI.py 2011-04-14 19:51:29 UTC (rev 335) @@ -111,7 +111,15 @@ if __passdict[__column][i] is None: __passdict[__column][i] = '' __input = raw_input(__column + ' (' + str(__passdict[__column][i]) + '): ') - if __input != '': + if search('^"""',__input): + tempinput = sub('^"""','',__input) + '\n' + __input = raw_input(' '.ljust(len(__column),'>') + ':') + while not search('"""$',__input): + tempinput = tempinput + __input + '\n' + __input = raw_input(' '.ljust(len(__column),'>') + ':') + tempinput = tempinput + sub('"""$','',__input) + __passdict[__column][i] = tempinput + elif __input != '': __passdict[__column][i] = __input return __passdict # }}} @@ -134,6 +142,14 @@ print "Adding a new Entry to our passfile" for column in columns: value = raw_input(column + ': ') + if search('^"""',value): + tempval = sub('^"""','',value) + '\n' + value = raw_input(column + ': ') + while not search('"""$',value): + tempval = tempval + value + '\n' + value = raw_input(column + ': ') + tempval = tempval + sub('"""$','',value) + value = tempval Entry.update({ column : value }) return Entry # }}} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |