You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(57) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(44) |
Feb
(151) |
Mar
(131) |
Apr
(171) |
May
(125) |
Jun
(43) |
Jul
(26) |
Aug
(19) |
Sep
(10) |
Oct
|
Nov
(4) |
Dec
(28) |
| 2004 |
Jan
(134) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <ki...@us...> - 2003-01-04 00:41:19
|
Update of /cvsroot/pymerase/pymerase/examples/dvd
In directory sc8-pr-cvs1:/tmp/cvs-serv31299
Added Files:
dvd_.xmi
Log Message:
dvd schema xmi
--- NEW FILE: dvd_.xmi ---
<?xml version="1.0" encoding="UTF-8"?>
<XMI xmi.version="1.0">
<XMI.header>
<XMI.documentation>
<XMI.exporter>Novosoft UML Library</XMI.exporter>
<XMI.exporterVersion>0.4.20</XMI.exporterVersion>
</XMI.documentation>
<XMI.metamodel xmi.name="UML" xmi.version="1.3"/>
</XMI.header>
<XMI.content>
<Model_Management.Model xmi.id="xmi.1" xmi.uuid="127-0-0-1-123eb0:f205c0bbe3:-8000">
<Foundation.Core.ModelElement.name>DvdAPI</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isRoot xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isLeaf xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isAbstract xmi.value="false"/>
<Foundation.Core.Namespace.ownedElement>
<Foundation.Core.Class xmi.id="xmi.2" xmi.uuid="127-0-0-1-123eb0:f205c0bbe3:-7fff">
<Foundation.Core.ModelElement.name>Dvd</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isRoot xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isLeaf xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isAbstract xmi.value="false"/>
<Foundation.Core.Class.isActive xmi.value="false"/>
<Foundation.Core.ModelElement.namespace>
<Foundation.Core.Namespace xmi.idref="xmi.1"/>
</Foundation.Core.ModelElement.namespace>
<Foundation.Core.Classifier.feature>
<Foundation.Core.Attribute xmi.id="xmi.3">
<Foundation.Core.ModelElement.name>title</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.visibility xmi.value="public"/>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.Attribute.initialValue>
<Foundation.Data_Types.Expression xmi.id="xmi.4">
<Foundation.Data_Types.Expression.language>Java</Foundation.Data_Types.Expression.language>
</Foundation.Data_Types.Expression>
</Foundation.Core.Attribute.initialValue>
<Foundation.Core.Feature.owner>
<Foundation.Core.Classifier xmi.idref="xmi.2"/>
</Foundation.Core.Feature.owner>
<Foundation.Core.StructuralFeature.type>
<Foundation.Core.Classifier xmi.idref="xmi.5"/>
</Foundation.Core.StructuralFeature.type>
</Foundation.Core.Attribute>
<Foundation.Core.Attribute xmi.id="xmi.6">
<Foundation.Core.ModelElement.name>yearReleased</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.visibility xmi.value="public"/>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.Attribute.initialValue>
<Foundation.Data_Types.Expression xmi.id="xmi.7">
<Foundation.Data_Types.Expression.language>Java</Foundation.Data_Types.Expression.language>
</Foundation.Data_Types.Expression>
</Foundation.Core.Attribute.initialValue>
<Foundation.Core.Feature.owner>
<Foundation.Core.Classifier xmi.idref="xmi.2"/>
</Foundation.Core.Feature.owner>
<Foundation.Core.StructuralFeature.type>
<Foundation.Core.Classifier xmi.idref="xmi.8"/>
</Foundation.Core.StructuralFeature.type>
</Foundation.Core.Attribute>
</Foundation.Core.Classifier.feature>
</Foundation.Core.Class>
<Foundation.Core.DataType xmi.id="xmi.8">
<Foundation.Core.ModelElement.name>int</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isRoot xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isLeaf xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isAbstract xmi.value="false"/>
<Foundation.Core.ModelElement.namespace>
<Foundation.Core.Namespace xmi.idref="xmi.1"/>
</Foundation.Core.ModelElement.namespace>
</Foundation.Core.DataType>
<Model_Management.Package xmi.id="xmi.9">
<Foundation.Core.ModelElement.name>java</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isRoot xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isLeaf xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isAbstract xmi.value="false"/>
<Foundation.Core.ModelElement.namespace>
<Foundation.Core.Namespace xmi.idref="xmi.1"/>
</Foundation.Core.ModelElement.namespace>
<Foundation.Core.Namespace.ownedElement>
<Model_Management.Package xmi.id="xmi.10">
<Foundation.Core.ModelElement.name>lang</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isRoot xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isLeaf xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isAbstract xmi.value="false"/>
<Foundation.Core.ModelElement.namespace>
<Foundation.Core.Namespace xmi.idref="xmi.9"/>
</Foundation.Core.ModelElement.namespace>
<Foundation.Core.Namespace.ownedElement>
<Foundation.Core.Class xmi.id="xmi.5">
<Foundation.Core.ModelElement.name>String</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isRoot xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isLeaf xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isAbstract xmi.value="false"/>
<Foundation.Core.Class.isActive xmi.value="false"/>
<Foundation.Core.ModelElement.namespace>
<Foundation.Core.Namespace xmi.idref="xmi.10"/>
</Foundation.Core.ModelElement.namespace>
</Foundation.Core.Class>
</Foundation.Core.Namespace.ownedElement>
</Model_Management.Package>
<Model_Management.Package xmi.id="xmi.11">
<Foundation.Core.ModelElement.name>util</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isRoot xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isLeaf xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isAbstract xmi.value="false"/>
<Foundation.Core.ModelElement.namespace>
<Foundation.Core.Namespace xmi.idref="xmi.9"/>
</Foundation.Core.ModelElement.namespace>
<Foundation.Core.Namespace.ownedElement>
<Foundation.Core.Class xmi.id="xmi.12">
<Foundation.Core.ModelElement.name>Date</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isRoot xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isLeaf xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isAbstract xmi.value="false"/>
<Foundation.Core.Class.isActive xmi.value="false"/>
<Foundation.Core.ModelElement.namespace>
<Foundation.Core.Namespace xmi.idref="xmi.11"/>
</Foundation.Core.ModelElement.namespace>
</Foundation.Core.Class>
</Foundation.Core.Namespace.ownedElement>
</Model_Management.Package>
</Foundation.Core.Namespace.ownedElement>
</Model_Management.Package>
<Foundation.Core.Class xmi.id="xmi.13" xmi.uuid="127-0-0-1-123eb0:f205c0bbe3:-7ffc">
<Foundation.Core.ModelElement.name>Studio</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isRoot xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isLeaf xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isAbstract xmi.value="false"/>
<Foundation.Core.Class.isActive xmi.value="false"/>
<Foundation.Core.ModelElement.namespace>
<Foundation.Core.Namespace xmi.idref="xmi.1"/>
</Foundation.Core.ModelElement.namespace>
<Foundation.Core.Classifier.feature>
<Foundation.Core.Attribute xmi.id="xmi.14">
<Foundation.Core.ModelElement.name>name</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.visibility xmi.value="public"/>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.Attribute.initialValue>
<Foundation.Data_Types.Expression xmi.id="xmi.15">
<Foundation.Data_Types.Expression.language>Java</Foundation.Data_Types.Expression.language>
</Foundation.Data_Types.Expression>
</Foundation.Core.Attribute.initialValue>
<Foundation.Core.Feature.owner>
<Foundation.Core.Classifier xmi.idref="xmi.13"/>
</Foundation.Core.Feature.owner>
<Foundation.Core.StructuralFeature.type>
<Foundation.Core.Classifier xmi.idref="xmi.5"/>
</Foundation.Core.StructuralFeature.type>
</Foundation.Core.Attribute>
</Foundation.Core.Classifier.feature>
</Foundation.Core.Class>
<Foundation.Core.Association xmi.id="xmi.16" xmi.uuid="127-0-0-1-123eb0:f205c0bbe3:-7ffb">
<Foundation.Core.ModelElement.name>Studio</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isRoot xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isLeaf xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isAbstract xmi.value="false"/>
<Foundation.Core.ModelElement.namespace>
<Foundation.Core.Namespace xmi.idref="xmi.1"/>
</Foundation.Core.ModelElement.namespace>
<Foundation.Core.Association.connection>
<Foundation.Core.AssociationEnd xmi.id="xmi.17">
<Foundation.Core.ModelElement.name>dvds</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.AssociationEnd.isNavigable xmi.value="true"/>
<Foundation.Core.AssociationEnd.multiplicity>
<Foundation.Data_Types.Multiplicity xmi.id="xmi.18">
<Foundation.Data_Types.Multiplicity.range>
<Foundation.Data_Types.MultiplicityRange xmi.id="xmi.19">
<Foundation.Data_Types.MultiplicityRange.lower>0</Foundation.Data_Types.MultiplicityRange.lower>
<Foundation.Data_Types.MultiplicityRange.upper>-1</Foundation.Data_Types.MultiplicityRange.upper>
</Foundation.Data_Types.MultiplicityRange>
</Foundation.Data_Types.Multiplicity.range>
</Foundation.Data_Types.Multiplicity>
</Foundation.Core.AssociationEnd.multiplicity>
<Foundation.Core.AssociationEnd.association>
<Foundation.Core.Association xmi.idref="xmi.16"/>
</Foundation.Core.AssociationEnd.association>
<Foundation.Core.AssociationEnd.type>
<Foundation.Core.Classifier xmi.idref="xmi.2"/>
</Foundation.Core.AssociationEnd.type>
</Foundation.Core.AssociationEnd>
<Foundation.Core.AssociationEnd xmi.id="xmi.20">
<Foundation.Core.ModelElement.name>studio</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.AssociationEnd.isNavigable xmi.value="true"/>
<Foundation.Core.AssociationEnd.multiplicity>
<Foundation.Data_Types.Multiplicity xmi.id="xmi.21">
<Foundation.Data_Types.Multiplicity.range>
<Foundation.Data_Types.MultiplicityRange xmi.id="xmi.22">
<Foundation.Data_Types.MultiplicityRange.lower>0</Foundation.Data_Types.MultiplicityRange.lower>
<Foundation.Data_Types.MultiplicityRange.upper>1</Foundation.Data_Types.MultiplicityRange.upper>
</Foundation.Data_Types.MultiplicityRange>
</Foundation.Data_Types.Multiplicity.range>
</Foundation.Data_Types.Multiplicity>
</Foundation.Core.AssociationEnd.multiplicity>
<Foundation.Core.AssociationEnd.association>
<Foundation.Core.Association xmi.idref="xmi.16"/>
</Foundation.Core.AssociationEnd.association>
<Foundation.Core.AssociationEnd.type>
<Foundation.Core.Classifier xmi.idref="xmi.13"/>
</Foundation.Core.AssociationEnd.type>
</Foundation.Core.AssociationEnd>
</Foundation.Core.Association.connection>
</Foundation.Core.Association>
</Foundation.Core.Namespace.ownedElement>
</Model_Management.Model>
</XMI.content>
</XMI>
|
|
From: <ki...@us...> - 2003-01-04 00:18:39
|
Update of /cvsroot/pymerase/pymerase/output In directory sc8-pr-cvs1:/tmp/cvs-serv25241 Modified Files: CreatePyTkWidgets.py Log Message: moved templates to PyTkWidgets/Templates.py Index: CreatePyTkWidgets.py =================================================================== RCS file: /cvsroot/pymerase/pymerase/output/CreatePyTkWidgets.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CreatePyTkWidgets.py 3 Jan 2003 23:29:10 -0000 1.7 --- CreatePyTkWidgets.py 4 Jan 2003 00:18:34 -0000 1.8 *************** *** 41,44 **** --- 41,45 ---- from output.PyTkWidgets import HelperUtil + from output.PyTkWidgets.Templates import Templates from util import PymeraseType from ClassMembers import getAllAttributes *************** *** 51,119 **** DBAPI_TRANSLATOR='CreateDBAPI' ############################ # Writer components - 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 - import ValidatingEntry - - class %CLASSNAME%Widget: - - def __init__(self, master): - self.parent = master - - %VAR_ELEMENT% - - def getParent(self): - return self.parent - - %GET_FUNCTION% - - - %SET_FUNCTION% - - if __name__ == '__main__': - root = Tkinter.Tk() - root.title(\"%CLASSNAME%\") - %CLASSNAME%gui = %CLASSNAME%Widget(root) - root.mainloop() - """ - return template - #def isFKey(name): # """ --- 52,60 ---- DBAPI_TRANSLATOR='CreateDBAPI' + codeTemplates = Templates() + ############################ # Writer components #def isFKey(name): # """ *************** *** 181,185 **** for myClass in classList: ! code = getTemplate() #Replace Template %CLASSNAME% with actual class name --- 122,126 ---- for myClass in classList: ! code = codeTemplates.getBasicTemplate() #Replace Template %CLASSNAME% with actual class name *************** *** 293,301 **** #Write out what is not being handled. else: print "Table(%s), Type(%s), Attribute(%s) not processed." % \ (myClass.getName(TRANSLATOR_NAME), type, attrib.getName(TRANSLATOR_NAME)) ! print "Please e-mail the line above to pym...@li..." #Remove '%*%' --- 234,244 ---- #Write out what is not being handled. else: + print "" print "Table(%s), Type(%s), Attribute(%s) not processed." % \ (myClass.getName(TRANSLATOR_NAME), type, attrib.getName(TRANSLATOR_NAME)) ! print "Please e-mail the above line to pym...@li..." ! print "" #Remove '%*%' |
|
From: <ki...@us...> - 2003-01-04 00:15:59
|
Update of /cvsroot/pymerase/pymerase/output/PyTkWidgets
In directory sc8-pr-cvs1:/tmp/cvs-serv24259
Modified Files:
Templates.py
Log Message:
actually returns templates now
Index: Templates.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/output/PyTkWidgets/Templates.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Templates.py 4 Jan 2003 00:07:10 -0000 1.1
--- Templates.py 4 Jan 2003 00:15:56 -0000 1.2
***************
*** 33,38 ****
class Templates:
! def getBasicTemplate():
template = """#!/usr/bin/env python
###########################################################################
--- 33,40 ----
class Templates:
+ def __init__(self):
+ pass
! def getBasicTemplate(self):
template = """#!/usr/bin/env python
###########################################################################
***************
*** 94,101 ****
root.mainloop()
"""
! return template
! def getDbTemplate():
template = """#!/usr/bin/env python
###########################################################################
--- 96,103 ----
root.mainloop()
"""
! return template
! def getDbTemplate(self):
template = """#!/usr/bin/env python
###########################################################################
***************
*** 165,167 ****
root.mainloop()
"""
! return template
--- 167,169 ----
root.mainloop()
"""
! return template
|
|
From: <ki...@us...> - 2003-01-04 00:07:13
|
Update of /cvsroot/pymerase/pymerase/output/PyTkWidgets
In directory sc8-pr-cvs1:/tmp/cvs-serv21884
Added Files:
Templates.py
Log Message:
PyTkWidgets Templates
--- NEW FILE: Templates.py ---
###########################################################################
# #
# C O P Y R I G H T N O T I C E #
# Copyright (c) 2003 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. #
###########################################################################
#
# Authors: Brandon King
# Last Modified: $Date: 2003/01/04 00:07:10 $
#
class Templates:
def getBasicTemplate():
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: 2003/01/04 00:07:10 $
#
import Tkinter
import ValidatingEntry
class %CLASSNAME%Widget:
def __init__(self, master):
self.parent = master
%VAR_ELEMENT%
def getParent(self):
return self.parent
%GET_FUNCTION%
%SET_FUNCTION%
if __name__ == '__main__':
root = Tkinter.Tk()
root.title(\"%CLASSNAME%\")
%CLASSNAME%gui = %CLASSNAME%Widget(root)
root.mainloop()
"""
return template
def getDbTemplate():
template = """#!/usr/bin/env python
###########################################################################
# #
# C O P Y R I G H T N O T I C E #
# Copyright (c) 2003 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: 2003/01/04 00:07:10 $
#
import Tkinter
from %CLASSNAME%Widget import %CLASSNAME%Widget
from SaveWidget import SaveWidget
from dbSession import sessionObj
class %CLASSNAME%DbWidget(%CLASSNAME%Widget):
def __init__(self, master):
self.master = master
self.bodyFrame = Tkinter.Frame(self.master)
self.footerFrame = Tkinter.Frame(self.master)
self.bodyFrame.grid(row=0)
self.footerFrame.grid(row=1)
%CLASSNAME%Widget.__init__(self, self.bodyFrame)
self.SaveWidget = SaveWidget(self.footerFrame, self)
self.session = sessionObj(self.master)
self.dbs = self.session.getDbs()
def save(self):
%SAVE_FUNCTION%
if __name__ == '__main__':
root = Tkinter.Tk()
root.title('%CLASSNAME%DbWidget')
gui = %CLASSNAME%DbWidget(root)
root.mainloop()
"""
return template
|
|
From: <ki...@us...> - 2003-01-03 23:29:16
|
Update of /cvsroot/pymerase/pymerase/output
In directory sc8-pr-cvs1:/tmp/cvs-serv10413
Modified Files:
CreatePyTkWidgets.py
Log Message:
Added copying of static widget objects
Index: CreatePyTkWidgets.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/output/CreatePyTkWidgets.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** CreatePyTkWidgets.py 30 Dec 2002 21:31:34 -0000 1.6
--- CreatePyTkWidgets.py 3 Jan 2003 23:29:10 -0000 1.7
***************
*** 37,40 ****
--- 37,42 ----
import sys
import re
+ import glob
+ import shutil
from output.PyTkWidgets import HelperUtil
***************
*** 89,93 ****
import Tkinter
! from output.PyTkWidgets import ValidatingEntry
class %CLASSNAME%Widget:
--- 91,95 ----
import Tkinter
! import ValidatingEntry
class %CLASSNAME%Widget:
***************
*** 144,147 ****
--- 146,166 ----
+ def copyLib(destination):
+ path, file = os.path.split(HelperUtil.__file__)
+ path = os.path.join(path, "lib")
+ search = os.path.join(path, "*.py")
+
+ filesToCopy = glob.glob(search)
+
+ print ""
+ print "--Copying Lib Files--"
+ for file in filesToCopy:
+ filePath, fileName = os.path.split(file)
+ fileDest = os.path.join(destination, fileName)
+
+ print '%s' % (fileName)
+ shutil.copyfile(file, fileDest)
+ print "--Done--"
+ print ""
###############################################
***************
*** 156,160 ****
util = HelperUtil.HelperUtil()
!
#Iterate through the tables/classes and process the data
for myClass in classList:
--- 175,181 ----
util = HelperUtil.HelperUtil()
!
! copyLib(destination)
!
#Iterate through the tables/classes and process the data
for myClass in classList:
|
|
From: <ki...@us...> - 2003-01-03 23:27:30
|
Update of /cvsroot/pymerase/pymerase/output/PyTkWidgets/lib In directory sc8-pr-cvs1:/tmp/cvs-serv9717 Added Files: SaveWidget.py Log Message: Widget which tells EntryWidgets to save themselves. --- NEW FILE: SaveWidget.py --- #!/usr/bin/env python ########################################################################### # # # C O P Y R I G H T N O T I C E # # Copyright (c) 2003 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. # ########################################################################### # # Author: Brandon King # URL: http://pymerase.sourceforge.net # Last Modified: $Date: 2003/01/03 23:27:26 $ # import Tkinter class SaveWidget: def __init__(self, master, entryWidget): self.parent = master self.entryWidget = entryWidget self.saveButton = Tkinter.Button(self.parent, text="Save", bg='blue', fg='white', command=self.save) self.saveButton.pack() def save(self): self.entryWidget.save() |
|
From: <ki...@us...> - 2003-01-03 23:25:46
|
Update of /cvsroot/pymerase/pymerase/output/PyTkWidgets/lib In directory sc8-pr-cvs1:/tmp/cvs-serv9126 Added Files: ValidatingEntry.py Log Message: Validating Entries (int, float, maxlength) --- NEW FILE: ValidatingEntry.py --- #!/usr/bin/env python from Tkinter import * class ValidatingEntry(Entry): """ ValidatingEntry Class in full or in part from http://effbot.org/zone/tkinter-entry-validate.htm """ # base class for validating entry widgets def __init__(self, master, value="", **kw): apply(Entry.__init__, (self, master), kw) self.__value = value self.__variable = StringVar() self.__variable.set(value) self.__variable.trace("w", self.__callback) self.config(textvariable=self.__variable) def __callback(self, *dummy): value = self.__variable.get() newvalue = self.validate(value) if newvalue is None: self.__variable.set(self.__value) elif newvalue != value: self.__value = newvalue self.__variable.set(newvalue) else: self.__value = value def validate(self, value): # override: return value, new value, or None if invalid return value class IntegerEntry(ValidatingEntry): """ IntergerEntry in full or in part from http://effbot.org/zone/tkinter-entry-validate.htm """ def validate(self, value): try: if value == '': return value elif value: v = int(value) return value except ValueError: return None class FloatEntry(ValidatingEntry): """ FloatEntry in full or in part from http://effbot.org/zone/tkinter-entry-validate.htm """ def validate(self, value): try: if value == '': return value elif value: v = float(value) return value except ValueError: return None class MaxLengthEntry(ValidatingEntry): """ MaxLengthEntry in full or in part from http://effbot.org/zone/tkinter-entry-validate.htm """ def __init__(self, master, value="", maxlength=None, **kw): self.maxlength = maxlength apply(ValidatingEntry.__init__, (self, master), kw) def validate(self, value): if self.maxlength: value = value[:self.maxlength] return value else: return value |
|
From: <ki...@us...> - 2003-01-03 23:23:49
|
Update of /cvsroot/pymerase/pymerase/output/PyTkWidgets/lib In directory sc8-pr-cvs1:/tmp/cvs-serv8453 Added Files: __init__.py Log Message: declare package --- NEW FILE: __init__.py --- #!/usr/bin/env python ########################################################################### # # # C O P Y R I G H T N O T I C E # # Copyright (c) 2003 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. # ########################################################################### # # Authors: Brandon King # Last Modified: $Date: 2003/01/03 23:23:46 $ # |
|
From: <ki...@us...> - 2003-01-03 23:22:59
|
Update of /cvsroot/pymerase/pymerase/output/PyTkWidgets/lib In directory sc8-pr-cvs1:/tmp/cvs-serv8042 Added Files: dbSession.py Log Message: First pass at database session and connection objects --- NEW FILE: dbSession.py --- #!/usr/bin/env python ########################################################################### # # # C O P Y R I G H T N O T I C E # # Copyright (c) 2003 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. # ########################################################################### # # Author: Brandon King # URL: http://pymerase.sourceforge.net # Last Modified: $Date: 2003/01/03 23:22:56 $ # import Tkinter import tkMessageBox #FIXME: Import from proper DBAPI from DvdAPI import DBSession class dbConnect: """ Class used to create a connection to the database (used by sessionObj) """ def __init__(self, master, dsn=None, database=None, user=None, password=None): self.parent = master self.dbs = None if dsn is None and \ database is None and \ user is None and \ password is None: self.display() def display(self): self.top = Tkinter.Toplevel(self.parent) self.top.title("Database Connection") self.HeaderFrame = Tkinter.Frame(self.top) self.BodyFrame = Tkinter.Frame(self.top) self.FooterFrame = Tkinter.Frame(self.top) self.HeaderFrame.grid(row=0) self.BodyFrame.grid(row=1) self.FooterFrame.grid(row=2) self.dsnLabel = Tkinter.Label(self.BodyFrame, text="Host:") self.dsnLabel.grid(row=0, column=0, sticky=Tkinter.E) self.dsnEntry = Tkinter.Entry(self.BodyFrame) self.dsnEntry.grid(row=0, column=1, sticky=Tkinter.W) self.databaseLabel = Tkinter.Label(self.BodyFrame, text="Database:") self.databaseLabel.grid(row=1, column=0, sticky=Tkinter.E) self.databaseEntry = Tkinter.Entry(self.BodyFrame) self.databaseEntry.grid(row=1, column=1, sticky=Tkinter.W) self.userLabel = Tkinter.Label(self.BodyFrame, text="User:") self.userLabel.grid(row=2, column=0, sticky=Tkinter.E) self.userEntry = Tkinter.Entry(self.BodyFrame) self.userEntry.grid(row=2, column=1, sticky=Tkinter.W) self.passwordLabel = Tkinter.Label(self.BodyFrame, text="Password:") self.passwordLabel.grid(row=3, column=0, sticky=Tkinter.E) self.passwordEntry = Tkinter.Entry(self.BodyFrame) self.passwordEntry.grid(row=3, column=1, sticky=Tkinter.W) self.ConnectButton = Tkinter.Button(self.FooterFrame, text="Connect", bg='blue', fg='white', command=self.connect) self.ConnectButton.grid(row=1) self.parent.wait_window(self.top) def getDsn(self): return self.dsnEntry.get() def getDatabase(self): return self.databaseEntry.get() def getUser(self): return self.userEntry.get() def getPassword(self): return self.passwordEntry.get() def connect(self): dsn = self.getDsn() db = self.getDatabase() user = self.getUser() password = self.getPassword() if dsn == "": dsn = None if db == "": db = None if user == "": user = None if password == "": password = None try: self.dbs = DBSession(dsn, db, user, password) print "Connected" self.top.destroy() except: tkMessageBox.showwarning("Warning", "Unable to connect") def getDbs(self): while self.dbs is None: self.display() return self.dbs class sessionObj: """ Session Object for Database Connection """ def __init__(self, master): self.dbs = None self.parent = master def getDbs(self): if self.dbs is None: self.connect() return self.dbs def connect(self, dsn=None, database=None, user=None, password=None): dbCon = dbConnect(self.parent) self.dbs = dbCon.getDbs() if __name__ == '__main__': root = Tkinter.Tk() root.title('Database Connect') l = Tkinter.Label(root, text="Database Connection Test") l.pack() session = sessionObj(root) print session.getDbs() root.mainloop() |
|
From: <ki...@us...> - 2003-01-03 23:18:09
|
Update of /cvsroot/pymerase/pymerase/output/PyTkWidgets/lib In directory sc8-pr-cvs1:/tmp/cvs-serv6235/lib Log Message: Directory /cvsroot/pymerase/pymerase/output/PyTkWidgets/lib added to the repository |
|
From: <ki...@us...> - 2003-01-03 23:17:41
|
Update of /cvsroot/pymerase/pymerase/output/PyTkWidgets In directory sc8-pr-cvs1:/tmp/cvs-serv5918 Removed Files: ValidatingEntry.py Log Message: moved to pymerase/output/PyTkWidgets/lib --- ValidatingEntry.py DELETED --- |
|
From: <ki...@us...> - 2002-12-30 21:31:36
|
Update of /cvsroot/pymerase/pymerase/output
In directory sc8-pr-cvs1:/tmp/cvs-serv18832/output
Modified Files:
CreatePyTkWidgets.py
Log Message:
Updated float and integer get methods
Index: CreatePyTkWidgets.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/output/CreatePyTkWidgets.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** CreatePyTkWidgets.py 23 Dec 2002 19:19:36 -0000 1.5
--- CreatePyTkWidgets.py 30 Dec 2002 21:31:34 -0000 1.6
***************
*** 186,190 ****
code)
code = re.sub('%GET_FUNCTION%',
! util.makeGetLabelEntry(attrib.getName(DBAPI_TRANSLATOR)),
code)
--- 186,190 ----
code)
code = re.sub('%GET_FUNCTION%',
! util.makeGetLabelIntegerEntry(attrib.getName(DBAPI_TRANSLATOR)),
code)
***************
*** 199,203 ****
code)
code = re.sub('%GET_FUNCTION%',
! util.makeGetLabelEntry(attrib.getName(DBAPI_TRANSLATOR)),
code)
--- 199,203 ----
code)
code = re.sub('%GET_FUNCTION%',
! util.makeGetLabelFloatEntry(attrib.getName(DBAPI_TRANSLATOR)),
code)
|
|
From: <ki...@us...> - 2002-12-30 21:30:26
|
Update of /cvsroot/pymerase/pymerase/output/PyTkWidgets
In directory sc8-pr-cvs1:/tmp/cvs-serv18205/output/PyTkWidgets
Modified Files:
HelperUtil.py
Log Message:
Added more support for integers and floats
Index: HelperUtil.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/output/PyTkWidgets/HelperUtil.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** HelperUtil.py 23 Dec 2002 19:19:10 -0000 1.5
--- HelperUtil.py 30 Dec 2002 21:30:23 -0000 1.6
***************
*** 172,175 ****
--- 172,195 ----
return string.join(code, '\n')
+ def makeGetLabelIntegerEntry(self, name):
+
+ code = []
+ code.append(" def get%sEntry(self):" % (name))
+ code.append(" return int(self.%sEntry.get())" % (name))
+ code.append("")
+ code.append("%GET_FUNCTION%")
+
+ return string.join(code, '\n')
+
+ def makeGetLabelFloatEntry(self, name):
+
+ code = []
+ code.append(" def get%sEntry(self):" % (name))
+ code.append(" return float(self.%sEntry.get())" % (name))
+ code.append("")
+ code.append("%GET_FUNCTION%")
+
+ return string.join(code, '\n')
+
def makeSetLabelEntry(self, name):
***************
*** 178,182 ****
code.append(" self.%sEntry.delete(0, Tkinter.END)" % (name))
code.append(" if text is not None:")
! code.append(" self.%sEntry.insert(0, text)" % (name))
code.append("")
code.append("%SET_FUNCTION%")
--- 198,202 ----
code.append(" self.%sEntry.delete(0, Tkinter.END)" % (name))
code.append(" if text is not None:")
! code.append(" self.%sEntry.insert(0, str(text))" % (name))
code.append("")
code.append("%SET_FUNCTION%")
|
|
From: <de...@us...> - 2002-12-24 01:04:49
|
Update of /cvsroot/pymerase/pymerase/util
In directory sc8-pr-cvs1:/tmp/cvs-serv28735
Modified Files:
NameMangling.py
Log Message:
add lowercaseword name mangling convention for genex
Index: NameMangling.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/util/NameMangling.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** NameMangling.py 14 Dec 2002 02:25:35 -0000 1.5
--- NameMangling.py 24 Dec 2002 01:04:43 -0000 1.6
***************
*** 26,30 ****
-
class nullMangler(NameMangler):
"""Given a string leave it alone.
--- 26,29 ----
***************
*** 42,45 ****
--- 41,45 ----
return "append%s" % (self.mangle(name))
+
class CapWord(nullMangler):
"""Given a string convert it to CapWord convention.
***************
*** 78,81 ****
--- 78,82 ----
def createAppender(self, name):
return "append_%s" % (self.mangle(name))
+
class EnglishWord(nullMangler):
***************
*** 102,106 ****
--- 103,120 ----
return "append_%s" % (self.mangle(name))
+
+ class lowercaseword(nullMangler):
+ """Given a string convert it to lowercase.
+ """
+ def mangle(self, name):
+ if type(name) == types.StringType or type(name) == types.UnicodeType:
+ if len(name) > 0:
+ return string.lower(name)
+
+ return ""
+ ################
+ # Name mangling for keys instead of member variables
+
class RelationalKey:
"""Given a name, convert it into primary and foreign key names.
|
|
From: <ki...@us...> - 2002-12-23 19:19:39
|
Update of /cvsroot/pymerase/pymerase/output
In directory sc8-pr-cvs1:/tmp/cvs-serv17673
Modified Files:
CreatePyTkWidgets.py
Log Message:
Now text labels are red and have asteriks if required
Index: CreatePyTkWidgets.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/output/CreatePyTkWidgets.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** CreatePyTkWidgets.py 20 Dec 2002 03:58:42 -0000 1.4
--- CreatePyTkWidgets.py 23 Dec 2002 19:19:36 -0000 1.5
***************
*** 182,186 ****
code = re.sub('%VAR_ELEMENT%',
util.makeLabelIntegerEntry(attrib.getName(DBAPI_TRANSLATOR),
! attrib.getName(TRANSLATOR_NAME)),
code)
code = re.sub('%GET_FUNCTION%',
--- 182,187 ----
code = re.sub('%VAR_ELEMENT%',
util.makeLabelIntegerEntry(attrib.getName(DBAPI_TRANSLATOR),
! attrib.getName(TRANSLATOR_NAME),
! attrib.isRequired()),
code)
code = re.sub('%GET_FUNCTION%',
***************
*** 194,198 ****
code = re.sub('%VAR_ELEMENT%',
util.makeLabelFloatEntry(attrib.getName(DBAPI_TRANSLATOR),
! attrib.getName(TRANSLATOR_NAME)),
code)
code = re.sub('%GET_FUNCTION%',
--- 195,200 ----
code = re.sub('%VAR_ELEMENT%',
util.makeLabelFloatEntry(attrib.getName(DBAPI_TRANSLATOR),
! attrib.getName(TRANSLATOR_NAME),
! attrib.isRequired()),
code)
code = re.sub('%GET_FUNCTION%',
***************
*** 209,213 ****
code = re.sub('%VAR_ELEMENT%',
util.makeLabelText(attrib.getName(DBAPI_TRANSLATOR),
! attrib.getName(TRANSLATOR_NAME)),
code)
code = re.sub('%GET_FUNCTION%',
--- 211,216 ----
code = re.sub('%VAR_ELEMENT%',
util.makeLabelText(attrib.getName(DBAPI_TRANSLATOR),
! attrib.getName(TRANSLATOR_NAME),
! attrib.isRequired()),
code)
code = re.sub('%GET_FUNCTION%',
***************
*** 224,228 ****
util.makeLabelMaxLengthEntry(attrib.getName(DBAPI_TRANSLATOR),
attrib.getName(TRANSLATOR_NAME),
! int(PymeraseType.getVarcharLen(type))),
code)
code = re.sub('%GET_FUNCTION%',
--- 227,232 ----
util.makeLabelMaxLengthEntry(attrib.getName(DBAPI_TRANSLATOR),
attrib.getName(TRANSLATOR_NAME),
! int(PymeraseType.getVarcharLen(type)),
! attrib.isRequired()),
code)
code = re.sub('%GET_FUNCTION%',
***************
*** 239,243 ****
util.makeLabelMaxLengthEntry(attrib.getName(DBAPI_TRANSLATOR),
attrib.getName(TRANSLATOR_NAME),
! 1),
code)
code = re.sub('%GET_FUNCTION%',
--- 243,248 ----
util.makeLabelMaxLengthEntry(attrib.getName(DBAPI_TRANSLATOR),
attrib.getName(TRANSLATOR_NAME),
! 1,
! attrib.isRequired()),
code)
code = re.sub('%GET_FUNCTION%',
***************
*** 253,257 ****
code = re.sub('%VAR_ELEMENT%',
util.makeRadioBoolean(attrib.getName(DBAPI_TRANSLATOR),
! attrib.getName(TRANSLATOR_NAME)),
code)
code = re.sub('%GET_FUNCTION%',
--- 258,263 ----
code = re.sub('%VAR_ELEMENT%',
util.makeRadioBoolean(attrib.getName(DBAPI_TRANSLATOR),
! attrib.getName(TRANSLATOR_NAME),
! attrib.isRequired()),
code)
code = re.sub('%GET_FUNCTION%',
|
|
From: <ki...@us...> - 2002-12-23 19:19:13
|
Update of /cvsroot/pymerase/pymerase/output/PyTkWidgets
In directory sc8-pr-cvs1:/tmp/cvs-serv17066/PyTkWidgets
Modified Files:
HelperUtil.py
Log Message:
Now text labels are red and have asteriks if required
Index: HelperUtil.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/output/PyTkWidgets/HelperUtil.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** HelperUtil.py 20 Dec 2002 03:57:31 -0000 1.4
--- HelperUtil.py 23 Dec 2002 19:19:10 -0000 1.5
***************
*** 52,56 ****
! def getPrimaryKeyLabel(self, name, value):
code = []
--- 52,56 ----
! def getPrimaryKeyLabel(self, name, value, isRequired=0):
code = []
***************
*** 64,68 ****
! def makeLabelEntry(self, name, labelText):
"""
Creates the code for generating a Label & Entry pair and returns the code
--- 64,68 ----
! def makeLabelEntry(self, name, labelText, isRequired=0):
"""
Creates the code for generating a Label & Entry pair and returns the code
***************
*** 72,77 ****
code = []
! code.append(" self.%sLabel = Tkinter.Label(self.parent, text=\"%s:\")" % \
! (name, labelText))
code.append(" self.%sLabel.grid(row=%s, column=0, sticky=Tkinter.E)" % (name, counter))
code.append(" self.%sEntry = Tkinter.Entry(self.parent)" % (name))
--- 72,82 ----
code = []
! if isRequired:
! labelText += "*"
! code.append(" self.%sLabel = Tkinter.Label(self.parent, text=\"%s:\", fg=\"red\")" %\
! (name, labelText))
! else:
! code.append(" self.%sLabel = Tkinter.Label(self.parent, text=\"%s:\")" % \
! (name, labelText))
code.append(" self.%sLabel.grid(row=%s, column=0, sticky=Tkinter.E)" % (name, counter))
code.append(" self.%sEntry = Tkinter.Entry(self.parent)" % (name))
***************
*** 82,86 ****
return string.join(code, '\n')
! def makeLabelIntegerEntry(self, name, labelText):
"""
Creates the code for generating a Label & Entry pair and returns the code
--- 87,91 ----
return string.join(code, '\n')
! def makeLabelIntegerEntry(self, name, labelText, isRequired=0):
"""
Creates the code for generating a Label & Entry pair and returns the code
***************
*** 90,95 ****
code = []
! code.append(" self.%sLabel = Tkinter.Label(self.parent, text=\"%s:\")" % \
! (name, labelText))
code.append(" self.%sLabel.grid(row=%s, column=0, sticky=Tkinter.E)" % (name, counter))
code.append(" self.%sEntry = ValidatingEntry.IntegerEntry(self.parent)" % (name))
--- 95,105 ----
code = []
! if isRequired:
! labelText += "*"
! code.append(" self.%sLabel = Tkinter.Label(self.parent, text=\"%s:\", fg=\"red\")" % \
! (name, labelText))
! else:
! code.append(" self.%sLabel = Tkinter.Label(self.parent, text=\"%s:\")" % \
! (name, labelText))
code.append(" self.%sLabel.grid(row=%s, column=0, sticky=Tkinter.E)" % (name, counter))
code.append(" self.%sEntry = ValidatingEntry.IntegerEntry(self.parent)" % (name))
***************
*** 100,104 ****
return string.join(code, '\n')
! def makeLabelFloatEntry(self, name, labelText):
"""
Creates the code for generating a Label & Entry pair and returns the code
--- 110,114 ----
return string.join(code, '\n')
! def makeLabelFloatEntry(self, name, labelText, isRequired=0):
"""
Creates the code for generating a Label & Entry pair and returns the code
***************
*** 108,113 ****
code = []
! code.append(" self.%sLabel = Tkinter.Label(self.parent, text=\"%s:\")" % \
! (name, labelText))
code.append(" self.%sLabel.grid(row=%s, column=0, sticky=Tkinter.E)" % (name, counter))
code.append(" self.%sEntry = ValidatingEntry.FloatEntry(self.parent)" % (name))
--- 118,128 ----
code = []
! if isRequired:
! labelText += "*"
! code.append(" self.%sLabel = Tkinter.Label(self.parent, text=\"%s:\", fg=\"red\")" % \
! (name, labelText))
! else:
! code.append(" self.%sLabel = Tkinter.Label(self.parent, text=\"%s:\")" % \
! (name, labelText))
code.append(" self.%sLabel.grid(row=%s, column=0, sticky=Tkinter.E)" % (name, counter))
code.append(" self.%sEntry = ValidatingEntry.FloatEntry(self.parent)" % (name))
***************
*** 118,122 ****
return string.join(code, '\n')
! def makeLabelMaxLengthEntry(self, name, labelText, max=None):
"""
Creates the code for generating a Label & Entry pair and returns the code
--- 133,137 ----
return string.join(code, '\n')
! def makeLabelMaxLengthEntry(self, name, labelText, max=None, isRequired=0):
"""
Creates the code for generating a Label & Entry pair and returns the code
***************
*** 126,131 ****
code = []
! code.append(" self.%sLabel = Tkinter.Label(self.parent, text=\"%s:\")" % \
! (name, labelText))
code.append(" self.%sLabel.grid(row=%s, column=0, sticky=Tkinter.E)" % (name, counter))
code.append(" self.%sEntry = ValidatingEntry.MaxLengthEntry(self.parent,"\
--- 141,151 ----
code = []
! if isRequired:
! labelText += "*"
! code.append(" self.%sLabel = Tkinter.Label(self.parent, text=\"%s:\", fg=\"red\")" % \
! (name, labelText))
! else:
! code.append(" self.%sLabel = Tkinter.Label(self.parent, text=\"%s:\")" % \
! (name, labelText))
code.append(" self.%sLabel.grid(row=%s, column=0, sticky=Tkinter.E)" % (name, counter))
code.append(" self.%sEntry = ValidatingEntry.MaxLengthEntry(self.parent,"\
***************
*** 165,169 ****
! def makeLabelText(self, name, labelText):
"""
Creates the code for generating a Label & Text pair and returns the code
--- 185,189 ----
! def makeLabelText(self, name, labelText, isRequired=0):
"""
Creates the code for generating a Label & Text pair and returns the code
***************
*** 172,177 ****
code = []
! code.append(" self.%sLabel = Tkinter.Label(self.parent, text=\"%s:\")" % \
! (name, labelText))
code.append(" self.%sLabel.grid(row=%s, column=0, sticky=Tkinter.E)" % (name, counter))
code.append(" self.%sText = Tkinter.Text(self.parent, width=40, height=5)" % (name))
--- 192,202 ----
code = []
! if isRequired:
! labelText += "*"
! code.append(" self.%sLabel = Tkinter.Label(self.parent, text=\"%s:\", fg=\"red\")" % \
! (name, labelText))
! else:
! code.append(" self.%sLabel = Tkinter.Label(self.parent, text=\"%s:\")" % \
! (name, labelText))
code.append(" self.%sLabel.grid(row=%s, column=0, sticky=Tkinter.E)" % (name, counter))
code.append(" self.%sText = Tkinter.Text(self.parent, width=40, height=5)" % (name))
***************
*** 206,210 ****
! def makeRadioBoolean(self, name, labelText):
"""
Creates the code for generating a True/False Radiobutton pair and returns the code
--- 231,235 ----
! def makeRadioBoolean(self, name, labelText, isRequired=0):
"""
Creates the code for generating a True/False Radiobutton pair and returns the code
***************
*** 215,220 ****
code = []
code.append(" self.%sFrame = Tkinter.Frame(self.parent)" % (name))
! code.append(" self.%sLabel = Tkinter.Label(self.parent, text=\"%s:\")" % \
! (name, labelText))
code.append(" self.%sBooleanVar = Tkinter.IntVar()" % (name))
--- 240,250 ----
code = []
code.append(" self.%sFrame = Tkinter.Frame(self.parent)" % (name))
! if isRequired:
! labelText += "*"
! code.append(" self.%sLabel = Tkinter.Label(self.parent, text=\"%s:\", fg=\"red\")" % \
! (name, labelText))
! else:
! code.append(" self.%sLabel = Tkinter.Label(self.parent, text=\"%s:\")" % \
! (name, labelText))
code.append(" self.%sBooleanVar = Tkinter.IntVar()" % (name))
|
|
From: <ki...@us...> - 2002-12-20 04:01:28
|
Update of /cvsroot/pymerase/pymerase/examples/dvd/schema
In directory sc8-pr-cvs1:/tmp/cvs-serv20435/examples/dvd/schema
Modified Files:
Dvd.xml
Log Message:
fixed datatype
Index: Dvd.xml
===================================================================
RCS file: /cvsroot/pymerase/pymerase/examples/dvd/schema/Dvd.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Dvd.xml 11 Dec 2002 17:45:20 -0000 1.3
--- Dvd.xml 20 Dec 2002 04:01:24 -0000 1.4
***************
*** 10,14 ****
<column name="yearReleased"
full_name="Year Released"
! type="varchar(128)"
comment="The year the movie was released"/>
<column name="studio_fk"
--- 10,14 ----
<column name="yearReleased"
full_name="Year Released"
! type="int4"
comment="The year the movie was released"/>
<column name="studio_fk"
***************
*** 20,24 ****
foreign_table_pkey ="studio_pk"
fkey_type ="&fkey_mto;"
! local_association_name ="movie_studio"
! foreign_association_name ="released_movies"/>
</table>
--- 20,24 ----
foreign_table_pkey ="studio_pk"
fkey_type ="&fkey_mto;"
! local_association_name ="released_movies"
! foreign_association_name ="movie_studio"/>
</table>
|
|
From: <ki...@us...> - 2002-12-20 03:58:46
|
Update of /cvsroot/pymerase/pymerase/output
In directory sc8-pr-cvs1:/tmp/cvs-serv18777/output
Modified Files:
CreatePyTkWidgets.py
Log Message:
supports ints, floats, and doubles now.
Index: CreatePyTkWidgets.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/output/CreatePyTkWidgets.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** CreatePyTkWidgets.py 20 Dec 2002 03:15:03 -0000 1.3
--- CreatePyTkWidgets.py 20 Dec 2002 03:58:42 -0000 1.4
***************
*** 179,186 ****
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":
--- 179,208 ----
print 'Ignoring Primary Key'
#Process Integers and Doubles
! if type == "integer":
! code = re.sub('%VAR_ELEMENT%',
! util.makeLabelIntegerEntry(attrib.getName(DBAPI_TRANSLATOR),
! attrib.getName(TRANSLATOR_NAME)),
! 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)
! elif type == "double precision":
! code = re.sub('%VAR_ELEMENT%',
! util.makeLabelFloatEntry(attrib.getName(DBAPI_TRANSLATOR),
! attrib.getName(TRANSLATOR_NAME)),
! 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)
elif type == "name":
! print "FIXME: Ignoring name type"
#Process Text
elif type == "text":
|
|
From: <ki...@us...> - 2002-12-20 03:57:34
|
Update of /cvsroot/pymerase/pymerase/output/PyTkWidgets
In directory sc8-pr-cvs1:/tmp/cvs-serv18292/output/PyTkWidgets
Modified Files:
HelperUtil.py
Log Message:
changed label layout
Index: HelperUtil.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/output/PyTkWidgets/HelperUtil.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** HelperUtil.py 20 Dec 2002 03:16:06 -0000 1.3
--- HelperUtil.py 20 Dec 2002 03:57:31 -0000 1.4
***************
*** 165,187 ****
-
-
-
-
-
-
-
-
def makeLabelText(self, name, labelText):
"""
Creates the code for generating a Label & Text pair and returns the code
"""
code = []
code.append(" self.%sLabel = Tkinter.Label(self.parent, text=\"%s:\")" % \
(name, labelText))
! code.append(" self.%sLabel.grid(row=%s, column=0, sticky=Tkinter.E)" % (name, self.getRowCounter()))
code.append(" self.%sText = Tkinter.Text(self.parent, width=40, height=5)" % (name))
! code.append(" self.%sText.grid(row=%s, column=0, sticky=Tkinter.W)" % (name, self.getRowCounter()))
code.append("")
code.append("%VAR_ELEMENT%")
--- 165,180 ----
def makeLabelText(self, name, labelText):
"""
Creates the code for generating a Label & Text pair and returns the code
"""
+ counter = self.getRowCounter()
code = []
code.append(" self.%sLabel = Tkinter.Label(self.parent, text=\"%s:\")" % \
(name, labelText))
! code.append(" self.%sLabel.grid(row=%s, column=0, sticky=Tkinter.E)" % (name, counter))
code.append(" self.%sText = Tkinter.Text(self.parent, width=40, height=5)" % (name))
! code.append(" self.%sText.grid(row=%s, column=1, sticky=Tkinter.W)" % (name, counter))
code.append("")
code.append("%VAR_ELEMENT%")
|
|
From: <ki...@us...> - 2002-12-20 03:56:35
|
Update of /cvsroot/pymerase/pymerase/util
In directory sc8-pr-cvs1:/tmp/cvs-serv17867/util
Modified Files:
PymeraseType.py
Log Message:
fixed varchar checking
Index: PymeraseType.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/util/PymeraseType.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** PymeraseType.py 20 Dec 2002 02:23:02 -0000 1.9
--- PymeraseType.py 20 Dec 2002 03:56:32 -0000 1.10
***************
*** 55,59 ****
print type
match = re.search('varchar', type)
! if match != None:
return 1
else:
--- 55,60 ----
print type
match = re.search('varchar', type)
! match2 = re.search('character varying', type)
! if match != None or match2 != None:
return 1
else:
|
|
From: <de...@us...> - 2002-12-20 03:22:54
|
Update of /cvsroot/pymerase/pymerase
In directory sc8-pr-cvs1:/tmp/cvs-serv10403
Modified Files:
ClassMembers.py
Log Message:
Removed some unecessary debugging code.
Improved support for associations that link an object back to itself.
Index: ClassMembers.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/ClassMembers.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** ClassMembers.py 14 Dec 2002 02:13:44 -0000 1.15
--- ClassMembers.py 20 Dec 2002 03:21:51 -0000 1.16
***************
*** 199,203 ****
if thisEnd.getAssociation() is None and otherEnd.getAssociation() is None:
- print "no associations"
association = Association(pymeraseConfig, associationName)
association.setUUID(associationUUID)
--- 199,202 ----
***************
*** 209,218 ****
# needed?
elif thisEnd.getAssociation() is None:
- print "this is none"
association = otherEnd.getAssociation()
thisEnd.setAssociation(association)
association.addAssociationEnd(thisEnd)
elif otherEnd.getAssociation() is None:
- print "other is none"
association = thisEnd.getAssociation()
otherEnd.setAssociation(association)
--- 208,215 ----
***************
*** 233,242 ****
self.name = name
! self.associationEnds = {}
def addAssociationEnd(self, associationEnd):
if len(self.associationEnds) <= 2:
# mark the AssociationEnd as being owned by this Association
! self.associationEnds[associationEnd] = associationEnd
else:
raise RangeError("Only allowed to have 2 AssociationEnd per Association")
--- 230,242 ----
self.name = name
! self.associationEnds = []
def addAssociationEnd(self, associationEnd):
if len(self.associationEnds) <= 2:
# mark the AssociationEnd as being owned by this Association
! # we were using a dictionary to prevent multiple references
! # from being added to the associationEnd list
! #self.associationEnds[associationEnd] = associationEnd
! self.associationEnds.append(associationEnd)
else:
raise RangeError("Only allowed to have 2 AssociationEnd per Association")
***************
*** 252,256 ****
"""Return the list of association ends attached to this association
"""
! return self.associationEnds.values()
def __len__(self):
--- 252,257 ----
"""Return the list of association ends attached to this association
"""
! #return self.associationEnds.values()
! return self.associationEnds
def __len__(self):
***************
*** 355,359 ****
return None
else:
! return filter(lambda x: x != self, self.association.getLinks())[0]
def getGetterName(self, translatorName):
--- 356,369 ----
return None
else:
! otherEnd = filter(lambda x: x != self, self.association.getLinks())
! if len(otherEnd) == 1:
! return otherEnd[0]
! elif len(otherEnd) == 0 and len(self.association.getLinks()) == 2:
! # we have a self referental (object where both ends are the same
! # object. So it doesn't matter which one we return
! return self.association.getLinks()[0]
! else:
! raise RuntimeError("association had the wrong number of links %d instead of 2" % len())
!
def getGetterName(self, translatorName):
|
|
From: <ki...@us...> - 2002-12-20 03:18:26
|
Update of /cvsroot/pymerase/pymerase/output/PyTkWidgets In directory sc8-pr-cvs1:/tmp/cvs-serv9600 Added Files: ValidatingEntry.py Log Message: Validating Entries --- NEW FILE: ValidatingEntry.py --- #!/usr/bin/env python from Tkinter import * class ValidatingEntry(Entry): """ ValidatingEntry Class in full or in part from http://effbot.org/zone/tkinter-entry-validate.htm """ # base class for validating entry widgets def __init__(self, master, value="", **kw): apply(Entry.__init__, (self, master), kw) self.__value = value self.__variable = StringVar() self.__variable.set(value) self.__variable.trace("w", self.__callback) self.config(textvariable=self.__variable) def __callback(self, *dummy): value = self.__variable.get() newvalue = self.validate(value) if newvalue is None: self.__variable.set(self.__value) elif newvalue != value: self.__value = newvalue self.__variable.set(newvalue) else: self.__value = value def validate(self, value): # override: return value, new value, or None if invalid return value class IntegerEntry(ValidatingEntry): """ IntergerEntry in full or in part from http://effbot.org/zone/tkinter-entry-validate.htm """ def validate(self, value): try: if value == '': return value elif value: v = int(value) return value except ValueError: return None class FloatEntry(ValidatingEntry): """ FloatEntry in full or in part from http://effbot.org/zone/tkinter-entry-validate.htm """ def validate(self, value): try: if value == '': return value elif value: v = float(value) return value except ValueError: return None class MaxLengthEntry(ValidatingEntry): """ MaxLengthEntry in full or in part from http://effbot.org/zone/tkinter-entry-validate.htm """ def __init__(self, master, value="", maxlength=None, **kw): self.maxlength = maxlength apply(ValidatingEntry.__init__, (self, master), kw) def validate(self, value): if self.maxlength: value = value[:self.maxlength] return value else: return value |
|
From: <ki...@us...> - 2002-12-20 03:16:09
|
Update of /cvsroot/pymerase/pymerase/output/PyTkWidgets
In directory sc8-pr-cvs1:/tmp/cvs-serv9084
Modified Files:
HelperUtil.py
Log Message:
Added boolean support and updated for validating Entries
Index: HelperUtil.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/output/PyTkWidgets/HelperUtil.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** HelperUtil.py 13 Dec 2002 00:36:52 -0000 1.2
--- HelperUtil.py 20 Dec 2002 03:16:06 -0000 1.3
***************
*** 32,35 ****
--- 32,36 ----
#
import string
+ #from output.PyTkWidgets import ValidatingEntry
class HelperUtil:
***************
*** 56,60 ****
code.append(" self.%sLabel = Tkinter.Label(self.parent, text=\"%s: %s\")" % \
(label, label, value))
! code.append(" self.%sLabel.grid(row=%s, column=0)" % (label, self.getRowCounter()))
code.append("")
code.append("%VAR_ELEMENT%")
--- 57,61 ----
code.append(" self.%sLabel = Tkinter.Label(self.parent, text=\"%s: %s\")" % \
(label, label, value))
! code.append(" self.%sLabel.grid(row=%s, column=0, sticky=Tkinter.E)" % (label, self.getRowCounter()))
code.append("")
code.append("%VAR_ELEMENT%")
***************
*** 73,79 ****
code.append(" self.%sLabel = Tkinter.Label(self.parent, text=\"%s:\")" % \
(name, labelText))
! code.append(" self.%sLabel.grid(row=%s, column=0)" % (name, counter))
code.append(" self.%sEntry = Tkinter.Entry(self.parent)" % (name))
! code.append(" self.%sEntry.grid(row=%s, column=1)" % (name, counter))
code.append("")
code.append("%VAR_ELEMENT%")
--- 74,138 ----
code.append(" self.%sLabel = Tkinter.Label(self.parent, text=\"%s:\")" % \
(name, labelText))
! code.append(" self.%sLabel.grid(row=%s, column=0, sticky=Tkinter.E)" % (name, counter))
code.append(" self.%sEntry = Tkinter.Entry(self.parent)" % (name))
! code.append(" self.%sEntry.grid(row=%s, column=1, sticky=Tkinter.W)" % (name, counter))
! code.append("")
! code.append("%VAR_ELEMENT%")
!
! return string.join(code, '\n')
!
! def makeLabelIntegerEntry(self, name, labelText):
! """
! Creates the code for generating a Label & Entry pair and returns the code
! """
!
! counter = self.getRowCounter()
!
! code = []
! code.append(" self.%sLabel = Tkinter.Label(self.parent, text=\"%s:\")" % \
! (name, labelText))
! code.append(" self.%sLabel.grid(row=%s, column=0, sticky=Tkinter.E)" % (name, counter))
! code.append(" self.%sEntry = ValidatingEntry.IntegerEntry(self.parent)" % (name))
! code.append(" self.%sEntry.grid(row=%s, column=1, sticky=Tkinter.W)" % (name, counter))
! code.append("")
! code.append("%VAR_ELEMENT%")
!
! return string.join(code, '\n')
!
! def makeLabelFloatEntry(self, name, labelText):
! """
! Creates the code for generating a Label & Entry pair and returns the code
! """
!
! counter = self.getRowCounter()
!
! code = []
! code.append(" self.%sLabel = Tkinter.Label(self.parent, text=\"%s:\")" % \
! (name, labelText))
! code.append(" self.%sLabel.grid(row=%s, column=0, sticky=Tkinter.E)" % (name, counter))
! code.append(" self.%sEntry = ValidatingEntry.FloatEntry(self.parent)" % (name))
! code.append(" self.%sEntry.grid(row=%s, column=1, sticky=Tkinter.W)" % (name, counter))
! code.append("")
! code.append("%VAR_ELEMENT%")
!
! return string.join(code, '\n')
!
! def makeLabelMaxLengthEntry(self, name, labelText, max=None):
! """
! Creates the code for generating a Label & Entry pair and returns the code
! """
!
! counter = self.getRowCounter()
!
! code = []
! code.append(" self.%sLabel = Tkinter.Label(self.parent, text=\"%s:\")" % \
! (name, labelText))
! code.append(" self.%sLabel.grid(row=%s, column=0, sticky=Tkinter.E)" % (name, counter))
! code.append(" self.%sEntry = ValidatingEntry.MaxLengthEntry(self.parent,"\
! "maxlength=%s)" % (name, max))
! if max is not None:
! if max >= 1 and max <= 20:
! code.append(" self.%sEntry['width'] = %s" % (name, max))
! code.append(" self.%sEntry.grid(row=%s, column=1, sticky=Tkinter.W)" % (name, counter))
code.append("")
code.append("%VAR_ELEMENT%")
***************
*** 82,85 ****
--- 141,145 ----
+
def makeGetLabelEntry(self, name):
***************
*** 105,108 ****
--- 165,176 ----
+
+
+
+
+
+
+
+
def makeLabelText(self, name, labelText):
"""
***************
*** 113,119 ****
code.append(" self.%sLabel = Tkinter.Label(self.parent, text=\"%s:\")" % \
(name, labelText))
! code.append(" self.%sLabel.grid(row=%s, column=0)" % (name, self.getRowCounter()))
code.append(" self.%sText = Tkinter.Text(self.parent, width=40, height=5)" % (name))
! code.append(" self.%sText.grid(row=%s, column=0)" % (name, self.getRowCounter()))
code.append("")
code.append("%VAR_ELEMENT%")
--- 181,187 ----
code.append(" self.%sLabel = Tkinter.Label(self.parent, text=\"%s:\")" % \
(name, labelText))
! code.append(" self.%sLabel.grid(row=%s, column=0, sticky=Tkinter.E)" % (name, self.getRowCounter()))
code.append(" self.%sText = Tkinter.Text(self.parent, width=40, height=5)" % (name))
! code.append(" self.%sText.grid(row=%s, column=0, sticky=Tkinter.W)" % (name, self.getRowCounter()))
code.append("")
code.append("%VAR_ELEMENT%")
***************
*** 144,145 ****
--- 212,265 ----
return string.join(code, '\n')
+
+ def makeRadioBoolean(self, name, labelText):
+ """
+ Creates the code for generating a True/False Radiobutton pair and returns the code
+ """
+
+ counter = self.getRowCounter()
+
+ code = []
+ code.append(" self.%sFrame = Tkinter.Frame(self.parent)" % (name))
+ code.append(" self.%sLabel = Tkinter.Label(self.parent, text=\"%s:\")" % \
+ (name, labelText))
+ code.append(" self.%sBooleanVar = Tkinter.IntVar()" % (name))
+
+ code.append(" self.%sRadioTrue = Tkinter.Radiobutton(self.%sFrame," \
+ "text=\"True\", variable=self.%sBooleanVar, value=1)" % (name, name, name))
+
+ code.append(" self.%sRadioFalse = Tkinter.Radiobutton(self.%sFrame," \
+ "text=\"False\", variable=self.%sBooleanVar, value=0)" % (name, name, name))
+
+ code.append(" self.%sLabel.grid(row=%s, column=0, sticky=Tkinter.E)" % (name, counter))
+ code.append(" self.%sRadioTrue.grid(row=0, column=0)" % (name))
+ code.append(" self.%sRadioFalse.grid(row=0, column=1)" % (name))
+ code.append(" self.%sFrame.grid(row=%s, column=1, sticky=Tkinter.W)" % (name, counter))
+ code.append("")
+ code.append("%VAR_ELEMENT%")
+
+ return string.join(code, '\n')
+
+
+ def makeGetRadioBoolean(self, name):
+
+ code = []
+ code.append(" def get%sRadioBoolean(self):" % (name))
+ code.append(" return self.%sBooleanVar.get()" % (name))
+ code.append("")
+ code.append("%GET_FUNCTION%")
+
+ return string.join(code, '\n')
+
+
+ def makeSetRadioBoolean(self, name):
+
+ code = []
+ code.append(" def set%sRadioBoolean(self, num):" % (name))
+ code.append(" self.%sBooleanVar.set(num)" % (name))
+ code.append("")
+ code.append("%SET_FUNCTION%")
+
+ return string.join(code, '\n')
+
+
|
|
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 '%*%'
|
|
From: <ki...@us...> - 2002-12-20 02:48:11
|
Update of /cvsroot/pymerase/pymerase
In directory sc8-pr-cvs1:/tmp/cvs-serv3325
Modified Files:
pymerase.py
Log Message:
configured default name mangler for CreatePyTkWidgets
Index: pymerase.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/pymerase.py,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** pymerase.py 11 Dec 2002 20:29:57 -0000 1.26
--- pymerase.py 20 Dec 2002 02:48:08 -0000 1.27
***************
*** 80,83 ****
--- 80,84 ----
self.nameManglers = {None: util.NameMangling.CapWord(),
'CreateHTMLForm': util.NameMangling.EnglishWord(),
+ 'CreatePyTkWidgets': util.NameMangling.EnglishWord(),
'CreateSQL': util.NameMangling.underscore_word()}
self.defaultPackage = defaultPackage
|