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-02-12 01:58:59
|
Update of /cvsroot/pymerase/htdocs
In directory sc8-pr-cvs1:/tmp/cvs-serv24824
Modified Files:
index.html
Log Message:
include pymerase figure
Index: index.html
===================================================================
RCS file: /cvsroot/pymerase/htdocs/index.html,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** index.html 29 Jan 2003 00:52:57 -0000 1.1.1.1
--- index.html 12 Feb 2003 01:58:56 -0000 1.2
***************
*** 46,49 ****
--- 46,52 ----
extended to also output webpages and can be easily extended to output
whatever else you might like.<br>
+ <div align="center">
+ <img src="images/pymeraseFigure-v3-600x600.jpg" alt="Pymerase Figure">
+ </div>
</td>
</tr>
|
|
From: <ki...@us...> - 2003-02-12 01:58:35
|
Update of /cvsroot/pymerase/htdocs/images In directory sc8-pr-cvs1:/tmp/cvs-serv24732 Added Files: pymeraseFigure-v3-600x600.jpg Log Message: pymeraseFigure-v3 --- NEW FILE: pymeraseFigure-v3-600x600.jpg --- (This appears to be a binary file; contents omitted.) |
|
From: <ki...@us...> - 2003-02-12 01:58:29
|
Update of /cvsroot/pymerase/htdocs/images In directory sc8-pr-cvs1:/tmp/cvs-serv22620 Added Files: pymer.psd pymerase-button-1.5.psd Log Message: template photoshop files --- NEW FILE: pymer.psd --- (This appears to be a binary file; contents omitted.) --- NEW FILE: pymerase-button-1.5.psd --- (This appears to be a binary file; contents omitted.) |
|
From: <ki...@us...> - 2003-02-12 01:30:29
|
Update of /cvsroot/pymerase/pymerase
In directory sc8-pr-cvs1:/tmp/cvs-serv13676
Modified Files:
ClassMembers.py
Log Message:
updated getAllAssociations --> getAllAssociationEnds
updated getAllAttributes, needed a TRANSLATOR_NAME in one of the function calls
Index: ClassMembers.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/ClassMembers.py,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** ClassMembers.py 5 Feb 2003 23:01:40 -0000 1.18
--- ClassMembers.py 12 Feb 2003 01:30:25 -0000 1.19
***************
*** 44,48 ****
if len(tbl.getBaseClassNames(TRANSLATOR_NAME)) > 0:
for tblName in tbl.getBaseClassNames(TRANSLATOR_NAME):
! atts += getAllAttributes(tables, getClassByName(tables, tblName), TRANSLATOR_NAME)
atts += tbl.getAttributes()
return atts
--- 44,52 ----
if len(tbl.getBaseClassNames(TRANSLATOR_NAME)) > 0:
for tblName in tbl.getBaseClassNames(TRANSLATOR_NAME):
! atts += getAllAttributes(tables,
! getClassByName(tables,
! tblName,
! TRANSLATOR_NAME),
! TRANSLATOR_NAME)
atts += tbl.getAttributes()
return atts
***************
*** 51,55 ****
return atts
! def getAllAssociations(tables, tbl, TRANSLATOR_NAME):
"""
Takes a list of all the table objects, and a tbl object which you would like
--- 55,86 ----
return atts
! #########################################################
! #FIXME: Code to be used once UUIDs have been implemented#
! #########################################################
! #def getAllAssociationEnds(tables, tbl, TRANSLATOR_NAME):
! # """
! # Takes a list of all the table objects, and a tbl object which you would like
! # all the associations from, including the association from inherited
! # base classes.
! #
! # returns associations list
! # """
! # assoc = {}
! # if len(tbl.getBaseClassNames(TRANSLATOR_NAME)) > 0:
! # for tblName in tbl.getBaseClassNames(TRANSLATOR_NAME):
! # assoc.update(getAllAssociationEnds(tables,
! # getClassByName(tables,
! # tblName,
! # TRANSLATOR_NAME),
! # TRANSLATOR_NAME))
! # assocEnds = tbl.getAssociationEnds()
! # assoc.update(assocEnds)
! # return assoc
! # else:
! # assoc.update(tbl.getAssociationEnds())
! # return assoc
!
!
! def getAllAssociationEnds(tables, tbl, TRANSLATOR_NAME):
"""
Takes a list of all the table objects, and a tbl object which you would like
***************
*** 59,73 ****
returns associations list
"""
! assoc = []
if len(tbl.getBaseClassNames(TRANSLATOR_NAME)) > 0:
for tblName in tbl.getBaseClassNames(TRANSLATOR_NAME):
! assoc += getAllAssociations(tables, getClassByName(tables, tblName))
! assoc += tbl.getAssociations()
! return assoc
else:
! assoc += tbl.getAssociations()
! return assoc
!
!
###################
--- 90,108 ----
returns associations list
"""
! #FIXME: Temperary function until UUIDs are implemented
! assocList = []
if len(tbl.getBaseClassNames(TRANSLATOR_NAME)) > 0:
for tblName in tbl.getBaseClassNames(TRANSLATOR_NAME):
! assocList.extend(getAllAssociationEnds(tables,
! getClassByName(tables,
! tblName,
! TRANSLATOR_NAME),
! TRANSLATOR_NAME))
! assocList.extend(tbl.getAssociationEnds().values())
! return assocList
else:
! assocList.extend(tbl.getAssociationEnds().values())
! return assocList
!
###################
|
|
From: <ki...@us...> - 2003-02-12 01:27:04
|
Update of /cvsroot/pymerase/pymerase/output
In directory sc8-pr-cvs1:/tmp/cvs-serv13088
Modified Files:
CreateReport.py
Log Message:
now output's class inheritance information
and inheritance of associationEnds
Index: CreateReport.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/output/CreateReport.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** CreateReport.py 5 Feb 2003 22:58:33 -0000 1.3
--- CreateReport.py 12 Feb 2003 01:26:58 -0000 1.4
***************
*** 40,44 ****
from pymerase.ClassMembers import getAllAttributes
! from pymerase.ClassMembers import getAllAssociations
############################
--- 40,44 ----
from pymerase.ClassMembers import getAllAttributes
! from pymerase.ClassMembers import getAllAssociationEnds
############################
***************
*** 61,64 ****
--- 61,69 ----
text.append("CLASS: %s" % (tbl.getName(TRANSLATOR_NAME)))
+ baseClassNames = tbl.getBaseClassNames(TRANSLATOR_NAME)
+ if len(baseClassNames) >= 1:
+ for baseClass in baseClassNames:
+ text.append(" Inherits From: %s" % (baseClass))
+
#Process each attribute in a given table (class)
for attribute in getAllAttributes(tables, tbl, TRANSLATOR_NAME):
***************
*** 77,81 ****
text.append(" isPrimaryKey = %s" % (attribute.isPrimaryKey()))
! for assocEnd in tbl.getAssociationEnds().values():
text.append(" ASSOC END:")
text.append(" Name = %s" % (assocEnd.getName(TRANSLATOR_NAME)))
--- 82,86 ----
text.append(" isPrimaryKey = %s" % (attribute.isPrimaryKey()))
! for assocEnd in getAllAssociationEnds(tables, tbl, TRANSLATOR_NAME):
text.append(" ASSOC END:")
text.append(" Name = %s" % (assocEnd.getName(TRANSLATOR_NAME)))
|
|
From: <ki...@us...> - 2003-02-11 23:25:53
|
Update of /cvsroot/pymerase/pymerase/examples/inheritance
In directory sc8-pr-cvs1:/tmp/cvs-serv2052
Added Files:
createsql.py
Log Message:
sql
--- NEW FILE: createsql.py ---
#!/usr/bin/env python
import sys
import os
import pymerase
import pymerase.input.parseXMI
import pymerase.output.CreateDBAPI
if __name__ == "__main__":
schema = os.path.abspath("./inheritance.xmi")
outputPath = os.path.abspath("./inheritance.sql")
pymerase.run(schema, pymerase.input.parseXMI, outputPath, pymerase.output.CreateSQL)
|
|
From: <ki...@us...> - 2003-02-11 23:25:34
|
Update of /cvsroot/pymerase/pymerase/examples/inheritance In directory sc8-pr-cvs1:/tmp/cvs-serv1789 Added Files: Makefile Log Message: preps .xmi file from .zargo file --- NEW FILE: Makefile --- inheritance.xmi: inheritance.zargo unzip inheritance.zargo inheritance_.xmi mv inheritance_.xmi inheritance.xmi |
|
From: <ki...@us...> - 2003-02-11 23:24:40
|
Update of /cvsroot/pymerase/pymerase/examples/inheritance
In directory sc8-pr-cvs1:/tmp/cvs-serv1460
Added Files:
createpytkdbwidgets.py
Log Message:
Db Widgets
--- NEW FILE: createpytkdbwidgets.py ---
#!/usr/bin/env python
import sys
import os
import pymerase
# NOTE: Jython can't use the python way to load modules based on their name
# NOTE: so we have to manually import the modules we're using
# NOTE: and pass them to pymerase.run
import pymerase.input.parseXMI
import pymerase.output.CreatePyTkDBWidgets
if __name__ == "__main__":
schema = os.path.abspath("./inheritance.xmi")
outputPath = os.path.abspath("./widgets")
#pymerase.run(schema, 'parseXMI', output, 'CreateDBAPI')
pymerase.run(schema, pymerase.input.parseXMI, outputPath, pymerase.output.CreatePyTkDBWidgets)
|
|
From: <ki...@us...> - 2003-02-11 23:24:18
|
Update of /cvsroot/pymerase/pymerase/examples/inheritance
In directory sc8-pr-cvs1:/tmp/cvs-serv1358
Added Files:
createpytkwidgets.py
Log Message:
widgets
--- NEW FILE: createpytkwidgets.py ---
#!/usr/bin/env python
import sys
import os
import pymerase
# NOTE: Jython can't use the python way to load modules based on their name
# NOTE: so we have to manually import the modules we're using
# NOTE: and pass them to pymerase.run
import pymerase.input.parseXMI
import pymerase.output.CreatePyTkWidgets
if __name__ == "__main__":
schema = os.path.abspath("./inheritance.xmi")
outputPath = os.path.abspath("./widgets")
#pymerase.run(schema, 'parseXMI', output, 'CreateDBAPI')
pymerase.run(schema, pymerase.input.parseXMI, outputPath, pymerase.output.CreatePyTkWidgets)
|
|
From: <ki...@us...> - 2003-02-11 23:23:48
|
Update of /cvsroot/pymerase/pymerase/examples/inheritance
In directory sc8-pr-cvs1:/tmp/cvs-serv1078
Added Files:
createreport.py
Log Message:
report
--- NEW FILE: createreport.py ---
#!/usr/bin/env python
import sys
import os
import pymerase
import pymerase.input.parseXMI
import pymerase.output.CreateReport
if __name__ == "__main__":
schema = os.path.abspath("./inheritance.xmi")
outputPath = os.path.abspath("./report.txt")
pymerase.run(schema, pymerase.input.parseXMI, outputPath, pymerase.output.CreateReport)
|
|
From: <ki...@us...> - 2003-02-11 23:20:13
|
Update of /cvsroot/pymerase/pymerase/examples/inheritance In directory sc8-pr-cvs1:/tmp/cvs-serv32030 Added Files: inheritance.zargo Log Message: ArgoUML file --- NEW FILE: inheritance.zargo --- (This appears to be a binary file; contents omitted.) |
|
From: <ki...@us...> - 2003-02-11 23:19:37
|
Update of /cvsroot/pymerase/pymerase/examples/inheritance
In directory sc8-pr-cvs1:/tmp/cvs-serv31848
Added Files:
creategraphvizuml.py
Log Message:
uml
--- NEW FILE: creategraphvizuml.py ---
#!/usr/bin/env python
import sys
import os
import pymerase
import pymerase.input.parseXMI
import pymerase.output.CreateGraphvizUML
if __name__ == "__main__":
schema = os.path.abspath("./inheritance.xmi")
outputPath = os.path.abspath("./inheritance.dot")
pymerase.run(schema, pymerase.input.parseXMI, outputPath, pymerase.output.CreateGraphvizUML)
|
|
From: <ki...@us...> - 2003-02-11 22:44:47
|
Update of /cvsroot/pymerase/pymerase/examples/inheritance
In directory sc8-pr-cvs1:/tmp/cvs-serv11905
Added Files:
createapi.py
Log Message:
api
--- NEW FILE: createapi.py ---
#!/usr/bin/env python
import sys
import os
import pymerase
# NOTE: Jython can't use the python way to load modules based on their name
# NOTE: so we have to manually import the modules we're using
# NOTE: and pass them to pymerase.run
import pymerase.input.parseXMI
import pymerase.output.CreateDBAPI
if __name__ == "__main__":
schema = os.path.abspath("./inheritance.xmi")
outputPath = os.path.abspath("./InheritAPI")
#pymerase.run(schema, 'parseXMI', output, 'CreateDBAPI')
pymerase.run(schema, pymerase.input.parseXMI, outputPath, pymerase.output.CreateDBAPI)
|
|
From: <ki...@us...> - 2003-02-11 22:43:52
|
Update of /cvsroot/pymerase/pymerase/examples/inheritance In directory sc8-pr-cvs1:/tmp/cvs-serv11496/inheritance Log Message: Directory /cvsroot/pymerase/pymerase/examples/inheritance added to the repository |
|
From: <ki...@us...> - 2003-02-11 02:49:50
|
Update of /cvsroot/pymerase/pymerase/output/PyTkWidgets/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv31205
Modified Files:
NavBar.py
Log Message:
Now creates new record if no record exists in database
Index: NavBar.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/output/PyTkWidgets/lib/NavBar.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** NavBar.py 13 Jan 2003 23:50:11 -0000 1.1
--- NavBar.py 11 Feb 2003 02:49:47 -0000 1.2
***************
*** 53,60 ****
self.entryWidget = EntryWidget
- print 'EntryWidget:', EntryWidget
self.dbObj = dbObj
- print 'dbObj:', dbObj
- print 'dbObj():', dbObj()
self.navList = []
--- 53,57 ----
***************
*** 118,121 ****
--- 115,121 ----
if len(self.navList) >= 1 and self.navIndex is None:
self.moveFirst()
+ elif len(self.navList) == 0:
+ print "No records in database..."
+ self.newRecord()
def loadCurrentNav(self):
|
|
From: <ki...@us...> - 2003-02-11 02:46:45
|
Update of /cvsroot/pymerase/pymerase/output/PyTkWidgets
In directory sc8-pr-cvs1:/tmp/cvs-serv30512
Modified Files:
Templates.py
Log Message:
Changed the mode for PyTkDbWidgets to OPTION_MENU
Index: Templates.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/output/PyTkWidgets/Templates.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Templates.py 11 Feb 2003 02:27:53 -0000 1.6
--- Templates.py 11 Feb 2003 02:46:42 -0000 1.7
***************
*** 215,219 ****
root = Tkinter.Tk()
root.title('%CLASSNAME%DbWidget')
! gui = %CLASSNAME%DbWidget(root)
root.mainloop()
"""
--- 215,219 ----
root = Tkinter.Tk()
root.title('%CLASSNAME%DbWidget')
! gui = %CLASSNAME%DbWidget(root, modes.OPTION_MENU)
root.mainloop()
"""
|
|
From: <ki...@us...> - 2003-02-11 02:31:20
|
Update of /cvsroot/pymerase/pymerase/output
In directory sc8-pr-cvs1:/tmp/cvs-serv25717
Modified Files:
CreatePyTkDBWidgets.py
Log Message:
Now generates DB widgets with DEFAULT and OPTION_MENU modes!
OPTION_MENU --> Fk linking =o)
Index: CreatePyTkDBWidgets.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/output/CreatePyTkDBWidgets.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** CreatePyTkDBWidgets.py 7 Feb 2003 18:44:41 -0000 1.2
--- CreatePyTkDBWidgets.py 11 Feb 2003 02:31:16 -0000 1.3
***************
*** 43,49 ****
--- 43,52 ----
from pymerase.output.PyTkWidgets.Templates import Templates
from pymerase.util import PymeraseType
+ from pymerase.util.iPymeraseUtil import getClassByName
+ from pymerase.util.iPymeraseUtil import getAttribByName
from pymerase.ClassMembers import getAllAttributes
from pymerase.ClassMembers import getAllAssociations
+
############################
# Globals
***************
*** 66,70 ****
--- 69,78 ----
sys.exit(2)
+ def getAssociationByName(assocList, name):
+ for assoc in assocList:
+ if assoc.getOppositeEnd().getAttributeName(DBAPI_TRANSLATOR) == name:
+ return assoc
+ return None
###############################################
***************
*** 73,77 ****
def write(destination, classList):
"""
! Creates PyTk Widgets in destination dirctory.
"""
--- 81,85 ----
def write(destination, classList):
"""
! Creates PyTkDB Widgets in destination dirctory.
"""
***************
*** 98,113 ****
#Reset Grid Layout rowCounter
util.resetRowCounter()
!
! for attrib in getAllAttributes(classList, myClass, DBAPI_TRANSLATOR):
type = attrib.getType().getSQLType()
print "Processing(%s:%s)" % (myClass.getName(TRANSLATOR_NAME), type)
! #Process Foriegn keys
if attrib.isPrimaryKey() or type == "serial":
print 'Ignoring Primary Key'
#Process Integers and Doubles
! if type == "integer":
code = re.sub('%SAVE_FUNCTION%',
util.makeSaveLabelEntry(attrib.getName(DBAPI_TRANSLATOR)),
--- 106,165 ----
#Reset Grid Layout rowCounter
util.resetRowCounter()
!
! #Get a list of attributes which are used for associations
! assocList = myClass.getAssociationEnds().values()
! assocAttribNameList = []
! for assocEnd in assocList:
! assocAttribNameList.append(assocEnd.getOppositeEnd().getAttributeName(DBAPI_TRANSLATOR))
!
! #Process all attributes in a given class
! attribList = getAllAttributes(classList, myClass, DBAPI_TRANSLATOR)
! for attrib in attribList:
type = attrib.getType().getSQLType()
+ #Check to see if attribute is also a Foreign Key
+ if attrib.getName(DBAPI_TRANSLATOR) in assocAttribNameList:
+ type = "FK"
+
print "Processing(%s:%s)" % (myClass.getName(TRANSLATOR_NAME), type)
! #Process Primary Keys
if attrib.isPrimaryKey() or type == "serial":
print 'Ignoring Primary Key'
+ #Process Foriegn keys
+ elif type == "FK":
+ assoc = getAssociationByName(assocList, attrib.getName(DBAPI_TRANSLATOR))
+ #oppAssoc - Opposite Association End
+ oppAssoc = assoc.getOppositeEnd()
+ oppAssocClass = getClassByName(classList,
+ oppAssoc.getClassName(DBAPI_TRANSLATOR),
+ DBAPI_TRANSLATOR)
+ oppClassAttribList = getAllAttributes(classList, oppAssocClass, DBAPI_TRANSLATOR)
+ oppClassPkAttrib = getAttribByName(oppClassAttribList,
+ oppAssocClass.getPrimaryKeyName(DBAPI_TRANSLATOR),
+ DBAPI_TRANSLATOR)
+
+ code = re.sub('%OPTION_MENU_DICT%',
+ util.makeOptionMenuDict(attrib.getName(DBAPI_TRANSLATOR),
+ oppAssocClass.getName(DBAPI_TRANSLATOR)),
+ code)
+ code = re.sub('%UPDATE_FUNCTIONS%',
+ util.makeUpdateOptionMenu(oppAssocClass.getName(DBAPI_TRANSLATOR),
+ attrib.getName(DBAPI_TRANSLATOR),
+ oppClassAttribList[1].getGetterName(DBAPI_TRANSLATOR),
+ oppClassPkAttrib.getGetterName(DBAPI_TRANSLATOR)),
+ code)
+ code = re.sub('%LOAD_FUNCTION%',
+ util.makeLoadFk(attrib.getName(DBAPI_TRANSLATOR),
+ oppClassAttribList[1].getGetterName(DBAPI_TRANSLATOR),
+ oppAssocClass.getName(DBAPI_TRANSLATOR)),
+ code)
+ code = re.sub('%SAVE_FUNCTION%',
+ util.makeSaveFk(oppAssocClass.getName(DBAPI_TRANSLATOR),
+ attrib.getName(DBAPI_TRANSLATOR)),
+ code)
#Process Integers and Doubles
! elif type == "integer":
code = re.sub('%SAVE_FUNCTION%',
util.makeSaveLabelEntry(attrib.getName(DBAPI_TRANSLATOR)),
***************
*** 173,176 ****
--- 225,230 ----
code = re.sub('%SAVE_FUNCTION%', '', code)
code = re.sub('%LOAD_FUNCTION%', '', code)
+ code = re.sub('%OPTION_MENU_DICT%', '', code)
+ code = re.sub('%UPDATE_FUNCTIONS%', '', code)
#Write TkWidget to file
|
|
From: <ki...@us...> - 2003-02-11 02:29:44
|
Update of /cvsroot/pymerase/pymerase/output/PyTkWidgets
In directory sc8-pr-cvs1:/tmp/cvs-serv25045
Modified Files:
HelperUtil.py
Log Message:
Updated to support CreatePyTkDbWidgets.py output module with DEFAULT
and OPTION_MENU modes!
Foriegn Key Linking now working in OPTION_MENU mode!!!
Index: HelperUtil.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/output/PyTkWidgets/HelperUtil.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** HelperUtil.py 5 Feb 2003 22:54:27 -0000 1.11
--- HelperUtil.py 11 Feb 2003 02:29:41 -0000 1.12
***************
*** 465,495 ****
! def makeOptionMenuDict(self, name):
code = []
! code.append(" self.%sOptionMenuDict = {}" % (name))
! code.append(" self.update%sOptionMenu()" % (name))
code.append("")
code.append("%OPTION_MENU_DICT%")
! def makeUpdateOptionMenu(self, className, attribName, getterName):
#FIXME: Grabbing wrong end of Association
code = []
code.append(" def update%sOptionMenu(self):" % (attribName))
code.append(" %sList = self.dbs.getAllObjects(self.dbs.%s)" % \
! (className, className))
! code.append(" %sNameList = []" % (className))
code.append("")
code.append(" counter = 0")
! code.append(" for obj in %sList:" % \
! (className))
! code.append(" %sNameList.append(obj.%s())" % \
! (className, getterName))
! code.append(" self.%sOptionMenuDict[obj.%s()] = counter" % \
(attribName, getterName))
code.append(" counter += 1")
code.append("")
code.append(" self.set%sOptionMenu(%sNameList)" % \
! (attribName, className))
code.append("")
code.append("%UPDATE_FUNCTIONS%")
--- 465,501 ----
! def makeOptionMenuDict(self, name, fClassName):
code = []
! code.append(" if mode == modes.OPTION_MENU:")
! code.append(" self.%sOptionMenuDict = {}" % (name))
! code.append(" self.%sPkDict = {}" % (fClassName))
! code.append(" self.update%sOptionMenu()" % (name))
code.append("")
code.append("%OPTION_MENU_DICT%")
! return string.join(code, '\n')
!
! def makeUpdateOptionMenu(self, fClassName, attribName, getterName, pkGetter):
#FIXME: Grabbing wrong end of Association
code = []
code.append(" def update%sOptionMenu(self):" % (attribName))
code.append(" %sList = self.dbs.getAllObjects(self.dbs.%s)" % \
! (fClassName, fClassName))
! code.append(" %sNameList = []" % (fClassName))
code.append("")
code.append(" counter = 0")
! code.append(" for fObj in %sList:" % \
! (fClassName))
! code.append(" %sNameList.append(fObj.%s())" % \
! (fClassName, getterName))
! code.append(" self.%sOptionMenuDict[fObj.%s()] = counter" % \
(attribName, getterName))
+ code.append(" self.%sPkDict[fObj.%s()] = fObj.%s()" % \
+ (fClassName, getterName, pkGetter))
code.append(" counter += 1")
code.append("")
code.append(" self.set%sOptionMenu(%sNameList)" % \
! (attribName, fClassName))
code.append("")
code.append("%UPDATE_FUNCTIONS%")
***************
*** 498,509 ****
! def makeSaveFk(self, className, attribName, sqlName):
! #FIXME: Grabbing wrong end of association
! newCode = []
! newCode.append(" if self.mode == modes.OPTION_MENU:")
! newCode.append(" var = self.get%sOptionMenu()" % \
! (attribName))
! newCode.append(" %sList = self.dbs.getObjectsWhere(self.dbs.%s, '%s = \'%s\'' % var" % \
! (className, className, sqlName, '%s'))
! #FIXME: Not finished yet
--- 504,545 ----
! def makeSaveFk(self, fClassName, attribName):
!
! code = []
! code.append(" if self.mode == modes.OPTION_MENU:")
! code.append(" fObjList = self.dbs.getObjects(self.dbs.%s," %\
! (fClassName))
! code.append(" str(self.%sPkDict[self.get%sOptionMenu()]))" % \
! (fClassName, attribName))
! code.append(" if len(fObjList) == 1:")
! code.append(" obj.setStudio(fObjList[0])")
! code.append(" elif len(fObjList) > 1:")
! code.append(" print \"Many-to-one! Panic! Not implemented yet!\"")
! code.append(" else:")
! code.append(" pass")
! code.append(" else:")
! code.append(" if self.get%sEntry() is not None:" % (attribName))
! code.append(" obj.set%s(self.get%sEntry())" % (attribName, attribName))
! code.append("%SAVE_FUNCTION%")
!
! return string.join(code, '\n')
!
!
! def makeLoadFk(self, attribName, getterName, fClassName):
!
! code = []
! code.append(" if self.mode == modes.OPTION_MENU:")
! code.append(" fObjList = obj.get%s()" % (fClassName))
! code.append(" if len(fObjList) == 1:")
! code.append(" self.%sOptionMenu.selectItemByName(fObjList[0].%s())" % \
! (attribName, getterName))
! code.append(" elif len(fObjList) > 1:")
! code.append(" print \"Many-to-one linking, panic! It's not implemented yet!\"")
! code.append(" self.%sOptionMenu.selectItemByName(fObjList[0].%s())" % \
! (attribName, getterName))
! code.append(" else:")
! code.append(" self.set%sEntry(obj.get%s())" % (attribName, attribName))
! code.append("%LOAD_FUNCTION%")
!
! return string.join(code, '\n')
|
|
From: <ki...@us...> - 2003-02-11 02:27:56
|
Update of /cvsroot/pymerase/pymerase/output/PyTkWidgets
In directory sc8-pr-cvs1:/tmp/cvs-serv24720
Modified Files:
Templates.py
Log Message:
OPTION_MENU_DICT and UPDATE_FUNCTIONS are ready for use
Index: Templates.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/output/PyTkWidgets/Templates.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Templates.py 31 Jan 2003 19:38:06 -0000 1.5
--- Templates.py 11 Feb 2003 02:27:53 -0000 1.6
***************
*** 180,184 ****
self.curDBObj = None
! #%OPTION_MENU_DICT%
self.navBar = NavBar(self.footerFrame, self, self.dbs.%CLASSNAME%, self.session)
--- 180,184 ----
self.curDBObj = None
! %OPTION_MENU_DICT%
self.navBar = NavBar(self.footerFrame, self, self.dbs.%CLASSNAME%, self.session)
***************
*** 189,193 ****
! #%UPDATE_FUNCTIONS%
def setCurrentDBObj(self, obj):
--- 189,193 ----
! %UPDATE_FUNCTIONS%
def setCurrentDBObj(self, obj):
|
|
From: <ki...@us...> - 2003-02-11 02:26:58
|
Update of /cvsroot/pymerase/pymerase/util
In directory sc8-pr-cvs1:/tmp/cvs-serv24467
Modified Files:
iPymeraseUtil.py
Log Message:
Updated functions so that they may be used by output modules
Index: iPymeraseUtil.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/util/iPymeraseUtil.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** iPymeraseUtil.py 30 Oct 2002 23:08:10 -0000 1.3
--- iPymeraseUtil.py 11 Feb 2003 02:26:55 -0000 1.4
***************
*** 67,71 ****
! def getClassByName(classList, className):
"""
Given a list of classes and a className
--- 67,71 ----
! def getClassByName(classList, className, translator=TRANSLATOR_NAME):
"""
Given a list of classes and a className
***************
*** 75,79 ****
"""
for cls in classList:
! if cls.getName(TRANSLATOR_NAME) == className:
return cls
--- 75,79 ----
"""
for cls in classList:
! if cls.getName(translator) == className:
return cls
***************
*** 81,85 ****
! def getAttribByName(attibList, attribName):
"""
Given a list of attributes and an attribute name
--- 81,85 ----
! def getAttribByName(attribList, attribName, translator=TRANSLATOR_NAME):
"""
Given a list of attributes and an attribute name
***************
*** 89,93 ****
"""
for attrib in attribList:
! if attrib.getName(TRANSLATOR_NAME) == attribName:
return attrib
--- 89,93 ----
"""
for attrib in attribList:
! if attrib.getName(translator) == attribName:
return attrib
***************
*** 95,99 ****
! def getAssocByName(assocList, assocName):
"""
Given a list of associations and an association name
--- 95,99 ----
! def getAssocByName(assocList, assocName, translator=TRANSLATOR_NAME):
"""
Given a list of associations and an association name
***************
*** 103,107 ****
"""
for assoc in assocList:
! if assoc.getName(TRANSLATOR_NAME) == assocName:
return assoc
--- 103,107 ----
"""
for assoc in assocList:
! if assoc.getName(translator) == assocName:
return assoc
|
|
From: <ki...@us...> - 2003-02-08 02:20:29
|
Update of /cvsroot/pymerase/pymerase
In directory sc8-pr-cvs1:/tmp/cvs-serv20636
Modified Files:
setup.py
Log Message:
Updated to retrive all examples files that have been checked into cvs
Index: setup.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/setup.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** setup.py 5 Feb 2003 23:01:08 -0000 1.2
--- setup.py 8 Feb 2003 02:20:25 -0000 1.3
***************
*** 40,43 ****
--- 40,47 ----
import sys
+ from ParseCVS import CvsTreeUtil
+
+ util = CvsTreeUtil()
+
########################################
# Copy lib files to prep for install
***************
*** 53,57 ****
shutil.copytree(os.path.join(cwd,"util"), os.path.join(tempDir, "util"))
shutil.copy(os.path.join(cwd, "ClassMembers.py"), tempDir)
! shutil.copy(os.path.join(cwd, "pymerase.py"), os.path.join(tempDir, "__init__.py"))
--- 57,62 ----
shutil.copytree(os.path.join(cwd,"util"), os.path.join(tempDir, "util"))
shutil.copy(os.path.join(cwd, "ClassMembers.py"), tempDir)
! shutil.copy(os.path.join(cwd, "pymerase.py"),
! os.path.join(tempDir, "__init__.py"))
***************
*** 80,135 ****
['README', 'INSTALL'])
- EXAMPLES_TUPLE=(os.path.join(dataFilesPath, 'examples'),
- ['examples/README.examples'])
-
- EXAMPLES_SCHOOL_TUPLE=(os.path.join(dataFilesPath, 'examples/school'),
- ['examples/school/createapi.py',
- 'examples/school/createsql.py',
- 'examples/school/TestSchool.py',
- 'examples/school/data.sql',
- 'examples/school/dataCapWord.sql'])
-
- EXAMPLES_SCHOOL_SCHEMA_TUPLE=(os.path.join(dataFilesPath,
- 'examples/school/schema'),
- glob.glob('examples/school/schema/*.xml'))
-
- EXAMPLES_SCHOOL_SCHEMA_DTD_TUPLE=(os.path.join(dataFilesPath,
- 'examples/school/schema'),
- ['examples/school/schema/table.dtd'])
-
- EXAMPLES_XMISCHOOL_TUPLE=(os.path.join(dataFilesPath, 'examples/xmiSchool'),
- ['examples/xmiSchool/createapi.py',
- 'examples/xmiSchool/createint.py',
- 'examples/xmiSchool/createsql.py',
- 'examples/xmiSchool/Makefile',
- 'examples/xmiSchool/school.zargo'])
-
- EXAMPLES_DVD_TUPLE=(os.path.join(dataFilesPath, 'examples/dvd'),
- ['examples/dvd/createapi.py',
- 'examples/dvd/creategraphvizuml.py',
- 'examples/dvd/createsql.py',
- 'examples/dvd/createpytkwidgets.py',
- 'examples/dvd/createpytkdbwidgets.py',
- 'examples/dvd/createreport.py',
- 'examples/dvd/dvd.zargo',
- 'examples/dvd/dvd_.xmi'])
-
- EXAMPLES_DVD_SCHEMA_TUPLE=(os.path.join(dataFilesPath, 'examples/dvd/schema/'),
- glob.glob('examples/dvd/schema/*.xml'))
-
- EXAMPLES_DVD_SCHEMA_DTD_TUPLE=(os.path.join(dataFilesPath,
- 'examples/dvd/schema'),
- ['examples/dvd/schema/table.dtd'])
-
-
- EXAMPLES_VARTYPES_TUPLE=(os.path.join(dataFilesPath, 'examples/varTypes'),
- ['examples/varTypes/createpytkwidgets.py',
- 'examples/varTypes/createpytkdbwidgets.py',
- 'examples/varTypes/createreport.py',
- 'examples/varTypes/createapi.py',
- 'examples/varTypes/createsql.py',
- 'examples/varTypes/varTypes.zargo',
- 'examples/varTypes/varTypes_.xmi'])
-
WEBUTIL_TEMPLATES_TUPLE=(os.path.join(dataFilesPath, 'templates/webUtil'),
glob.glob("pymerase/output/webUtil/templates/*.html"))
--- 85,88 ----
***************
*** 138,151 ****
DATA_FILES=[BIN_TUPLE,
README_TUPLE,
- EXAMPLES_TUPLE,
- EXAMPLES_SCHOOL_TUPLE,
- EXAMPLES_SCHOOL_SCHEMA_TUPLE,
- EXAMPLES_SCHOOL_SCHEMA_DTD_TUPLE,
- EXAMPLES_XMISCHOOL_TUPLE,
- EXAMPLES_DVD_TUPLE,
- EXAMPLES_DVD_SCHEMA_TUPLE,
- EXAMPLES_DVD_SCHEMA_DTD_TUPLE,
- EXAMPLES_VARTYPES_TUPLE,
WEBUTIL_TEMPLATES_TUPLE]
setup(name="Pymerase",
--- 91,100 ----
DATA_FILES=[BIN_TUPLE,
README_TUPLE,
WEBUTIL_TEMPLATES_TUPLE]
+
+ #util (CvsTreeUtil) will setup all files checked into cvs
+ # for the examples directory...
+ DATA_FILES.extend(util.getSetupDataFiles(dataFilesPath, 'examples'))
+ #FIXME: Grabs .cvsignore files, need to add filter
setup(name="Pymerase",
|
|
From: <ki...@us...> - 2003-02-08 02:19:48
|
Update of /cvsroot/pymerase/pymerase
In directory sc8-pr-cvs1:/tmp/cvs-serv19943
Added Files:
ParseCVS.py
Log Message:
Parses a CVS tree to find all files that have been checked into cvs
Used for the setup.py file so that it will always include all examples that
have been checked into cvs.
--- NEW FILE: ParseCVS.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/02/08 02:19:45 $
#
import os
import string
class CvsTreeUtil:
def __init__(self):
pass
def getSetupDataFiles(self, basePath, dataFilesPath):
"""
getSetupDataFilesTupleList(tree) --> list of tuples to pass
to the setup.py dataFiles variable
"""
parser = ParseCVS()
treeRoot = parser.parseTree(dataFilesPath)
allNodes = treeRoot.getAllNodes()
list = []
for node in allNodes:
list.append((os.path.join(basePath, node.getRelPath()),
node.getRelFilePaths()))
return list
class CvsTreeNode:
def __init__(self):
self.__abspath = None
self.__relpath = None
self.__dirName = None
self.__fileNames = []
self.__filePaths = []
self.__relFilePaths = []
self.__parentNode = None
self.__childrenNodes = []
def getAbsPath(self):
return self.__abspath
def setAbsPath(self, path):
self.__abspath = path
def getFilePaths(self):
return self.__filePaths
def setFilePaths(self, pathList):
self.__filePaths = pathList
def appendFilePath(self, path):
self.__filePaths.append(path)
def getRelPath(self):
return self.__relpath
def getRelFilePaths(self):
return self.__relFilePaths
def updateRelPaths(self):
node = self
list = []
while node.getParentNode() is not None:
dirName = node.getDirName()
if dirName is not None:
list.append(dirName)
node = node.getParentNode()
dirName = node.getDirName()
if dirName is not None:
list.append(dirName)
list.reverse()
self.__relpath = string.join(list, os.sep)
relFilePathList = []
for fileName in self.__fileNames:
relFilePathList.append(os.path.join(self.__relpath, fileName))
self.__relFilePaths = relFilePathList
def updateAllRelPaths(self):
node = self.getRootNode()
nodeList = node.getAllNodes()
for nd in nodeList:
nd.updateRelPaths()
def getAllChildrenNodes(self, node):
nodeList = []
tmpList = node.getChildrenNodes()
if len(tmpList) >= 1:
nodeList.extend(tmpList)
if len(tmpList) >= 1:
for nd in tmpList:
cNodes = self.getAllChildrenNodes(nd)
if len(cNodes) >= 1:
nodeList.extend(cNodes)
return nodeList
else:
return nodeList
def getAllNodes(self):
node = self.getRootNode()
nodeList = [node]
nodeList.extend(self.getAllChildrenNodes(node))
return nodeList
def getDirName(self):
return self.__dirName
def setDirName(self, name):
self.__dirName = name
def getFileNames(self):
return self.__fileNames
def setFileNames(self, fileNameList):
self.__fileNames = fileNameList
def appendFileName(self, fileName):
self.__fileNames.append(fileName)
def getParentNode(self):
return self.__parentNode
def setParentNode(self, node):
self.__parentNode = node
def getChildrenNodes(self):
return self.__childrenNodes
def setChildrenNodes(self, nodeList):
self.__childrenNodes = nodeList
def appendChildNode(self, node):
self.__childrenNodes.append(node)
def getRootNode(self):
node = self
while node.getParentNode() is not None:
node = node.getParentNode()
return node
class ParseCVS:
def __init__(self):
pass
def parseEntries(self, entriesPath):
"""
Parses Cvs Entries File
return (cvsDirs, cvsFiles)
"""
if os.path.exists(entriesPath) and os.path.isfile(entriesPath):
file = open(entriesPath)
entries = file.read()
file.close()
entries = string.split(entries, '\n')
cvsFiles = []
cvsDirs = []
for entry in entries:
entryList = string.split(entry, '/')
if len(entryList) >= 2:
if entryList[0] == 'D':
cvsDirs.append(entryList[1])
elif entryList[0] == '':
cvsFiles.append(entryList[1])
else:
print "WARNING: entry[0]=%s, entry[1]=%s" % \
(entryList[0], entryList[1])
else:
pass
return (cvsDirs, cvsFiles)
else:
print "EntriesPath(%s) Invalid... Ignoring." % (entriesPath)
return ([],[])
def __parseTree(self, treePath):
"""
Parses a cvs tree
"""
treeNode = CvsTreeNode()
if os.path.exists(treePath) and os.path.isdir(treePath):
treeNode.setAbsPath(treePath)
tmp, dirName = os.path.split(treePath)
treeNode.setDirName(dirName)
cvsEntriesPath = os.path.join(treePath, 'CVS', 'Entries')
cvsDirs, cvsFiles = self.parseEntries(cvsEntriesPath)
if len(cvsFiles) >= 1:
treeNode.setFileNames(cvsFiles)
filePathList = []
for fileName in cvsFiles:
filePathList.append(os.path.join(treePath, fileName))
treeNode.setFilePaths(filePathList)
if len(cvsDirs) >= 1:
for directory in cvsDirs:
fullPath = os.path.join(treePath, directory)
extTreeNode = self.__parseTree(fullPath)
if extTreeNode is not None:
treeNode.appendChildNode(extTreeNode)
extTreeNode.setParentNode(treeNode)
return treeNode
else:
return None
def parseTree(self, treePath):
treePath = os.path.abspath(treePath)
treeNode = self.__parseTree(treePath)
treeNode.updateAllRelPaths()
return treeNode
|
|
From: <ki...@us...> - 2003-02-07 18:44:48
|
Update of /cvsroot/pymerase/pymerase/output In directory sc8-pr-cvs1:/tmp/cvs-serv23057 Modified Files: CreatePyTkDBWidgets.py Log Message: updated for setup.py installation Index: CreatePyTkDBWidgets.py =================================================================== RCS file: /cvsroot/pymerase/pymerase/output/CreatePyTkDBWidgets.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CreatePyTkDBWidgets.py 13 Jan 2003 23:52:21 -0000 1.1 --- CreatePyTkDBWidgets.py 7 Feb 2003 18:44:41 -0000 1.2 *************** *** 40,48 **** import shutil ! from output.PyTkWidgets import HelperUtil ! from output.PyTkWidgets.Templates import Templates ! from util import PymeraseType ! from ClassMembers import getAllAttributes ! from ClassMembers import getAllAssociations ############################ --- 40,48 ---- import shutil ! from pymerase.output.PyTkWidgets import HelperUtil ! from pymerase.output.PyTkWidgets.Templates import Templates ! from pymerase.util import PymeraseType ! from pymerase.ClassMembers import getAllAttributes ! from pymerase.ClassMembers import getAllAssociations ############################ |
|
From: <de...@us...> - 2003-02-06 22:02:02
|
Update of /cvsroot/pymerase/pymerase/output
In directory sc8-pr-cvs1:/tmp/cvs-serv22949
Added Files:
CreateTableXML.py
Log Message:
Because people want to esacpe UML and be more like jason.
--- NEW FILE: CreateTableXML.py ---
###########################################################################
# #
# C O P Y R I G H T N O T I C E #
# Copyright (c) 2001 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: Diane Trout
# Last Modified: $Date: 2003/02/06 22:01:57 $
"""Create table.dtd XML describing the objects passed to this translator.
"""
from __future__ import nested_scopes
import os
import sys
import string
import re
import types
from util.output import *
from output.dbAPI import fkeyTypes
import warnings
from util.Warnings import DebugWarning
from warnings import warn
TRANSLATOR_NAME="CreateTableXML"
# Note: derived from code provided by Brandon King (fgdb2xml.py)
tableTypeList = { "DATA": "&data_table;",
"VALIDATION": "&validation_table;",
"SUBSET": "&subset_table;",
"LINKING": "&linking_table;",
"SYSTEM": "&system_table;",
"VIEW": "&view;",
}
def parseTableType(tableType):
return tableTypeList.get(tableType, tableType)
def NoneStr(object):
if object is None:
return ""
else:
return str(object)
def parseCardinality(cardinality):
if cardinality == fkeyTypes.OneToOne:
return "&fkey_oto;"
elif cardinality == fkeyTypes.ManyToOne:
return "&fkey_mto;"
elif cardinality == fkeyTypes.OneToLots:
return "&fkey_lookup;"
elif cardinality == fkeyTypes.ManyToMany:
return "&fkey_linking;"
else:
err_msg = "unsupported fkey (%s) for table" % (cardinality)
raise NotImplementedError(err_msg)
class XMLSchemaWriter:
def __init__(self, tblList):
self.classList = tblList
def write(self, destination):
destination = os.path.abspath(destination)
if os.path.exists(destination):
if not os.path.isdir(destination):
msg = "%s is not a directory" % (destination)
raise ValueError, msg
else:
os.mkdir(destination)
for klass in self.classList:
fileName = klass.getName(TRANSLATOR_NAME) + ".xml"
filePath = os.path.join(destination, fileName)
f = open(filePath, 'w')
# attributeNameList = map(lambda x: x.getName(TRANSLATOR_NAME),
# klass.getAttributes())
# attributes = {}
# for attribute in klass.getAttributes():
# attributes[attribute.getName(TRANSLATOR_NAME)] = attribute
#
associationEnds = {}
for end in klass.getAssociationEnds().values():
associationEnds[end.getName(TRANSLATOR_NAME)] = end
doc = []
#Add header
doc.append("<?xml version=\"1.0\" standalone=\"no\"?>")
doc.append("<!DOCTYPE table SYSTEM \"table.dtd\">")
#Add Table Info
doc.append("<table name=\"%s\"" % (klass.getName(TRANSLATOR_NAME)))
doc.append(" comment=\"%s\"" % (NoneStr(klass.getDescription())))
baseClasses = string.join(klass.getBaseClassNames(TRANSLATOR_NAME), ', ')
if len(baseClasses) > 0:
doc.append(" inherits_from=\"%s\"" % (baseClasses))
doc.append(" >")
#Add Column Info
for attribute in klass.getAttributes(): #attributes.values():
association = associationEnds.get(attribute.getName(TRANSLATOR_NAME),
None)
doc.extend(self.createAttribute(klass, attribute, association))
if association is not None:
del associationEnds[attribute.getName(TRANSLATOR_NAME)]
# write out any remaining associations (which should be the 1..*s)
for association in associationEnds.values():
doc.extend(self.createAssociation(association))
doc.append("</table>")
doc = string.join(doc, os.linesep)
f.write(doc)
f.close()
def createAttribute(self, klass, attribute, association):
doc = []
doc.append(" <column name=\"%s\"" % (attribute.getName(TRANSLATOR_NAME)))
#Add full_name (friendly name)
doc.append(" full_name=\"%s\"" % (NoneStr(attribute.getFriendlyName())))
#Convert appropriate values and add type
try:
doc.append(" type=\"%s\"" % (attribute.getType().getSQLType()))
except NotImplementedError, e:
doc.append(" type=\"%s\"" % (attribute.getType().getTypeString()))
msg = "%s has invalid type string '%s'"
msg %= (attribute.getName(TRANSLATOR_NAME),
attribute.getType().getTypeString())
print msg
#If no comment, enter empty string
if attribute.getDescription() is None:
doc.append(" comment=\"\"/>")
else:
doc.append(" comment=\"%s\"/>" % (attribute.getDescription()))
#print klass.getName(TRANSLATOR_NAME)+": ",
if association is not None:
doc.extend(self.createAssociation(association))
# FIXME: it'd be nice if this was at the end of the table element
# FIXME: also what happens if a primary key requires multiple columns
if attribute.isPrimaryKey():
doc.append(" <primary_key column_id=\"%s\"/>" % (attribute.getName(TRANSLATOR_NAME)))
return doc
def createAssociation(self, thisEnd):
#print association.getName(TRANSLATOR_NAME),
association = []
otherEnd = thisEnd.getOppositeEnd()
association.append(" <foreign_key column_id=\"%s\"" % (thisEnd.getAttributeName(TRANSLATOR_NAME)))
association.append(" foreign_table =\"%s\"" % (NoneStr(otherEnd.getType().getName(TRANSLATOR_NAME))))
association.append(" foreign_table_pkey =\"%s\"" % (NoneStr(otherEnd.getAttributeName(TRANSLATOR_NAME))))
association.append(" fkey_type =\"%s\"/>" % (parseCardinality(otherEnd.getMultiplicity())))
return association
# #Handle One-to-Many linking
# if attribute.getType() == "mto":
# doc.append(" <foreign_key column_id=\"%s_fk\"" % (attribute.getName(TRANSLATOR_NAME)))
# doc.append(" foreign_table =\"%s\"" % (attribute.getName(TRANSLATOR_NAME)))
# doc.append(" foreign_table_pkey =\"%s_pk\"" % (attribute.getName(TRANSLATOR_NAME)))
# doc.append(" fkey_type =\"&fkey_mto;\"/>")
#
return doc
def write(destination, parsedInput):
# Write out all the individual package members
if not os.path.exists(destination):
os.mkdir(destination)
elif not os.path.isdir(destination):
msg = "PATH(%s) is not a directory!" % (destination)
raise ValueError(msg)
package_information = []
writer = XMLSchemaWriter(parsedInput)
writer.write(destination)
|
|
From: <ki...@us...> - 2003-02-05 23:09:55
|
Update of /cvsroot/pymerase/pymerase/examples
In directory sc8-pr-cvs1:/tmp/cvs-serv1948
Modified Files:
README.examples
Log Message:
added varTypes example
Index: README.examples
===================================================================
RCS file: /cvsroot/pymerase/pymerase/examples/README.examples,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** README.examples 29 Oct 2002 23:24:11 -0000 1.3
--- README.examples 5 Feb 2003 23:09:52 -0000 1.4
***************
*** 19,22 ****
--- 19,25 ----
being implemented
+ varTypes/ - An example which uses the data types available in UML. Used
+ for data type testing for output modules.
+
ReactionDB/ - A more complex example implementing a biological reactions
database
|