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-29 23:16:06
|
Update of /cvsroot/pymerase/pymerase/output/PyTkWidgets/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv6133
Added Files:
ExtendedOptionMenu.py
Log Message:
Extended Tkinter Option Menu
-Can set menu by passing in a list
-Can select a menu item by name
-Can append to an existing menu
--- NEW FILE: ExtendedOptionMenu.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/29 23:15:59 $
#
import Tkinter
import types
class ExtendedOptionMenu(Tkinter.OptionMenu):
def __init__(self, master, variable, value, *values, **kwargs):
args = [self, master, variable, value]
args.extend(values)
apply(Tkinter.OptionMenu.__init__, args, kwargs)
self.myVar = variable
self.__indexDict = {}
self.__indexCounter = 0
def __setIndexDict(self, list):
self.__indexDict.clear()
self.__indexCounter = 0
if type(list) is types.ListType or \
type(list) is types.TupleType:
for item in list:
self.__indexDict[item] = self.__indexCounter
self.__indexCounter += 1
elif type(list) is types.StringType:
self.__indexDict[list] = self.__indexCounter
def selectItemByName(self, name):
if self.__indexDict.has_key(name):
self['menu'].invoke(self.__indexDict[name])
#def getIndexDict(self):
# return self.__indexDict
def setMenuFromList(self, list):
"""
Given a list or string, deletes old list and replaces with new list.
"""
#Delete old list
self['menu'].delete(0, Tkinter.END)
#Replace with new list
self.appendListToMenu(list)
#Create dictionary of indexes for loading by name
self.__setIndexDict(list)
#Select first item by default
self['menu'].invoke(0)
def appendListToMenu(self, list):
#Replace with new list
if type(list) is types.ListType or \
type(list) is types.TupleType:
for item in list:
self['menu'].add_command(label=item,
command=Tkinter._setit(self.myVar, item))
self.__indexDict[item] = self.__indexCounter
self.__indexCounter += 1
#Well, if the user wants to pass a string
elif type(list) is types.StringType:
self['menu'].add_command(label=list,
command=Tkinter._setit(self.myVar, list))
|
|
From: <ki...@us...> - 2003-01-29 19:49:05
|
Update of /cvsroot/pymerase/pymerase/output/PyTkWidgets/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv6275
Modified Files:
dbSession.py
Log Message:
no longer throws an error when a main widget is closed without connecting to the database first.
Index: dbSession.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/output/PyTkWidgets/lib/dbSession.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** dbSession.py 9 Jan 2003 00:26:14 -0000 1.3
--- dbSession.py 29 Jan 2003 19:49:02 -0000 1.4
***************
*** 36,39 ****
--- 36,40 ----
import Tkinter
import tkMessageBox
+ import sys
from %DBAPI% import DBSession
***************
*** 142,146 ****
def getDbs(self):
while self.dbs is None:
! self.display()
return self.dbs
--- 143,150 ----
def getDbs(self):
while self.dbs is None:
! try:
! self.display()
! except:
! sys.exit()
return self.dbs
|
|
From: <de...@us...> - 2003-01-27 23:00:00
|
Update of /cvsroot/pymerase/pymerase/util
In directory sc8-pr-cvs1:/tmp/cvs-serv31523/util
Modified Files:
NameMangling.py
Log Message:
Fixed problem where pymerase was generating an incompatible
name for the foreign key.
Index: NameMangling.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/util/NameMangling.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** NameMangling.py 24 Dec 2002 01:04:43 -0000 1.6
--- NameMangling.py 27 Jan 2003 22:59:56 -0000 1.7
***************
*** 136,145 ****
def getForeignKey(self, name):
if re.search("[Pp][Kk]$", name):
! return re.sub("[Pf][Kk]$", "fk", name)
elif re.search("[Ff][Kk]$", name):
! return name
else:
! return name + "_fk"
!
--- 136,146 ----
def getForeignKey(self, name):
+ print name
if re.search("[Pp][Kk]$", name):
! mangled_name = re.sub("[Pp][Kk]$", "fk", name)
elif re.search("[Ff][Kk]$", name):
! mangled_name = name
else:
! mangled_name = name + "_fk"
! return mangled_name
|
|
From: <de...@us...> - 2003-01-27 23:00:00
|
Update of /cvsroot/pymerase/pymerase
In directory sc8-pr-cvs1:/tmp/cvs-serv31523
Modified Files:
ClassMembers.py
Log Message:
Fixed problem where pymerase was generating an incompatible
name for the foreign key.
Index: ClassMembers.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/ClassMembers.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** ClassMembers.py 20 Dec 2002 03:21:51 -0000 1.16
--- ClassMembers.py 27 Jan 2003 22:59:56 -0000 1.17
***************
*** 724,731 ****
return rootClass.getForeignKeyName(translatorName)
else:
! warn("No foreign key name set for %s, making one up" % (self.name),
! InfoWarning)
! primaryKeyName = self.getPrimaryKeyName(None)
self.foreignKeyName = util.NameMangling.RelationalKey().getForeignKey(primaryKeyName)
return self.foreignKeyName
--- 724,732 ----
return rootClass.getForeignKeyName(translatorName)
else:
! primaryKeyName = self.getPrimaryKeyName(translatorName)
self.foreignKeyName = util.NameMangling.RelationalKey().getForeignKey(primaryKeyName)
+ warn("No foreign key name set for %s, making one up %s" % (self.name,
+ self.foreignKeyName),
+ InfoWarning)
return self.foreignKeyName
|
|
From: <de...@us...> - 2003-01-18 01:35:36
|
Update of /cvsroot/pymerase/pymerase/util
In directory sc8-pr-cvs1:/tmp/cvs-serv23570/util
Modified Files:
PymeraseType.py bool.py
Log Message:
Added support for a boolean type in python
This allows differentiating between integers and bools so I can format
the boolean in a form that makes postgresql happy.
Index: PymeraseType.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/util/PymeraseType.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** PymeraseType.py 20 Dec 2002 03:56:32 -0000 1.10
--- PymeraseType.py 18 Jan 2003 01:35:32 -0000 1.11
***************
*** 146,150 ****
elif re.match("bool", self.type_string):
# FIXME: should there be a better way of representing this in python?
! return "types.IntType"
elif re.match("datetime", self.type_string):
return "mx.DateTime.mxDateTime.DateTimeType"
--- 146,151 ----
elif re.match("bool", self.type_string):
# FIXME: should there be a better way of representing this in python?
! return "Bool"
! # return "types.IntType"
elif re.match("datetime", self.type_string):
return "mx.DateTime.mxDateTime.DateTimeType"
Index: bool.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/util/bool.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** bool.py 23 May 2002 19:24:24 -0000 1.1
--- bool.py 18 Jan 2003 01:35:32 -0000 1.2
***************
*** 70,74 ****
return 0
! class bool:
def __init__(self, value):
self.bit = parseBoolValue(value)
--- 70,93 ----
return 0
! class Bool:
def __init__(self, value):
self.bit = parseBoolValue(value)
+
+ def __str__(self):
+ if self.bit:
+ return '1'
+ else:
+ return '0'
+
+ # do I actually need these things?
+ def __and__(self, other):
+ return (self.bit & other)
+
+ def __xor__(self, other):
+ return self.bit ^ other
+
+ def __or__(self, other):
+ return (self.bit | other)
+
+
+
|
|
From: <de...@us...> - 2003-01-18 01:35:36
|
Update of /cvsroot/pymerase/pymerase/output
In directory sc8-pr-cvs1:/tmp/cvs-serv23570/output
Modified Files:
CreateDBAPI.py
Log Message:
Added support for a boolean type in python
This allows differentiating between integers and bools so I can format
the boolean in a form that makes postgresql happy.
Index: CreateDBAPI.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/output/CreateDBAPI.py,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** CreateDBAPI.py 14 Dec 2002 02:22:19 -0000 1.24
--- CreateDBAPI.py 18 Jan 2003 01:35:32 -0000 1.25
***************
*** 120,123 ****
--- 120,124 ----
header.append(u"from __future__ import nested_scopes")
header.append(u"import types")
+ header.append(u"from bool import Bool")
header.append(u"import mx.DateTime")
header.append(u"from warnings import warn")
***************
*** 443,446 ****
--- 444,448 ----
files_to_copy = [('dbAPI.py', 'dbAPI.py'),
('init.py', '__init__.py'),
+ ('../../util/bool.py', 'bool.py'),
('fkeyTypes.py', 'fkeyTypes.py')]
# files_to_copy = [('dbAPI.py', '__init__.py'),
|
|
From: <de...@us...> - 2003-01-18 01:35:36
|
Update of /cvsroot/pymerase/pymerase/output/dbAPI
In directory sc8-pr-cvs1:/tmp/cvs-serv23570/output/dbAPI
Modified Files:
dbAPI.py
Log Message:
Added support for a boolean type in python
This allows differentiating between integers and bools so I can format
the boolean in a form that makes postgresql happy.
Index: dbAPI.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/output/dbAPI/dbAPI.py,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** dbAPI.py 19 Nov 2002 00:49:10 -0000 1.18
--- dbAPI.py 18 Jan 2003 01:35:32 -0000 1.19
***************
*** 43,46 ****
--- 43,47 ----
import fkeyTypes
+ from bool import Bool
from mx import DateTime
***************
*** 53,56 ****
--- 54,58 ----
warnings.filterwarnings('ignore', category=DebugWarning, append=1)
+
class Field:
"""Stores information about database fields.
***************
*** 102,105 ****
--- 104,111 ----
#elif self.type == types.ClassType and issubclass(value, self.type):
# pass
+ elif type(self.type) == types.ClassType:
+ # NOTE: if the class can't parse the passed in value it should
+ # NOTE: throw the value error
+ value = self.type(value)
elif self.type != type(value):
error_msg = "Incompatible type for field %s, expecting %s, got %s"
***************
*** 108,111 ****
--- 114,118 ----
str(type(value)))
raise ValueError(error_msg)
+ # NOTE: this allows a class to be listed as a type
if not loading:
***************
*** 539,542 ****
--- 546,551 ----
update_values_list.append("'%s'" % (field.value))
elif field.type == DateTime.DateTimeType:
+ update_values_list.append("'%s'" % (str(field.value)))
+ elif field.type == Bool:
update_values_list.append("'%s'" % (str(field.value)))
else:
|
|
From: <ki...@us...> - 2003-01-17 19:36:10
|
Update of /cvsroot/pymerase/pymerase/examples/varTypes/widgets In directory sc8-pr-cvs1:/tmp/cvs-serv10084/examples/varTypes/widgets Log Message: Directory /cvsroot/pymerase/pymerase/examples/varTypes/widgets added to the repository |
|
From: <ki...@us...> - 2003-01-14 22:41:31
|
Update of /cvsroot/pymerase/pymerase/output/PyTkWidgets
In directory sc8-pr-cvs1:/tmp/cvs-serv24788
Modified Files:
Templates.py
Log Message:
Added error checking to make sure user doesn't try to save an object that doesn't exist.
Index: Templates.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/output/PyTkWidgets/Templates.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Templates.py 13 Jan 2003 23:38:54 -0000 1.3
--- Templates.py 14 Jan 2003 22:41:28 -0000 1.4
***************
*** 189,196 ****
def save(self):
obj = self.getCurrentDBObj()
!
%SAVE_FUNCTION%
! obj.commit()
def load(self, obj):
--- 189,199 ----
def save(self):
obj = self.getCurrentDBObj()
!
! if obj is not None:
%SAVE_FUNCTION%
! obj.commit()
! else:
! print \"Create new object before saving.\"
def load(self, obj):
|
|
From: <ki...@us...> - 2003-01-14 22:40:27
|
Update of /cvsroot/pymerase/pymerase/output/PyTkWidgets
In directory sc8-pr-cvs1:/tmp/cvs-serv24713
Modified Files:
HelperUtil.py
Log Message:
changed indentation
Index: HelperUtil.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/output/PyTkWidgets/HelperUtil.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** HelperUtil.py 13 Jan 2003 23:35:53 -0000 1.8
--- HelperUtil.py 14 Jan 2003 22:40:24 -0000 1.9
***************
*** 215,220 ****
code = []
#FIXME: should uses getGetterName and getSetterName functions instead
! code.append(" if self.get%sEntry() is not None:" % (name))
! code.append(" obj.set%s(self.get%sEntry())" % (name,name))
code.append("%SAVE_FUNCTION%")
--- 215,220 ----
code = []
#FIXME: should uses getGetterName and getSetterName functions instead
! code.append(" if self.get%sEntry() is not None:" % (name))
! code.append(" obj.set%s(self.get%sEntry())" % (name,name))
code.append("%SAVE_FUNCTION%")
***************
*** 282,287 ****
code = []
#FIXME: should uses getGetterName and getSetterName functions instead
! code.append(" if self.get%sText() is not None:" % (name))
! code.append(" obj.set%s(self.get%sText())" % (name, name))
code.append("%SAVE_FUNCTION%")
--- 282,287 ----
code = []
#FIXME: should uses getGetterName and getSetterName functions instead
! code.append(" if self.get%sText() is not None:" % (name))
! code.append(" obj.set%s(self.get%sText())" % (name, name))
code.append("%SAVE_FUNCTION%")
***************
*** 354,358 ****
code = []
#FIXME: should uses getGetterName and getSetterName functions instead
! code.append(" obj.set%s(self.get%sRadioBoolean())" % (name, name))
code.append("%SAVE_FUNCTION%")
--- 354,358 ----
code = []
#FIXME: should uses getGetterName and getSetterName functions instead
! code.append(" obj.set%s(self.get%sRadioBoolean())" % (name, name))
code.append("%SAVE_FUNCTION%")
|
|
From: <ki...@us...> - 2003-01-13 23:57:46
|
Update of /cvsroot/pymerase/pymerase/examples/dvd
In directory sc8-pr-cvs1:/tmp/cvs-serv29573
Added Files:
createpytkdbwidgets.py
Log Message:
Create Python Tkinter DB aware 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 input.parseXMI
import output.CreatePyTkDBWidgets
if __name__ == "__main__":
schema = os.path.abspath("./dvd_.xmi")
outputPath = os.path.abspath("./widgets")
#pymerase.run(schema, 'parseXMI', output, 'CreateDBAPI')
pymerase.run(schema, input.parseXMI, outputPath, output.CreatePyTkDBWidgets)
|
|
From: <ki...@us...> - 2003-01-13 23:55:47
|
Update of /cvsroot/pymerase/pymerase/examples/varTypes
In directory sc8-pr-cvs1:/tmp/cvs-serv28573/varTypes
Added Files:
createpytkdbwidgets.py
Log Message:
create pytkdbwidgets
--- 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 input.parseXMI
import output.CreatePyTkDBWidgets
if __name__ == "__main__":
schema = os.path.abspath("./varTypes_.xmi")
outputPath = os.path.abspath("./widgets")
#pymerase.run(schema, 'parseXMI', output, 'CreateDBAPI')
pymerase.run(schema, input.parseXMI, outputPath, output.CreatePyTkDBWidgets)
|
|
From: <ki...@us...> - 2003-01-13 23:52:25
|
Update of /cvsroot/pymerase/pymerase/output
In directory sc8-pr-cvs1:/tmp/cvs-serv27913
Added Files:
CreatePyTkDBWidgets.py
Log Message:
Generate DB aware Tkinter Widgets
--- NEW FILE: CreatePyTkDBWidgets.py ---
###########################################################################
# #
# 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. #
###########################################################################
#
# Authors: Brandon King
# Last Modified: $Date: 2003/01/13 23:52:21 $
#
"""Creates Python TK Widgets of each Class/Table"""
import os
import sys
import re
import glob
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
############################
# Globals
TRANSLATOR_NAME='CreatePyTkWidgets'
DBAPI_TRANSLATOR='CreateDBAPI'
codeTemplates = Templates()
def checkDestination(destination):
"""
Checks to see if the destination path exists, if it doesn't it creates the directory and moves into it.
"""
destination = os.path.abspath(destination)
if os.path.exists(destination) == 0:
os.mkdir(destination)
elif os.path.isdir(destination) == 0:
print "%s exists but is not a directory." % (destination)
sys.exit(2)
###############################################
#CreateTkWidgets write function -- called by pymerase
def write(destination, classList):
"""
Creates PyTk Widgets in destination dirctory.
"""
templateDict = {}
print ""
print "\a"
templateDict['%DBAPI%'] = raw_input("Enter DBAPI Name: ")
print ""
print ""
checkDestination(destination)
util = HelperUtil.HelperUtil()
#Iterate through the tables/classes and process the data
for myClass in classList:
code = codeTemplates.getDbTemplate()
#Replace Template %CLASSNAME% with actual class name
code = re.sub('%CLASSNAME%', myClass.getName(DBAPI_TRANSLATOR), code)
#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)),
code)
code = re.sub('%LOAD_FUNCTION%',
util.makeLoadLabelEntry(attrib.getName(DBAPI_TRANSLATOR)),
code)
elif type == "double precision":
code = re.sub('%SAVE_FUNCTION%',
util.makeSaveLabelEntry(attrib.getName(DBAPI_TRANSLATOR)),
code)
code = re.sub('%LOAD_FUNCTION%',
util.makeLoadLabelEntry(attrib.getName(DBAPI_TRANSLATOR)),
code)
elif type == "name":
print "FIXME: Ignoring name type"
#Process Text
elif type == "text":
code = re.sub('%SAVE_FUNCTION%',
util.makeSaveLabelText(attrib.getName(DBAPI_TRANSLATOR)),
code)
code = re.sub('%LOAD_FUNCTION%',
util.makeLoadLabelText(attrib.getName(DBAPI_TRANSLATOR)),
code)
#Process Variable Characters
elif PymeraseType.isVarchar(type):
code = re.sub('%SAVE_FUNCTION%',
util.makeSaveLabelEntry(attrib.getName(DBAPI_TRANSLATOR)),
code)
code = re.sub('%LOAD_FUNCTION%',
util.makeLoadLabelEntry(attrib.getName(DBAPI_TRANSLATOR)),
code)
#Process Characters
elif PymeraseType.isChar(type):
code = re.sub('%SAVE_FUNCTION%',
util.makeSaveLabelEntry(attrib.getName(DBAPI_TRANSLATOR)),
code)
code = re.sub('%LOAD_FUNCTION%',
util.makeLoadLabelEntry(attrib.getName(DBAPI_TRANSLATOR)),
code)
#Process Boolean
elif type == "boolean":
code = re.sub('%SAVE_FUNCTION%',
util.makeSaveRadioBoolean(attrib.getName(DBAPI_TRANSLATOR)),
code)
code = re.sub('%LOAD_FUNCTION%',
util.makeLoadRadioBoolean(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:
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 '%*%'
code = re.sub('%SAVE_FUNCTION%', '', code)
code = re.sub('%LOAD_FUNCTION%', '', code)
#Write TkWidget to file
fileName = "%sDbWidget.py" % (myClass.getName(DBAPI_TRANSLATOR))
filePath = os.path.join(os.path.abspath(destination), fileName)
f = open(filePath, 'w')
f.write(code)
f.close()
print os.linesep \
+ "Python Tkinter DB Aware Widget Generation Complete... Good Bye." \
+ os.linesep
|
|
From: <ki...@us...> - 2003-01-13 23:50:55
|
Update of /cvsroot/pymerase/pymerase/output/PyTkWidgets/lib In directory sc8-pr-cvs1:/tmp/cvs-serv27420 Added Files: .cvsignore Log Message: usual --- NEW FILE: .cvsignore --- *.pyc *.class |
|
From: <ki...@us...> - 2003-01-13 23:50:14
|
Update of /cvsroot/pymerase/pymerase/output/PyTkWidgets/lib In directory sc8-pr-cvs1:/tmp/cvs-serv26983 Added Files: NavBar.py Log Message: NavBar widget which moves through a database table given a particular EntryWidget --- NEW FILE: NavBar.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/13 23:50:11 $ # import Tkinter from dbSession import sessionObj class NavBar(Tkinter.Frame): def __init__(self, root=None, EntryWidget=None, dbObj=None, session=None, buttonFG='white', buttonBG='blue', **kw): Tkinter.Frame.__init__(self, root, kw) self.parent = root self.can = Tkinter.Canvas(self, width=300, height=30) self.can.pack() self.entryWidget = EntryWidget print 'EntryWidget:', EntryWidget self.dbObj = dbObj print 'dbObj:', dbObj print 'dbObj():', dbObj() self.navList = [] self.navIndex = None #First Record Button self.StartButton = Tkinter.Button(self, text="| <<", fg=buttonFG, bg=buttonBG, command=self.moveFirst) self.can.create_window(25,15,window=self.StartButton) #Previous Record Button self.PrevButton = Tkinter.Button(self, text="| <", fg=buttonFG, bg=buttonBG, command=self.movePrev) self.can.create_window(70,15,window=self.PrevButton) #Next Record Button self.NextButton = Tkinter.Button(self, text="> |", fg=buttonFG, bg=buttonBG, command=self.moveNext) self.can.create_window(190,15,window=self.NextButton) #Last Record Button self.EndButton = Tkinter.Button(self, text=">> |", fg=buttonFG, bg=buttonBG, command=self.moveLast) self.can.create_window(235,15,window=self.EndButton) #New record button self.NewButton = Tkinter.Button(self, text="> *", fg=buttonFG, bg=buttonBG, command=self.newRecord) self.can.create_window(280,15,window=self.NewButton) #Current Record self.recordIndicator = Tkinter.Message(self, text="0 of 0", relief=Tkinter.SUNKEN) self.can.create_window(130,15,window=self.recordIndicator) if session is None: self.session = sessionObj(self.parent) else: self.session = session self.updateNavListFromDB() def updateNavListFromDB(self): dbs = self.session.getDbs() self.navList = dbs.getAllObjects(self.dbObj) if len(self.navList) >= 1 and self.navIndex is None: self.moveFirst() def loadCurrentNav(self): self.entryWidget.load(self.navList[self.navIndex]) def updateRecordIndicator(self): if self.navIndex is not None and \ self.navList is not None and \ len(self.navList) >= 1: newText = "%s of %s" % (self.navIndex + 1, len(self.navList)) self.recordIndicator['text'] = newText def moveFirst(self): print "Moving to first record" if self.navList is not None and len(self.navList) >= 1: self.navIndex = 0 self.loadCurrentNav() self.updateRecordIndicator() def moveLast(self): print "Moving to last record" if self.navList is not None and len(self.navList) >= 1: self.navIndex = len(self.navList) - 1 self.loadCurrentNav() self.updateRecordIndicator() def moveNext(self): print "Moving to next record" if self.navList is not None and len(self.navList) >=1: if (self.navIndex + 1) < len(self.navList): self.navIndex += 1 self.loadCurrentNav() self.updateRecordIndicator() def movePrev(self): print "Moving to prev record" if self.navList is not None and len(self.navList) >=1: if (self.navIndex + 1) <= len(self.navList) and \ self.navIndex > 0: self.navIndex -= 1 self.loadCurrentNav() self.updateRecordIndicator() def newRecord(self): if self.dbObj is not None: print "Creating new record" self.appendNavItem(self.dbObj()) self.moveLast() self.updateRecordIndicator() else: print "No dbObj defined" def setNavList(self, list): self.navList = list def getNavList(self): return self.navList def appendNavItem(self, item): self.navList.append(item) def deleteNavItem(self, item): self.navList.remove(item) |
|
From: <ki...@us...> - 2003-01-13 23:48:52
|
Update of /cvsroot/pymerase/pymerase/output/PyTkWidgets/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv26426
Modified Files:
SaveWidget.py
Log Message:
Now inherits from Tkinter.Frame
button colors can be changed now
Index: SaveWidget.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/output/PyTkWidgets/lib/SaveWidget.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** SaveWidget.py 3 Jan 2003 23:27:26 -0000 1.1
--- SaveWidget.py 13 Jan 2003 23:48:49 -0000 1.2
***************
*** 36,51 ****
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()
--- 36,51 ----
import Tkinter
! class SaveWidget(Tkinter.Frame):
! def __init__(self, master=None, entryWidget=None, buttonFG='white', buttonBG='blue', **kw):
! Tkinter.Frame.__init__(self, master, kw)
self.entryWidget = entryWidget
! self.saveButton = Tkinter.Button(self,
text="Save",
! bg=buttonBG,
! fg=buttonFG,
command=self.save)
self.saveButton.pack()
|
|
From: <ki...@us...> - 2003-01-13 23:38:58
|
Update of /cvsroot/pymerase/pymerase/output/PyTkWidgets
In directory sc8-pr-cvs1:/tmp/cvs-serv22688
Modified Files:
Templates.py
Log Message:
Base Widget now inherits from Tkinter.Frame
DB Widget now uses NavBar, added code to support using NavBar
Index: Templates.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/output/PyTkWidgets/Templates.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Templates.py 4 Jan 2003 00:15:56 -0000 1.2
--- Templates.py 13 Jan 2003 23:38:54 -0000 1.3
***************
*** 75,81 ****
import ValidatingEntry
! class %CLASSNAME%Widget:
! def __init__(self, master):
self.parent = master
--- 75,82 ----
import ValidatingEntry
! class %CLASSNAME%Widget(Tkinter.Frame):
! def __init__(self, master=None, **kw):
! Tkinter.Frame.__init__(self, master, kw)
self.parent = master
***************
*** 85,88 ****
--- 86,101 ----
return self.parent
+ def save(self):
+ \"\"\"
+ Override save function.
+ \"\"\"
+ print 'Save Not Implemented'
+
+ def load(self):
+ \"\"\"
+ Override lost function.
+ \"\"\"
+ print 'Load Not Implemented'
+
%GET_FUNCTION%
***************
*** 138,146 ****
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
--- 151,160 ----
from %CLASSNAME%Widget import %CLASSNAME%Widget
from SaveWidget import SaveWidget
+ from NavBar import NavBar
from dbSession import sessionObj
class %CLASSNAME%DbWidget(%CLASSNAME%Widget):
! def __init__(self, master, session=None):
self.master = master
***************
*** 152,163 ****
%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__':
--- 166,201 ----
%CLASSNAME%Widget.__init__(self, self.bodyFrame)
+ if session is None:
+ self.session = sessionObj(self.master)
+ else:
+ self.session = session
+ self.dbs = self.session.getDbs()
+
+ self.curDBObj = None
+
+ self.navBar = NavBar(self.footerFrame, self, self.dbs.%CLASSNAME%, self.session)
+ self.navBar.pack()
+
self.SaveWidget = SaveWidget(self.footerFrame, self)
+ self.SaveWidget.pack()
+
! def setCurrentDBObj(self, obj):
! self.curDBObj = obj
!
! def getCurrentDBObj(self):
! return self.curDBObj
def save(self):
+ obj = self.getCurrentDBObj()
+
%SAVE_FUNCTION%
+ obj.commit()
+
+ def load(self, obj):
+ %LOAD_FUNCTION%
+
+ self.setCurrentDBObj(obj)
if __name__ == '__main__':
|
|
From: <ki...@us...> - 2003-01-13 23:35:58
|
Update of /cvsroot/pymerase/pymerase/output/PyTkWidgets
In directory sc8-pr-cvs1:/tmp/cvs-serv21975
Modified Files:
HelperUtil.py
Log Message:
Added code to check if user entered data, if not, don't try to save it to the database object.
Index: HelperUtil.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/output/PyTkWidgets/HelperUtil.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** HelperUtil.py 13 Jan 2003 20:09:51 -0000 1.7
--- HelperUtil.py 13 Jan 2003 23:35:53 -0000 1.8
***************
*** 176,180 ****
code = []
code.append(" def get%sEntry(self):" % (name))
! code.append(" return int(self.%sEntry.get())" % (name))
code.append("")
code.append("%GET_FUNCTION%")
--- 176,184 ----
code = []
code.append(" def get%sEntry(self):" % (name))
! code.append(" data = self.%sEntry.get()" % (name))
! code.append(" if data == \"\":")
! code.append(" return None")
! code.append(" else:")
! code.append(" return int(data)")
code.append("")
code.append("%GET_FUNCTION%")
***************
*** 186,190 ****
code = []
code.append(" def get%sEntry(self):" % (name))
! code.append(" return float(self.%sEntry.get())" % (name))
code.append("")
code.append("%GET_FUNCTION%")
--- 190,198 ----
code = []
code.append(" def get%sEntry(self):" % (name))
! code.append(" data = self.%sEntry.get()" % (name))
! code.append(" if data == \"\":")
! code.append(" return None")
! code.append(" else:")
! code.append(" return float(data)")
code.append("")
code.append("%GET_FUNCTION%")
***************
*** 207,211 ****
code = []
#FIXME: should uses getGetterName and getSetterName functions instead
! code.append(" obj.set%s(self.get%sEntry())" % (name,name))
code.append("%SAVE_FUNCTION%")
--- 215,220 ----
code = []
#FIXME: should uses getGetterName and getSetterName functions instead
! code.append(" if self.get%sEntry() is not None:" % (name))
! code.append(" obj.set%s(self.get%sEntry())" % (name,name))
code.append("%SAVE_FUNCTION%")
***************
*** 248,252 ****
code = []
code.append(" def get%sText(self):" % (name))
! code.append(" return self.%sText.get(0.0, Tkinter.END)" % (name))
code.append("")
code.append("%GET_FUNCTION%")
--- 257,265 ----
code = []
code.append(" def get%sText(self):" % (name))
! code.append(" data = self.%sText.get(0.0, Tkinter.END)" % (name))
! code.append(" if data == \"\":")
! code.append(" return None")
! code.append(" else:")
! code.append(" return data")
code.append("")
code.append("%GET_FUNCTION%")
***************
*** 269,273 ****
code = []
#FIXME: should uses getGetterName and getSetterName functions instead
! code.append(" obj.set%s(self.get%sText())" % (name, name))
code.append("%SAVE_FUNCTION%")
--- 282,287 ----
code = []
#FIXME: should uses getGetterName and getSetterName functions instead
! code.append(" if self.get%sText() is not None:" % (name))
! code.append(" obj.set%s(self.get%sText())" % (name, name))
code.append("%SAVE_FUNCTION%")
***************
*** 344,347 ****
--- 358,362 ----
return string.join(code, '\n')
+
def makeLoadRadioBoolean(self, name):
|
|
From: <ki...@us...> - 2003-01-13 22:39:29
|
Update of /cvsroot/pymerase/pymerase/examples/varTypes
In directory sc8-pr-cvs1:/tmp/cvs-serv1497
Modified Files:
varTypes_.xmi
Log Message:
corrected package name
Index: varTypes_.xmi
===================================================================
RCS file: /cvsroot/pymerase/pymerase/examples/varTypes/varTypes_.xmi,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** varTypes_.xmi 20 Dec 2002 02:18:46 -0000 1.1
--- varTypes_.xmi 13 Jan 2003 22:39:06 -0000 1.2
***************
*** 10,14 ****
<XMI.content>
<Model_Management.Model xmi.id="xmi.1" xmi.uuid="127-0-0-1-6090ee:f2399ec162:-8000">
! <Foundation.Core.ModelElement.name>DataTypeTest</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isRoot xmi.value="false"/>
--- 10,14 ----
<XMI.content>
<Model_Management.Model xmi.id="xmi.1" xmi.uuid="127-0-0-1-6090ee:f2399ec162:-8000">
! <Foundation.Core.ModelElement.name>VarTypesAPI</Foundation.Core.ModelElement.name>
<Foundation.Core.ModelElement.isSpecification xmi.value="false"/>
<Foundation.Core.GeneralizableElement.isRoot xmi.value="false"/>
|
|
From: <ki...@us...> - 2003-01-13 22:20:59
|
Update of /cvsroot/pymerase/pymerase/examples/varTypes In directory sc8-pr-cvs1:/tmp/cvs-serv28276 Modified Files: varTypes.zargo Log Message: changed package name to match up with generated DBAPI package name Index: varTypes.zargo =================================================================== RCS file: /cvsroot/pymerase/pymerase/examples/varTypes/varTypes.zargo,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsFLDMXf and /tmp/cvsWPTIJl differ |
|
From: <ki...@us...> - 2003-01-13 21:54:12
|
Update of /cvsroot/pymerase/pymerase/examples/varTypes
In directory sc8-pr-cvs1:/tmp/cvs-serv17479
Modified Files:
createsql.py
Log Message:
I swear I typed an s! ;)
Index: createsql.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/examples/varTypes/createsql.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** createsql.py 20 Dec 2002 02:18:46 -0000 1.1
--- createsql.py 13 Jan 2003 21:54:06 -0000 1.2
***************
*** 9,14 ****
if __name__ == "__main__":
! schema = os.path.abspath("./varType_.xmi")
! outputPath = os.path.abspath("./varType.sql")
pymerase.run(schema, input.parseXMI, outputPath, output.CreateSQL)
--- 9,14 ----
if __name__ == "__main__":
! schema = os.path.abspath("./varTypes_.xmi")
! outputPath = os.path.abspath("./varTypes.sql")
pymerase.run(schema, input.parseXMI, outputPath, output.CreateSQL)
|
|
From: <ki...@us...> - 2003-01-13 20:09:56
|
Update of /cvsroot/pymerase/pymerase/output/PyTkWidgets
In directory sc8-pr-cvs1:/tmp/cvs-serv7044
Modified Files:
HelperUtil.py
Log Message:
Added support for generating db aware widgets
Index: HelperUtil.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/output/PyTkWidgets/HelperUtil.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** HelperUtil.py 30 Dec 2002 21:30:23 -0000 1.6
--- HelperUtil.py 13 Jan 2003 20:09:51 -0000 1.7
***************
*** 204,207 ****
--- 204,223 ----
return string.join(code, '\n')
+ def makeSaveLabelEntry(self, name):
+ code = []
+ #FIXME: should uses getGetterName and getSetterName functions instead
+ code.append(" obj.set%s(self.get%sEntry())" % (name,name))
+ code.append("%SAVE_FUNCTION%")
+
+ return string.join(code, '\n')
+
+ def makeLoadLabelEntry(self, name):
+ code = []
+ #FIXME: should uses getGetterName and getSetterName functions instead
+ code.append(" self.set%sEntry(obj.get%s())" % (name, name))
+ code.append("%LOAD_FUNCTION%")
+
+ return string.join(code, '\n')
+
def makeLabelText(self, name, labelText, isRequired=0):
***************
*** 244,248 ****
code.append(" self.%sText.delete(0.0, Tkinter.END)" % (name))
code.append(" if text is not None:")
! code.append(" self.%sText.insert(0, text)" % (name))
code.append("")
code.append("%SET_FUNCTION%")
--- 260,264 ----
code.append(" self.%sText.delete(0.0, Tkinter.END)" % (name))
code.append(" if text is not None:")
! code.append(" self.%sText.insert(0.0, text)" % (name))
code.append("")
code.append("%SET_FUNCTION%")
***************
*** 250,253 ****
--- 266,284 ----
return string.join(code, '\n')
+ def makeSaveLabelText(self, name):
+ code = []
+ #FIXME: should uses getGetterName and getSetterName functions instead
+ code.append(" obj.set%s(self.get%sText())" % (name, name))
+ code.append("%SAVE_FUNCTION%")
+
+ return string.join(code, '\n')
+
+ def makeLoadLabelText(self, name):
+ code = []
+ #FIXME: should uses getGetterName and getSetterName functions instead
+ code.append(" self.set%sText(obj.get%s())" % (name, name))
+ code.append("%LOAD_FUNCTION%")
+
+ return string.join(code, '\n')
def makeRadioBoolean(self, name, labelText, isRequired=0):
***************
*** 306,308 ****
return string.join(code, '\n')
!
--- 337,353 ----
return string.join(code, '\n')
! def makeSaveRadioBoolean(self, name):
! code = []
! #FIXME: should uses getGetterName and getSetterName functions instead
! code.append(" obj.set%s(self.get%sRadioBoolean())" % (name, name))
! code.append("%SAVE_FUNCTION%")
!
! return string.join(code, '\n')
!
! def makeLoadRadioBoolean(self, name):
! code = []
! #FIXME: should uses getGetterName and getSetterName functions instead
! code.append(" self.set%sRadioBoolean(obj.get%s())" % (name, name))
! code.append("%LOAD_FUNCTION%")
!
! return string.join(code, '\n')
|
|
From: <ki...@us...> - 2003-01-09 00:26:16
|
Update of /cvsroot/pymerase/pymerase/output/PyTkWidgets/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv16651
Modified Files:
dbSession.py
Log Message:
added masking to password field.
Index: dbSession.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/output/PyTkWidgets/lib/dbSession.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** dbSession.py 6 Jan 2003 22:46:37 -0000 1.2
--- dbSession.py 9 Jan 2003 00:26:14 -0000 1.3
***************
*** 91,95 ****
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)
--- 91,95 ----
self.passwordLabel = Tkinter.Label(self.BodyFrame, text="Password:")
self.passwordLabel.grid(row=3, column=0, sticky=Tkinter.E)
! self.passwordEntry = Tkinter.Entry(self.BodyFrame, show="*")
self.passwordEntry.grid(row=3, column=1, sticky=Tkinter.W)
|
|
From: <ki...@us...> - 2003-01-06 22:48:13
|
Update of /cvsroot/pymerase/pymerase/output
In directory sc8-pr-cvs1:/tmp/cvs-serv27198
Modified Files:
CreatePyTkWidgets.py
Log Message:
Prompts user for DBAPI name to use.
Index: CreatePyTkWidgets.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/output/CreatePyTkWidgets.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** CreatePyTkWidgets.py 4 Jan 2003 00:18:34 -0000 1.8
--- CreatePyTkWidgets.py 6 Jan 2003 22:48:03 -0000 1.9
***************
*** 87,94 ****
! 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)
--- 87,97 ----
! def copyLib(destination, templateDict):
!
path, file = os.path.split(HelperUtil.__file__)
path = os.path.join(path, "lib")
search = os.path.join(path, "*.py")
+
+ TEMPLATE_FILES = [os.path.join(path, "dbSession.py")]
filesToCopy = glob.glob(search)
***************
*** 100,105 ****
fileDest = os.path.join(destination, fileName)
! print '%s' % (fileName)
! shutil.copyfile(file, fileDest)
print "--Done--"
print ""
--- 103,119 ----
fileDest = os.path.join(destination, fileName)
! if file not in TEMPLATE_FILES:
! print '%s' % (fileName)
! shutil.copyfile(file, fileDest)
! else:
! print '%s' % (fileName)
! f = open(file, 'r')
! newFile = re.sub('%DBAPI%', templateDict['%DBAPI%'], f.read())
! f.close()
!
! df = open(fileDest, 'w')
! df.write(newFile)
! df.close()
!
print "--Done--"
print ""
***************
*** 112,115 ****
--- 126,137 ----
Creates PyTk Widgets in destination dirctory.
"""
+
+ templateDict = {}
+
+ print ""
+ print "\a"
+ templateDict['%DBAPI%'] = raw_input("Enter DBAPI Name: ")
+ print ""
+ print ""
checkDestination(destination)
***************
*** 117,121 ****
util = HelperUtil.HelperUtil()
! copyLib(destination)
#Iterate through the tables/classes and process the data
--- 139,143 ----
util = HelperUtil.HelperUtil()
! copyLib(destination, templateDict)
#Iterate through the tables/classes and process the data
***************
*** 256,259 ****
print os.linesep \
! + "HTML Form Generation Complete... Good Bye." \
+ os.linesep
--- 278,281 ----
print os.linesep \
! + "Python Tkinter Widget Generation Complete... Good Bye." \
+ os.linesep
|
|
From: <ki...@us...> - 2003-01-06 22:46:45
|
Update of /cvsroot/pymerase/pymerase/output/PyTkWidgets/lib In directory sc8-pr-cvs1:/tmp/cvs-serv26723/PyTkWidgets/lib Modified Files: dbSession.py Log Message: %DBAPI% is now replaced by user input Index: dbSession.py =================================================================== RCS file: /cvsroot/pymerase/pymerase/output/PyTkWidgets/lib/dbSession.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dbSession.py 3 Jan 2003 23:22:56 -0000 1.1 --- dbSession.py 6 Jan 2003 22:46:37 -0000 1.2 *************** *** 37,42 **** import tkMessageBox ! #FIXME: Import from proper DBAPI ! from DvdAPI import DBSession class dbConnect: --- 37,41 ---- import tkMessageBox ! from %DBAPI% import DBSession class dbConnect: |