From: <el...@us...> - 2003-09-26 05:59:25
|
Update of /cvsroot/funformkit/FunFormKit In directory sc8-pr-cvs1:/tmp/cvs-serv24319 Modified Files: Form.py Log Message: Changed formID generation function to assign and track formIDs based on servlet URL so that formIDs are no longer sensitive to instantiation order. Index: Form.py =================================================================== RCS file: /cvsroot/funformkit/FunFormKit/Form.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Form.py 11 Feb 2003 07:52:09 -0000 1.17 --- Form.py 26 Sep 2003 05:59:22 -0000 1.18 *************** *** 498,508 **** ! nameCount = 1 nameCountLock = threading.Lock() ! def getName(): global nameCount, nameCountLock nameCountLock.acquire() ! name = 'form%i' % nameCount ! nameCount = nameCount + 1 nameCountLock.release() return name --- 498,511 ---- ! nameCount = {} nameCountLock = threading.Lock() ! def getName(servletName): global nameCount, nameCountLock nameCountLock.acquire() ! if servletName in nameCount: ! nameCount[servletName] += 1 ! else: ! nameCount[servletName] = 1 ! name = '%s%i' % (servletName, nameCount[servletName]) nameCountLock.release() return name *************** *** 540,544 **** self._handlerServletURL = handlerServletURL if not name: ! name = getName() self._name = name self._method = method --- 543,547 ---- self._handlerServletURL = handlerServletURL if not name: ! name = getName(handlerServletURL) self._name = name self._method = method |