Skip to content

Commit c1f68bd

Browse files
author
Richard Jones
committed
ehem ... for create too
1 parent 24a179c commit c1f68bd

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

roundup/admin.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1717
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1818
#
19-
# $Id: admin.py,v 1.33 2002-09-26 07:39:21 richard Exp $
19+
# $Id: admin.py,v 1.34 2002-09-26 07:41:54 richard Exp $
2020

2121
import sys, os, getpass, getopt, re, UserDict, shlex, shutil
2222
try:
@@ -579,7 +579,7 @@ def do_display(self, args):
579579
value = cl.get(nodeid, key)
580580
print _('%(key)s: %(value)s')%locals()
581581

582-
def do_create(self, args):
582+
def do_create(self, args, pwre = re.compile(r'{(\w+)}(.+)')):
583583
'''Usage: create classname property=value ...
584584
Create a new entry of a given class.
585585
@@ -642,7 +642,15 @@ def do_create(self, args):
642642
except ValueError, message:
643643
raise UsageError, _('"%(value)s": %(message)s')%locals()
644644
elif isinstance(proptype, hyperdb.Password):
645-
props[propname] = password.Password(value)
645+
m = pwre.match(value)
646+
if m:
647+
# password is being given to us encrypted
648+
p = password.Password()
649+
p.scheme = m.group(1)
650+
p.password = m.group(2)
651+
props[propname] = p
652+
else:
653+
props[propname] = password.Password(value)
646654
elif isinstance(proptype, hyperdb.Multilink):
647655
props[propname] = value.split(',')
648656
elif isinstance(proptype, hyperdb.Boolean):

0 commit comments

Comments
 (0)