|
From: <ki...@us...> - 2002-12-20 03:15:06
|
Update of /cvsroot/pymerase/pymerase/output
In directory sc8-pr-cvs1:/tmp/cvs-serv8901
Modified Files:
CreatePyTkWidgets.py
Log Message:
Updated for validating entries
Index: CreatePyTkWidgets.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/output/CreatePyTkWidgets.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** CreatePyTkWidgets.py 13 Dec 2002 00:36:16 -0000 1.2
--- CreatePyTkWidgets.py 20 Dec 2002 03:15:03 -0000 1.3
***************
*** 54,59 ****
--- 54,93 ----
def getTemplate():
template = """#!/usr/bin/env python
+ ###########################################################################
+ # #
+ # C O P Y R I G H T N O T I C E #
+ # Copyright (c) 2002 by: #
+ # * California Institute of Technology #
+ # #
+ # All Rights Reserved. #
+ # #
+ # Permission is hereby granted, free of charge, to any person #
+ # obtaining a copy of this software and associated documentation files #
+ # (the "Software"), to deal in the Software without restriction, #
+ # including without limitation the rights to use, copy, modify, merge, #
+ # publish, distribute, sublicense, and/or sell copies of the Software, #
+ # and to permit persons to whom the Software is furnished to do so, #
+ # subject to the following conditions: #
+ # #
+ # The above copyright notice and this permission notice shall be #
+ # included in all copies or substantial portions of the Software. #
+ # #
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, #
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF #
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND #
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS #
+ # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN #
+ # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN #
+ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE #
+ # SOFTWARE. #
+ ###########################################################################
+ #
+ # Generated By: Pymerase (CreatePyTkWidgets Output Module)
+ # URL: http://pymerase.sourceforge.net
+ # Last Modified: $Date$
+ #
import Tkinter
+ from output.PyTkWidgets import ValidatingEntry
class %CLASSNAME%Widget:
***************
*** 73,77 ****
if __name__ == '__main__':
! root = Tkinter.Tk(className=\" %CLASSNAME%\")
%CLASSNAME%gui = %CLASSNAME%Widget(root)
root.mainloop()
--- 107,112 ----
if __name__ == '__main__':
! root = Tkinter.Tk()
! root.title(\"%CLASSNAME%\")
%CLASSNAME%gui = %CLASSNAME%Widget(root)
root.mainloop()
***************
*** 141,151 ****
myClass.getName(TRANSLATOR_NAME))
#Process Foriegn keys
! #if isFKey(attrib.getName(TRANSLATOR_NAME)) or type == "serial":
! # pass
#Process Integers and Doubles
if type == "integer" or type == "double precision":
! pass
elif type == "name":
! pass
#Process Text
elif type == "text":
--- 176,186 ----
myClass.getName(TRANSLATOR_NAME))
#Process Foriegn keys
! if attrib.isPrimaryKey() or type == "serial":
! print 'Ignoring Primary Key'
#Process Integers and Doubles
if type == "integer" or type == "double precision":
! print "FIXME: Ignoring Int or Float"
elif type == "name":
! print "FIXME: Ignoring name"
#Process Text
elif type == "text":
***************
*** 165,170 ****
elif PymeraseType.isVarchar(type):
code = re.sub('%VAR_ELEMENT%',
! util.makeLabelEntry(attrib.getName(DBAPI_TRANSLATOR),
! attrib.getName(TRANSLATOR_NAME)),
code)
code = re.sub('%GET_FUNCTION%',
--- 200,206 ----
elif PymeraseType.isVarchar(type):
code = re.sub('%VAR_ELEMENT%',
! util.makeLabelMaxLengthEntry(attrib.getName(DBAPI_TRANSLATOR),
! attrib.getName(TRANSLATOR_NAME),
! int(PymeraseType.getVarcharLen(type))),
code)
code = re.sub('%GET_FUNCTION%',
***************
*** 178,190 ****
#Process Characters
elif PymeraseType.isChar(type):
! pass
! #PymeraseType.getVarcharLen(type),
#Process Boolean
elif type == "boolean":
! pass
#Process Time Stamps
elif type == "timestamp with time zone":
! pass
#Write out what is not being handled.
else:
--- 214,245 ----
#Process Characters
elif PymeraseType.isChar(type):
! code = re.sub('%VAR_ELEMENT%',
! util.makeLabelMaxLengthEntry(attrib.getName(DBAPI_TRANSLATOR),
! attrib.getName(TRANSLATOR_NAME),
! 1),
! code)
! code = re.sub('%GET_FUNCTION%',
! util.makeGetLabelEntry(attrib.getName(DBAPI_TRANSLATOR)),
! code)
!
! code = re.sub('%SET_FUNCTION%',
! util.makeSetLabelEntry(attrib.getName(DBAPI_TRANSLATOR)),
! code)
#Process Boolean
elif type == "boolean":
! code = re.sub('%VAR_ELEMENT%',
! util.makeRadioBoolean(attrib.getName(DBAPI_TRANSLATOR),
! attrib.getName(TRANSLATOR_NAME)),
! code)
! code = re.sub('%GET_FUNCTION%',
! util.makeGetRadioBoolean(attrib.getName(DBAPI_TRANSLATOR)),
! code)
! code = re.sub('%SET_FUNCTION%',
! util.makeSetRadioBoolean(attrib.getName(DBAPI_TRANSLATOR)),
! code)
#Process Time Stamps
elif type == "timestamp with time zone":
! print "FIXME: Ignoring timestamp"
#Write out what is not being handled.
else:
***************
*** 193,196 ****
--- 248,252 ----
type,
attrib.getName(TRANSLATOR_NAME))
+ print "Please e-mail the line above to pym...@li..."
#Remove '%*%'
|