comparison roundup-admin @ 470:9f7320624bc2

Added better tokenising to roundup-admin - handles spaces and stuff. Can use quoting or backslashes. See the roundup.token pydoc.
author Richard Jones <richard@users.sourceforge.net>
date Mon, 31 Dec 2001 05:09:20 +0000
parents b579418f7ed1
children f51b017eff05
comparison
equal deleted inserted replaced
469:d35e51360175 470:9f7320624bc2
14 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 14 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
15 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" 15 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
16 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, 16 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
17 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 17 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
18 # 18 #
19 # $Id: roundup-admin,v 1.55 2001-12-17 03:52:47 richard Exp $ 19 # $Id: roundup-admin,v 1.56 2001-12-31 05:09:20 richard Exp $
20 20
21 # python version check 21 # python version check
22 from roundup import version_check 22 from roundup import version_check
23 23
24 import sys, os, getpass, getopt, re, UserDict 24 import sys, os, getpass, getopt, re, UserDict, shlex
25 try: 25 try:
26 import csv 26 import csv
27 except ImportError: 27 except ImportError:
28 csv = None 28 csv = None
29 from roundup import date, hyperdb, roundupdb, init, password 29 from roundup import date, hyperdb, roundupdb, init, password, token
30 import roundup.instance 30 import roundup.instance
31 31
32 class CommandDict(UserDict.UserDict): 32 class CommandDict(UserDict.UserDict):
33 '''Simple dictionary that lets us do lookups using partial keys. 33 '''Simple dictionary that lets us do lookups using partial keys.
34 34
928 import traceback 928 import traceback
929 traceback.print_exc() 929 traceback.print_exc()
930 ret = 1 930 ret = 1
931 return ret 931 return ret
932 932
933 def interactive(self, ws_re=re.compile(r'\s+')): 933 def interactive(self):
934 '''Run in an interactive mode 934 '''Run in an interactive mode
935 ''' 935 '''
936 print 'Roundup {version} ready for input.' 936 print 'Roundup {version} ready for input.'
937 print 'Type "help" for help.' 937 print 'Type "help" for help.'
938 try: 938 try:
945 command = raw_input('roundup> ') 945 command = raw_input('roundup> ')
946 except EOFError: 946 except EOFError:
947 print 'exit...' 947 print 'exit...'
948 break 948 break
949 if not command: continue 949 if not command: continue
950 args = ws_re.split(command) 950 args = token.token_split(command)
951 if not args: continue 951 if not args: continue
952 if args[0] in ('quit', 'exit'): break 952 if args[0] in ('quit', 'exit'): break
953 self.run_command(args) 953 self.run_command(args)
954 954
955 # exit.. check for transactions 955 # exit.. check for transactions
998 tool = AdminTool() 998 tool = AdminTool()
999 sys.exit(tool.main()) 999 sys.exit(tool.main())
1000 1000
1001 # 1001 #
1002 # $Log: not supported by cvs2svn $ 1002 # $Log: not supported by cvs2svn $
1003 # Revision 1.55 2001/12/17 03:52:47 richard
1004 # Implemented file store rollback. As a bonus, the hyperdb is now capable of
1005 # storing more than one file per node - if a property name is supplied,
1006 # the file is called designator.property.
1007 # I decided not to migrate the existing files stored over to the new naming
1008 # scheme - the FileClass just doesn't specify the property name.
1009 #
1003 # Revision 1.54 2001/12/15 23:09:23 richard 1010 # Revision 1.54 2001/12/15 23:09:23 richard
1004 # Some cleanups in roundup-admin, also made it work again... 1011 # Some cleanups in roundup-admin, also made it work again...
1005 # 1012 #
1006 # Revision 1.53 2001/12/13 00:20:00 richard 1013 # Revision 1.53 2001/12/13 00:20:00 richard
1007 # . Centralised the python version check code, bumped version to 2.1.1 (really 1014 # . Centralised the python version check code, bumped version to 2.1.1 (really

Roundup Issue Tracker: http://roundup-tracker.org/