[Zope] Weird (?) Python Script problem
Bruce Eckel
Bruce@EckelObjects.com
Tue, 15 May 2001 10:00:24 -0700
The following script follows all the rules, I think. It
saves fine, and I usually get an exception when I save a
script if there's something wrong with it. But when I try
to run it, it pops up the "Please type your user name and
password" dialog box, and it will not accept my "root" zope
admin password.
## Script (Python) "SeminarID"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=name
##title=
##
import string, time
order_id = string.join(string.split(string.strip(name)),
'') # Remove spaces
idstring = ''
for c in order_id:
if c in string.letters: # Take only characters
idstring = idstring + c
order_id = idstring[0:20] # Take only the first 20
characters
order_id = "%s%x" % (order_id, time.time()) # Combine with
current time in hex for unique ID
return order_id
Most current information can be found at:
http://www.mindview.net/Etc/notes.html
===================
Bruce Eckel http://www.BruceEckel.com
Contains free electronic books: "Thinking in Java 2e" &
"Thinking in C++ 2e"
Please subscribe to my free newsletter -- just send any
email to:
join-eckel-oo-programming@earth.lyris.net
My schedule can be found at:
http://www.mindview.net/Calendar
===================