readlines returns also the terminating \n.
you have to strip it
hth
rr
Sean Duffy wrote:
> Hi,
>
> I'm trying to do a batch add of users to the standard acl_users folder.
>
> Note quite a total success or total failure just yet.
>
> First I made a text file (usr_pwd.txt) in the form of password space
> username. and placed it (temporarily) in the Extensions
> directory.
>
> 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()
> for x in y:
> z=x.split(' ')
> acl = container.restrictedTraverse( '/foobar/acl_users' )
> acl.userFolderAddUser( z[1], z[0], '', '' )
> return 0
>
> I hit the Test tab and now I have an acl_users folder full of users with the
> correct user names, and their passwords show the
> correct number of characters, however I can't log in using any of the
> user/password combinations.
>
> Should the path '/foobar/acl_users' been simply '/foobar/' or '/foobar' ?
>
> Any suggestions?
>
> Thanks,
>
> Sean
>
> _______________________________________________
> Zope maillist - [email protected]
> http://mail.zope.org/mailman/listinfo/zope
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope-dev )
>
>
begin:vcard
fn:robert rottermann
n:rottermann;robert
email;internet:[EMAIL PROTECTED]
tel;work:031 333 10 20
tel;fax:031 333 10 23
tel;home:031 333 36 03
x-mozilla-html:FALSE
version:2.1
end:vcard
_______________________________________________
Zope maillist - [email protected]
http://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )