summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5f54cb4)
raw | patch | inline | side by side (parent: 5f54cb4)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Tue, 12 Mar 2002 22:51:47 +0000 (22:51 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Tue, 12 Mar 2002 22:51:47 +0000 (22:51 +0000) |
. #527503 ] unfriendly init blowup when parent dir
(also handles UsageError correctly now in init)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@668 57a73879-2fb5-44c3-a270-3262357dd7e2
(also handles UsageError correctly now in init)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@668 57a73879-2fb5-44c3-a270-3262357dd7e2
CHANGES.txt | patch | blob | history | |
roundup/admin.py | patch | blob | history |
diff --git a/CHANGES.txt b/CHANGES.txt
index 5e637b2f024dd37acd7c455b6751a7a7799e60bc..31c90a798e60d99e24b0e0a90deebb39c5f97948 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
. fixed some problems in date calculations (calendar.py doesn't handle over-
and under-flow). Also, hour/minute/second intervals may now be more than
99 each.
+ . #527416 ] roundup-admin uses undefined value
+ . #527503 ] unfriendly init blowup when parent dir
+ (also handles UsageError correctly now in init)
2002-01-24 - 0.4.0
diff --git a/roundup/admin.py b/roundup/admin.py
index ef7f9217585797379646436c14bdb92d52096994..1fcbe72b7e3c4500d83ce50f5f88c83a215aea81 100644 (file)
--- a/roundup/admin.py
+++ b/roundup/admin.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: admin.py,v 1.8 2002-02-27 03:28:21 richard Exp $
+# $Id: admin.py,v 1.9 2002-03-12 22:51:47 richard Exp $
import sys, os, getpass, getopt, re, UserDict, shlex
try:
'''
if len(args) < 1:
raise UsageError, _('Not enough arguments supplied')
+
+ # make sure the instance home can be created
+ parent = os.path.split(instance_home)[0]
+ if not os.path.exists(parent):
+ raise UsageError, _('Instance home parent directory "%(parent)s"'
+ 'does not exist')%locals()
+
# select template
import roundup.templates
templates = roundup.templates.listTemplates()
if not template:
template = 'classic'
+ # select hyperdb backend
import roundup.backends
backends = roundup.backends.__all__
backend = len(args) > 2 and args[2] or ''
backend = raw_input(_('Select backend [anydbm]: ')).strip()
if not backend:
backend = 'anydbm'
+
+ # admin password
if len(args) > 3:
adminpw = confirm = args[3]
else:
while adminpw != confirm:
adminpw = getpass.getpass(_('Admin Password: '))
confirm = getpass.getpass(_(' Confirm: '))
+
+ # create!
init.init(instance_home, template, backend, adminpw)
+
return 0
props = self.props_from_args(args[1:])
# convert types
- for propname in props.keys():
+ for propname, value in props.items():
# get the property
try:
proptype = properties[propname]
# before we open the db, we may be doing an init
if command == 'initialise':
- return self.do_initialise(self.instance_home, args)
+ try:
+ return self.do_initialise(self.instance_home, args)
+ except UsageError, message:
+ print _('Error: %(message)s')%locals()
+ return 1
# get the instance
try:
instance = roundup.instance.open(self.instance_home)
except ValueError, message:
self.instance_home = ''
- print _("Couldn't open instance: %(message)s")%locals()
+ print _("Error: Couldn't open instance: %(message)s")%locals()
return 1
# only open the database once!
ret = function(args[1:])
except UsageError, message:
print _('Error: %(message)s')%locals()
+ print
print function.__doc__
ret = 1
except:
#
# $Log: not supported by cvs2svn $
+# Revision 1.8 2002/02/27 03:28:21 richard
+# Ran it through pychecker, made fixes
+#
# Revision 1.7 2002/02/20 05:04:32 richard
# Wasn't handling the cvs parser feeding properly.
#