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 |