[Zope] resolved: acl_users
Sean Duffy
swduffy at unmc.edu
Wed Jan 3 16:24:26 EST 2007
Hi,
Andreas has pointed out that my personal os.bias module has prevented me from producing pythonically correct code.
Please note the replacement of z1[:-1] with z1.strip() below.
Then an external method (LoadUsers) to read it:
def LoadUsers(self):
f=open('/var/lib/zope/Extensions/usr_pwd.txt', 'r')
y=f.readlines()
return y
And a script (user_load):
## Script (Python) "user_load"
##bind container=container
##bind context=context
##bind namespace=_
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
y=context.LoadUsers()
p=[]
for x in y:
z=x.split(' ')
z0=z[0]
z1=z[1]
z1=z1.strip()
acl = container.restrictedTraverse( '/foobar/acl_users' )
acl.userFolderAddUser( z1, z0, p, '' )
return 0
Sean
More information about the Zope
mailing list