You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
(45) |
May
(185) |
Jun
|
Jul
(36) |
Aug
(205) |
Sep
(98) |
Oct
(107) |
Nov
(6) |
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(1) |
Feb
(2) |
Mar
(19) |
Apr
(26) |
May
(18) |
Jun
|
Jul
(12) |
Aug
(16) |
Sep
(22) |
Oct
(7) |
Nov
(11) |
Dec
(74) |
2006 |
Jan
(14) |
Feb
(1) |
Mar
(3) |
Apr
(3) |
May
(14) |
Jun
(5) |
Jul
(20) |
Aug
(10) |
Sep
(1) |
Oct
|
Nov
(4) |
Dec
(1) |
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
(14) |
Aug
|
Sep
|
Oct
(6) |
Nov
(1) |
Dec
|
From: Kevin A. <ka...@us...> - 2004-05-10 05:03:08
|
Update of /cvsroot/pythoncard/PythonCard/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21980/docs Modified Files: changelog.txt Log Message: changed all occurances of stack in resources to application Index: changelog.txt =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/changelog.txt,v retrieving revision 1.286 retrieving revision 1.287 diff -C2 -d -r1.286 -r1.287 *** changelog.txt 10 May 2004 01:28:11 -0000 1.286 --- changelog.txt 10 May 2004 05:01:58 -0000 1.287 *************** *** 3,6 **** --- 3,7 ---- Release 0.8 2004-05-?? + changed all occurances of stack in resources to application removed Stack class the application is now the "parent" of the main Background |
From: Kevin A. <ka...@us...> - 2004-05-10 05:03:08
|
Update of /cvsroot/pythoncard/PythonCard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21980 Modified Files: model.py spec.py Log Message: changed all occurances of stack in resources to application Index: model.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/model.py,v retrieving revision 1.170 retrieving revision 1.171 diff -C2 -d -r1.170 -r1.171 *** model.py 10 May 2004 01:17:38 -0000 1.170 --- model.py 10 May 2004 05:01:58 -0000 1.171 *************** *** 151,155 **** else: rsrc = resource.ResourceFile(filename).getResource() ! return frameClass(parent, rsrc.stack.backgrounds[0]) --- 151,155 ---- else: rsrc = resource.ResourceFile(filename).getResource() ! return frameClass(parent, rsrc.application.backgrounds[0]) *************** *** 371,375 **** def _initBackgrounds(self, aResource): ! for bgRsrc in aResource.stack.backgrounds: bg = self.frameClass(None, bgRsrc) self.backgrounds.append(bg) --- 371,375 ---- def _initBackgrounds(self, aResource): ! for bgRsrc in aResource.application.backgrounds: bg = self.frameClass(None, bgRsrc) self.backgrounds.append(bg) *************** *** 1215,1219 **** def _createStatusBar( self, aResource ) : ! if ('statusBar' in aResource.stack.__dict__) and aResource.stack.statusBar: self.statusBar = self.createStatusBar(self) self.SetStatusBar(self.statusBar) --- 1215,1219 ---- def _createStatusBar( self, aResource ) : ! if ('statusBar' in aResource.application.__dict__) and aResource.application.statusBar: self.statusBar = self.createStatusBar(self) self.SetStatusBar(self.statusBar) Index: spec.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/spec.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** spec.py 20 May 2002 16:27:39 -0000 1.23 --- spec.py 10 May 2004 05:01:58 -0000 1.24 *************** *** 34,38 **** }}, ! { 'name':'Stack', 'info': { 'parent' : None, 'events' : [], --- 34,38 ---- }}, ! { 'name':'Application', 'info': { 'parent' : None, 'events' : [], |
From: Kevin A. <ka...@us...> - 2004-05-10 05:03:08
|
Update of /cvsroot/pythoncard/PythonCard/docs/GettingStarted In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21980/docs/GettingStarted Modified Files: starter1.rsrc.py Log Message: changed all occurances of stack in resources to application Index: starter1.rsrc.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/GettingStarted/starter1.rsrc.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** starter1.rsrc.py 5 May 2004 16:53:24 -0000 1.2 --- starter1.rsrc.py 10 May 2004 05:01:59 -0000 1.3 *************** *** 1,4 **** ! { 'stack':{ 'type':'Stack', 'name':'Minimal', --- 1,4 ---- ! { 'application':{ 'type':'Application', 'name':'Minimal', |
From: Kevin A. <ka...@us...> - 2004-05-10 01:52:07
|
Update of /cvsroot/pythoncard/PythonCard/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26455/templates Added Files: __init__.py Log Message: turn templates into a package --- NEW FILE: __init__.py --- |
From: Kevin A. <ka...@us...> - 2004-05-10 01:28:20
|
Update of /cvsroot/pythoncard/PythonCard/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23449/docs Modified Files: changelog.txt Log Message: removed Stack class Index: changelog.txt =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/changelog.txt,v retrieving revision 1.285 retrieving revision 1.286 diff -C2 -d -r1.285 -r1.286 *** changelog.txt 9 May 2004 00:50:53 -0000 1.285 --- changelog.txt 10 May 2004 01:28:11 -0000 1.286 *************** *** 3,6 **** --- 3,12 ---- Release 0.8 2004-05-?? + removed Stack class + the application is now the "parent" of the main Background + changed __init__ for Background and CustomDialog so they + don't take a stack parameter + changed childWindow function + self.stack.app references are now self.application added lsystem sample added ToggleButton component |
From: Kevin A. <ka...@us...> - 2004-05-10 01:17:47
|
Update of /cvsroot/pythoncard/PythonCard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21760 Modified Files: model.py Log Message: reworked runtime window variables and loading Index: model.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/model.py,v retrieving revision 1.169 retrieving revision 1.170 diff -C2 -d -r1.169 -r1.170 *** model.py 10 May 2004 00:45:17 -0000 1.169 --- model.py 10 May 2004 01:17:38 -0000 1.170 *************** *** 309,314 **** self.resource = resource.ResourceFile(aFileName).getResource() - self.debug = 0 - self.frame = None self.frameClass = frameClass self.pw = None --- 309,312 ---- *************** *** 318,325 **** self.namespaceFrame = None self.namespace = None - self._showProperties = showProperties - self._showMessages = showMessages - self._showShell = showShell - self._showNamespace = showNamespace # KEA 2001-08-11 # if any of the debug windows are going to be used then --- 316,319 ---- *************** *** 329,333 **** # if it seems strange self._showDebugMenu = showProperties or showMessages or showShell or showNamespace or showDebugMenu - ###self._debugMenu = debug.DebugMenu(self) # KEA 2004-01-02 # moved colourdb initialization to work with wxPython 2.5 --- 323,326 ---- *************** *** 338,408 **** def showPropertyEditor(self): ! if self._showDebugMenu: ! bg = self.getCurrentBackground() ! position = configuration.getOption('propertyEditorPosition') ! size = configuration.getOption('propertyEditorSize') ! self.pw = debug.PropertyEditor(bg, -1, "Property Editor", ! position, size, ! parentApp=self) ! self.pw.displayComponents(bg.components) ! self.pw.Show(self._showProperties) def showMessageWatcher(self): ! ! if self._showDebugMenu: ! bg = self.getCurrentBackground() ! position = configuration.getOption('messageWatcherPosition') ! size = configuration.getOption('messageWatcherSize') ! # KEA frame isn't bound to anything, so I think this is supposed ! # to be debug.MessageWatcher( self._iterator.getCurrentBackground() ! # instead of debug.MessageWatcher( self.frame ! # however I don't know what happens once there are ! # multiple backgrounds ?! ! # perhaps there should always be a hidden parent PythonCard app ! # window that all other windows are children of ?! ! # KEA also changed mw to self.mw ! # KEA 2001-08-06 ! # there is a bug in destroying the windows, so mw is still a child ! # of the main window, while shell and pw are not ! self.mw = debug.MessageWatcher(bg, -1, "Message Watcher", ! position, size, ! parentApp=self) ! self.mw.Show(self._showMessages) def showShell(self): ! ! # KEA 2002-06-27 ! # the startup time associated with the shell ! # is noticeable even on a fast machine ! # so I'm going back to making it optional ! # there is a utility routine for an app to be able to ! # make the shell available without having it shown by ! # default ! if self._showDebugMenu: ! # KEA see comments in showMessageWatcher about frames ! bg = self.getCurrentBackground() ! position = configuration.getOption('shellPosition') ! size = configuration.getOption('shellSize') ! self.shellFrame = debug.PyCrustFrame(bg, -1, 'Shell', ! position, size, ! parentApp=self) ! self.shellFrame.Show(self._showShell) ! #if self._showDebugMenu: ! # self.shellFrame.Show(self._showShell) ! EVT_RUN_PYCRUSTRC(self, self.OnRunPycrustrc) ! wx.PostEvent(self, wxRunPycrustrcEvent()) def showNamespace(self): ! ! if self._showDebugMenu: ! # KEA see comments in showMessageWatcher about frames ! bg = self.getCurrentBackground() ! position = configuration.getOption('namespacePosition') ! size = configuration.getOption('namespaceSize') ! self.namespaceFrame = debug.PyCrustNamespaceFrame(bg, -1, 'Namespace Viewer', ! position, size, ! parentApp=self) ! self.namespaceFrame.Show(self._showNamespace) def _initBackgrounds(self, aResource): --- 331,372 ---- def showPropertyEditor(self): ! bg = self.getCurrentBackground() ! position = configuration.getOption('propertyEditorPosition') ! size = configuration.getOption('propertyEditorSize') ! self.pw = debug.PropertyEditor(bg, -1, "Property Editor", ! position, size, ! parentApp=self) ! self.pw.displayComponents(bg.components) ! self.pw.Show(configuration.getOption('showPropertyEditor')) def showMessageWatcher(self): ! bg = self.getCurrentBackground() ! position = configuration.getOption('messageWatcherPosition') ! size = configuration.getOption('messageWatcherSize') ! self.mw = debug.MessageWatcher(bg, -1, "Message Watcher", ! position, size, ! parentApp=self) ! self.mw.Show(configuration.getOption('showMessageWatcher')) def showShell(self): ! bg = self.getCurrentBackground() ! position = configuration.getOption('shellPosition') ! size = configuration.getOption('shellSize') ! self.shellFrame = debug.PyCrustFrame(bg, -1, 'Shell', ! position, size, ! parentApp=self) ! self.shellFrame.Show(configuration.getOption('showShell')) ! EVT_RUN_PYCRUSTRC(self, self.OnRunPycrustrc) ! wx.PostEvent(self, wxRunPycrustrcEvent()) def showNamespace(self): ! bg = self.getCurrentBackground() ! position = configuration.getOption('namespacePosition') ! size = configuration.getOption('namespaceSize') ! self.namespaceFrame = debug.PyCrustNamespaceFrame(bg, -1, 'Namespace Viewer', ! position, size, ! parentApp=self) ! self.namespaceFrame.Show(configuration.getOption('showNamespace')) def _initBackgrounds(self, aResource): *************** *** 411,417 **** self.backgrounds.append(bg) - def getBackgrounds(self): - return self.backgrounds - # wxWindows calls this method to initialize the application def OnInit(self): --- 375,378 ---- *************** *** 420,432 **** self._initBackgrounds(self.resource) ! self.showPropertyEditor() ! self.showMessageWatcher() ! self.showShell() # KEA pyCrust support ! self.showNamespace() # KEA pyCrust support ! return 1 def getCurrentBackground(self): ! #return self._iterator.getCurrentBackground() ! return self.getBackgrounds()[0] # RDS - new API --- 381,393 ---- self._initBackgrounds(self.resource) ! if self._showDebugMenu: ! self.showPropertyEditor() ! self.showMessageWatcher() ! self.showShell() # KEA pyCrust support ! self.showNamespace() # KEA pyCrust support ! return True def getCurrentBackground(self): ! return self.backgrounds[0] # RDS - new API *************** *** 804,815 **** def loadShell(self): if self.application.shell is None: - temp = self.application._showDebugMenu - self.application._showDebugMenu = 1 self.application.showShell() - self.application._showDebugMenu = temp - # KEA 2003-07-22 - # I don't think this is needed since showShell will - # run the pycrustrc.py file(s) - #self.application.OnRunPycrustrc(None) def loadNamespace(self): --- 765,769 ---- *************** *** 819,826 **** return if self.application.namespace is None: - temp = self.application._showDebugMenu - self.application._showDebugMenu = 1 self.application.showNamespace() - self.application._showDebugMenu = temp def setName( self, aString ) : --- 773,777 ---- |
From: Kevin A. <ka...@us...> - 2004-05-10 00:46:05
|
Update of /cvsroot/pythoncard/PythonCard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16543 Modified Files: menu.py model.py widget.py Log Message: removed Stack class, changed self.stack.app references to self.application changed childWindow, Background, and CustomDialog inits so stack arg isn't passed in. only did minimal testing of tools and samples Index: widget.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/widget.py,v retrieving revision 1.127 retrieving revision 1.128 diff -C2 -d -r1.127 -r1.128 *** widget.py 5 May 2004 20:27:09 -0000 1.127 --- widget.py 10 May 2004 00:45:17 -0000 1.128 *************** *** 245,253 **** background = wx.GetTopLevelParent(self) - # where should this check go? - # should we just set a "global" in the app instance such as - # self.stack.app.bindUnusedEvents - # this kind of thing isn't going to work for Rowland's compound - # components if wx.GetApp()._showDebugMenu: bindUnusedEvents = True --- 245,248 ---- Index: model.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/model.py,v retrieving revision 1.168 retrieving revision 1.169 diff -C2 -d -r1.168 -r1.169 *** model.py 9 May 2004 19:46:05 -0000 1.168 --- model.py 10 May 2004 00:45:17 -0000 1.169 *************** *** 151,155 **** else: rsrc = resource.ResourceFile(filename).getResource() ! return frameClass(parent.stack, parent, rsrc.stack.backgrounds[0]) --- 151,155 ---- else: rsrc = resource.ResourceFile(filename).getResource() ! return frameClass(parent, rsrc.stack.backgrounds[0]) *************** *** 337,341 **** colourdb.updateColourDB() - def showPropertyEditor(self): if self._showDebugMenu: --- 337,340 ---- *************** *** 407,415 **** self.namespaceFrame.Show(self._showNamespace) # wxWindows calls this method to initialize the application def OnInit(self): log.debug('Initializing Background...') ! self._stack = Stack(self, self.resource) ! ## bg = self._stack.getBackgrounds()[0] self.showPropertyEditor() --- 406,422 ---- self.namespaceFrame.Show(self._showNamespace) + def _initBackgrounds(self, aResource): + for bgRsrc in aResource.stack.backgrounds: + bg = self.frameClass(None, bgRsrc) + self.backgrounds.append(bg) + + def getBackgrounds(self): + return self.backgrounds + # wxWindows calls this method to initialize the application def OnInit(self): log.debug('Initializing Background...') ! self.backgrounds = [] ! self._initBackgrounds(self.resource) self.showPropertyEditor() *************** *** 421,425 **** def getCurrentBackground(self): #return self._iterator.getCurrentBackground() ! return self._stack.getBackgrounds()[0] # RDS - new API --- 428,432 ---- def getCurrentBackground(self): #return self._iterator.getCurrentBackground() ! return self.getBackgrounds()[0] # RDS - new API *************** *** 569,604 **** - class Stack( event.Changeable, Scriptable ) : - """ - Models an application written for the PythonCard environment. - """ - - def __init__( self, aApplication, aResource ) : - """ - Initialize this instance. - """ - self.id = wx.NewId() - event.Changeable.__init__( self ) - Scriptable.__init__( self, None ) - self.app = aApplication - self._name = aResource.stack.name - self.backgrounds = [] - self._initBackgrounds( aResource ) - self.curBg = self.backgrounds[ 0 ] - - def _initBackgrounds( self, aResource ) : - backgrounds = aResource.stack.backgrounds - for bgRsrc in backgrounds : - bg = self.app.frameClass(self, None, bgRsrc) - self.backgrounds.append( bg ) - - def getBackgrounds( self ) : - ## return copy.copy( self.backgrounds ) - return self.backgrounds - - def getName( self ) : - return self._name - - class Background(Scriptable, wx.Frame, event.EventSource): """ --- 576,579 ---- *************** *** 606,618 **** """ ! def __init__(self, aStack, aParent, aBgRsrc): """ Initialize this instance. """ ! Scriptable.__init__(self, aStack) event.EventSource.__init__(self) self.id = wx.NewId() - self.stack = aStack self.resource = aBgRsrc self.setName(aBgRsrc.name) self.setImage(aBgRsrc.image) --- 581,593 ---- """ ! def __init__(self, aParent, aBgRsrc): """ Initialize this instance. """ ! Scriptable.__init__(self, None) event.EventSource.__init__(self) self.id = wx.NewId() self.resource = aBgRsrc + self.application = wx.GetApp() self.setName(aBgRsrc.name) self.setImage(aBgRsrc.image) *************** *** 663,667 **** if aParent is None: ! self.stack.app.SetTopWindow(self) # KEA 2002-04-26 --- 638,642 ---- if aParent is None: ! self.application.SetTopWindow(self) # KEA 2002-04-26 *************** *** 828,851 **** # if the shell isn't needed def loadShell(self): ! if self.stack.app.shell is None: ! temp = self.stack.app._showDebugMenu ! self.stack.app._showDebugMenu = 1 ! self.stack.app.showShell() ! self.stack.app._showDebugMenu = temp # KEA 2003-07-22 # I don't think this is needed since showShell will # run the pycrustrc.py file(s) ! #self.stack.app.OnRunPycrustrc(None) def loadNamespace(self): self.loadShell() ! if self.stack.app.shell is None: # must have been a problem loading the shell return ! if self.stack.app.namespace is None: ! temp = self.stack.app._showDebugMenu ! self.stack.app._showDebugMenu = 1 ! self.stack.app.showNamespace() ! self.stack.app._showDebugMenu = temp def setName( self, aString ) : --- 803,826 ---- # if the shell isn't needed def loadShell(self): ! if self.application.shell is None: ! temp = self.application._showDebugMenu ! self.application._showDebugMenu = 1 ! self.application.showShell() ! self.application._showDebugMenu = temp # KEA 2003-07-22 # I don't think this is needed since showShell will # run the pycrustrc.py file(s) ! #self.application.OnRunPycrustrc(None) def loadNamespace(self): self.loadShell() ! if self.application.shell is None: # must have been a problem loading the shell return ! if self.application.namespace is None: ! temp = self.application._showDebugMenu ! self.application._showDebugMenu = 1 ! self.application.showNamespace() ! self.application._showDebugMenu = temp def setName( self, aString ) : *************** *** 958,962 **** # or primary window of the application, this should # give us the right window to close to quit the application ! appWindow = self.stack.app.getCurrentBackground() appWindow.close() --- 933,937 ---- # or primary window of the application, this should # give us the right window to close to quit the application ! appWindow = self.application.getCurrentBackground() appWindow.close() *************** *** 982,989 **** # to the menubar. createMenu will create a menubar # if one doesn't already exist ! if self.stack.app._showDebugMenu and self.GetParent() == None: ! self.stack.app._debugMenu = debug.DebugMenu(self.stack.app) ! self.stack.app._debugMenu.createMenu(self) ! self.stack.app._debugMenu.bindMenuEvents(self) # 2001-11-08 --- 957,964 ---- # to the menubar. createMenu will create a menubar # if one doesn't already exist ! if self.application._showDebugMenu and self.GetParent() == None: ! self.application._debugMenu = debug.DebugMenu(self.application) ! self.application._debugMenu.createMenu(self) ! self.application._debugMenu.bindMenuEvents(self) # 2001-11-08 *************** *** 1177,1183 **** Initialize this instance. """ ! Scriptable.__init__( self, aBg.stack ) self.parent = aBg # KEA 2002-09-13 --- 1152,1159 ---- Initialize this instance. """ ! Scriptable.__init__( self, None) self.parent = aBg + self.application = wx.GetApp() # KEA 2002-09-13 Index: menu.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/menu.py,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** menu.py 6 May 2004 17:33:13 -0000 1.36 --- menu.py 10 May 2004 00:45:17 -0000 1.37 *************** *** 95,103 **** background = aScriptable - # where should this check go? - # should we just set a "global" in the app instance such as - # self.stack.app.bindUnusedEvents - # this kind of thing isn't going to work for Rowland's compound - # components if wx.GetApp()._showDebugMenu: bindUnusedEvents = True --- 95,98 ---- |
From: Kevin A. <ka...@us...> - 2004-05-10 00:46:05
|
Update of /cvsroot/pythoncard/PythonCard/components In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16543/components Modified Files: iehtmlwindow.py Log Message: removed Stack class, changed self.stack.app references to self.application changed childWindow, Background, and CustomDialog inits so stack arg isn't passed in. only did minimal testing of tools and samples Index: iehtmlwindow.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/components/iehtmlwindow.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** iehtmlwindow.py 5 May 2004 20:27:09 -0000 1.17 --- iehtmlwindow.py 10 May 2004 00:45:17 -0000 1.18 *************** *** 119,127 **** background = wx.GetTopLevelParent(self) - # where should this check go? - # should we just set a "global" in the app instance such as - # self.stack.app.bindUnusedEvents - # this kind of thing isn't going to work for Rowland's compound - # components if wx.GetApp()._showDebugMenu: bindUnusedEvents = True --- 119,122 ---- |
From: Kevin A. <ka...@us...> - 2004-05-10 00:46:05
|
Update of /cvsroot/pythoncard/PythonCard/samples/pictureViewer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16543/samples/pictureViewer Modified Files: pictureViewer.py Log Message: removed Stack class, changed self.stack.app references to self.application changed childWindow, Background, and CustomDialog inits so stack arg isn't passed in. only did minimal testing of tools and samples Index: pictureViewer.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/pictureViewer/pictureViewer.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** pictureViewer.py 5 May 2004 16:53:28 -0000 1.21 --- pictureViewer.py 10 May 2004 00:45:20 -0000 1.22 *************** *** 41,45 **** log.info('pictureViewer filename: ' + filename) if not os.path.exists(filename): ! filename = os.path.abspath(os.path.join(self.stack.app.startingDirectory, sys.argv[1])) #print filename if os.path.isfile(filename): --- 41,45 ---- log.info('pictureViewer filename: ' + filename) if not os.path.exists(filename): ! filename = os.path.abspath(os.path.join(self.application.startingDirectory, sys.argv[1])) #print filename if os.path.isfile(filename): |
From: Kevin A. <ka...@us...> - 2004-05-10 00:46:05
|
Update of /cvsroot/pythoncard/PythonCard/samples/jabberChat In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16543/samples/jabberChat Modified Files: jabberChat.py Log Message: removed Stack class, changed self.stack.app references to self.application changed childWindow, Background, and CustomDialog inits so stack arg isn't passed in. only did minimal testing of tools and samples Index: jabberChat.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/jabberChat/jabberChat.py,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** jabberChat.py 5 May 2004 16:53:26 -0000 1.30 --- jabberChat.py 10 May 2004 00:45:19 -0000 1.31 *************** *** 76,80 **** if not os.path.exists(self.configPath): os.mkdir(self.configPath) ! basePath = self.stack.app.applicationDirectory configPath = os.path.join(self.configPath, CONFIG_FILE) if not os.path.exists(configPath): --- 76,80 ---- if not os.path.exists(self.configPath): os.mkdir(self.configPath) ! basePath = self.application.applicationDirectory configPath = os.path.join(self.configPath, CONFIG_FILE) if not os.path.exists(configPath): *************** *** 248,252 **** if self.config['playsound']: try: ! filename = os.path.join(self.stack.app.applicationDirectory, 'incoming.wav') snd = sound.Sound(filename) snd.play(1, 0) --- 248,252 ---- if self.config['playsound']: try: ! filename = os.path.join(self.application.applicationDirectory, 'incoming.wav') snd = sound.Sound(filename) snd.play(1, 0) |
From: Kevin A. <ka...@us...> - 2004-05-10 00:46:05
|
Update of /cvsroot/pythoncard/PythonCard/samples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16543/samples Modified Files: samples.py Log Message: removed Stack class, changed self.stack.app references to self.application changed childWindow, Background, and CustomDialog inits so stack arg isn't passed in. only did minimal testing of tools and samples Index: samples.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/samples.py,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** samples.py 5 May 2004 16:53:24 -0000 1.56 --- samples.py 10 May 2004 00:45:18 -0000 1.57 *************** *** 82,88 **** name = self.components.listSamples.stringSelection if name == "samples": ! path = self.stack.app.applicationDirectory else: ! path = os.path.join(self.stack.app.applicationDirectory, name) if os.path.exists(os.path.join(path, name + ".pyw")): filename = os.path.join(path, name + ".pyw") --- 82,88 ---- name = self.components.listSamples.stringSelection if name == "samples": ! path = self.application.applicationDirectory else: ! path = os.path.join(self.application.applicationDirectory, name) if os.path.exists(os.path.join(path, name + ".pyw")): filename = os.path.join(path, name + ".pyw") |
From: Kevin A. <ka...@us...> - 2004-05-10 00:46:05
|
Update of /cvsroot/pythoncard/PythonCard/samples/life In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16543/samples/life Modified Files: lexicon.py life.py patterns.py Log Message: removed Stack class, changed self.stack.app references to self.application changed childWindow, Background, and CustomDialog inits so stack arg isn't passed in. only did minimal testing of tools and samples Index: lexicon.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/life/lexicon.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** lexicon.py 24 Apr 2004 06:49:46 -0000 1.14 --- lexicon.py 10 May 2004 00:45:19 -0000 1.15 *************** *** 116,120 **** def loadPattern(self, name): #filename = name + '.lif' ! #path = os.path.join(self.stack.app.applicationDirectory, 'patterns', filename) try: description, patternString = self.lexicon[name] --- 116,120 ---- def loadPattern(self, name): #filename = name + '.lif' ! #path = os.path.join(self.application.applicationDirectory, 'patterns', filename) try: description, patternString = self.lexicon[name] Index: life.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/life/life.py,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** life.py 5 May 2004 16:53:26 -0000 1.37 --- life.py 10 May 2004 00:45:19 -0000 1.38 *************** *** 312,316 **** self.openingFileDialog = 1 wildcard = "Life files (*.lif)|*.lif;*.LIF" ! directory = os.path.join(self.stack.app.applicationDirectory, 'patterns') result = dialog.openFileDialog(None, "Import which file?", directory, '', wildcard) if result['accepted']: --- 312,316 ---- self.openingFileDialog = 1 wildcard = "Life files (*.lif)|*.lif;*.LIF" ! directory = os.path.join(self.application.applicationDirectory, 'patterns') result = dialog.openFileDialog(None, "Import which file?", directory, '', wildcard) if result['accepted']: Index: patterns.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/life/patterns.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** patterns.py 24 Apr 2004 06:49:46 -0000 1.14 --- patterns.py 10 May 2004 00:45:20 -0000 1.15 *************** *** 38,42 **** def populatePatternsList(self): ! files = glob.glob(os.path.join(self.stack.app.applicationDirectory, 'patterns', '*.[Ll][Ii][Ff]')) items = [] self.files = {} --- 38,42 ---- def populatePatternsList(self): ! files = glob.glob(os.path.join(self.application.applicationDirectory, 'patterns', '*.[Ll][Ii][Ff]')) items = [] self.files = {} *************** *** 55,59 **** def loadPattern(self, name): #filename = name + '.lif' ! #path = os.path.join(self.stack.app.applicationDirectory, 'patterns', filename) try: path = self.files[name] --- 55,59 ---- def loadPattern(self, name): #filename = name + '.lif' ! #path = os.path.join(self.application.applicationDirectory, 'patterns', filename) try: path = self.files[name] |
From: Kevin A. <ka...@us...> - 2004-05-10 00:46:05
|
Update of /cvsroot/pythoncard/PythonCard/samples/searchexplorer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16543/samples/searchexplorer Modified Files: searchexplorer.py Log Message: removed Stack class, changed self.stack.app references to self.application changed childWindow, Background, and CustomDialog inits so stack arg isn't passed in. only did minimal testing of tools and samples Index: searchexplorer.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/searchexplorer/searchexplorer.py,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** searchexplorer.py 5 May 2004 16:53:45 -0000 1.33 --- searchexplorer.py 10 May 2004 00:45:21 -0000 1.34 *************** *** 99,103 **** if not os.path.exists(self.configPath): os.mkdir(self.configPath) ! basePath = self.stack.app.applicationDirectory self.sfFilename = os.path.join(self.configPath, FAVORITES_FILE) if not os.path.exists(self.sfFilename): --- 99,103 ---- if not os.path.exists(self.configPath): os.mkdir(self.configPath) ! basePath = self.application.applicationDirectory self.sfFilename = os.path.join(self.configPath, FAVORITES_FILE) if not os.path.exists(self.sfFilename): |
From: Kevin A. <ka...@us...> - 2004-05-10 00:46:04
|
Update of /cvsroot/pythoncard/PythonCard/samples/simpleIEBrowser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16543/samples/simpleIEBrowser Modified Files: simpleIEBrowser.py Log Message: removed Stack class, changed self.stack.app references to self.application changed childWindow, Background, and CustomDialog inits so stack arg isn't passed in. only did minimal testing of tools and samples Index: simpleIEBrowser.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/simpleIEBrowser/simpleIEBrowser.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** simpleIEBrowser.py 5 May 2004 16:53:46 -0000 1.12 --- simpleIEBrowser.py 10 May 2004 00:45:22 -0000 1.13 *************** *** 12,16 **** def on_initialize(self, event): ! filename = self.stack.app.applicationDirectory + '/index.html' self.components.htmlDisplay.text = filename --- 12,16 ---- def on_initialize(self, event): ! filename = self.application.applicationDirectory + '/index.html' self.components.htmlDisplay.text = filename |
From: Kevin A. <ka...@us...> - 2004-05-10 00:46:04
|
Update of /cvsroot/pythoncard/PythonCard/samples/slideshow In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16543/samples/slideshow Modified Files: slideshow.py Log Message: removed Stack class, changed self.stack.app references to self.application changed childWindow, Background, and CustomDialog inits so stack arg isn't passed in. only did minimal testing of tools and samples Index: slideshow.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/slideshow/slideshow.py,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** slideshow.py 5 May 2004 16:53:46 -0000 1.37 --- slideshow.py 10 May 2004 00:45:22 -0000 1.38 *************** *** 78,82 **** log.info('slideshow filename: ' + filename) if not os.path.exists(filename): ! filename = os.path.abspath(os.path.join(self.stack.app.startingDirectory, sys.argv[1])) #print filename if os.path.isfile(filename): --- 78,82 ---- log.info('slideshow filename: ' + filename) if not os.path.exists(filename): ! filename = os.path.abspath(os.path.join(self.application.startingDirectory, sys.argv[1])) #print filename if os.path.isfile(filename): |
From: Kevin A. <ka...@us...> - 2004-05-10 00:46:04
|
Update of /cvsroot/pythoncard/PythonCard/samples/pysshed In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16543/samples/pysshed Modified Files: customDialogs.py Log Message: removed Stack class, changed self.stack.app references to self.application changed childWindow, Background, and CustomDialog inits so stack arg isn't passed in. only did minimal testing of tools and samples Index: customDialogs.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/pysshed/customDialogs.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** customDialogs.py 21 Apr 2004 21:30:12 -0000 1.9 --- customDialogs.py 10 May 2004 00:45:20 -0000 1.10 *************** *** 42,46 **** def __init__(self, aBg, links=None): ! path = os.path.join(aBg.stack.app.applicationDirectory, 'helpAbout') aDialogRsrc = resource.ResourceFile(model.internationalResourceName(path)).getResource() CustomDialog.__init__(self, aBg, aDialogRsrc) --- 42,46 ---- def __init__(self, aBg, links=None): ! path = os.path.join(aBg.application.applicationDirectory, 'helpAbout') aDialogRsrc = resource.ResourceFile(model.internationalResourceName(path)).getResource() CustomDialog.__init__(self, aBg, aDialogRsrc) *************** *** 69,73 **** def __init__(self, aBg, section='Defaults'): ! path = os.path.join(aBg.stack.app.applicationDirectory, 'prefsDialog') aDialogRsrc = resource.ResourceFile(model.internationalResourceName(path)).getResource() CustomDialog.__init__(self, aBg, aDialogRsrc) --- 69,73 ---- def __init__(self, aBg, section='Defaults'): ! path = os.path.join(aBg.application.applicationDirectory, 'prefsDialog') aDialogRsrc = resource.ResourceFile(model.internationalResourceName(path)).getResource() CustomDialog.__init__(self, aBg, aDialogRsrc) |
From: Kevin A. <ka...@us...> - 2004-05-10 00:46:03
|
Update of /cvsroot/pythoncard/PythonCard/samples/addresses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16543/samples/addresses Modified Files: addresses.py Log Message: removed Stack class, changed self.stack.app references to self.application changed childWindow, Background, and CustomDialog inits so stack arg isn't passed in. only did minimal testing of tools and samples Index: addresses.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/addresses/addresses.py,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** addresses.py 24 Apr 2004 21:09:06 -0000 1.33 --- addresses.py 10 May 2004 00:45:18 -0000 1.34 *************** *** 219,223 **** if not os.path.exists(self.configPath): os.mkdir(self.configPath) ! basePath = self.stack.app.applicationDirectory self.dataPath = os.path.join(self.configPath, DATA_FILE) if not os.path.exists(self.dataPath): --- 219,223 ---- if not os.path.exists(self.configPath): os.mkdir(self.configPath) ! basePath = self.application.applicationDirectory self.dataPath = os.path.join(self.configPath, DATA_FILE) if not os.path.exists(self.dataPath): |
From: Kevin A. <ka...@us...> - 2004-05-10 00:46:03
|
Update of /cvsroot/pythoncard/PythonCard/samples/fpop In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16543/samples/fpop Modified Files: dlg_config.py fpop.py preview.py Log Message: removed Stack class, changed self.stack.app references to self.application changed childWindow, Background, and CustomDialog inits so stack arg isn't passed in. only did minimal testing of tools and samples Index: preview.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/fpop/preview.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** preview.py 5 May 2004 16:53:25 -0000 1.19 --- preview.py 10 May 2004 00:45:18 -0000 1.20 *************** *** 143,147 **** wildcard = "All Files (*.*)|*.*" ! dir = self.stack.app.applicationDirectory result = dialog.saveFileDialog(None, "Save As", dir, filename, wildcard) if result['accepted']: --- 143,147 ---- wildcard = "All Files (*.*)|*.*" ! dir = self.application.applicationDirectory result = dialog.saveFileDialog(None, "Save As", dir, filename, wildcard) if result['accepted']: Index: dlg_config.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/fpop/dlg_config.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** dlg_config.py 21 Apr 2004 21:29:40 -0000 1.8 --- dlg_config.py 10 May 2004 00:45:18 -0000 1.9 *************** *** 11,15 **** def __init__(self, parent): # load the resource ! path = os.path.join(parent.stack.app.applicationDirectory, \ model.internationalResourceName('dlg_config')) aDialogRsrc = resource.ResourceFile(path).getResource() --- 11,15 ---- def __init__(self, parent): # load the resource ! path = os.path.join(parent.application.applicationDirectory, \ model.internationalResourceName('dlg_config')) aDialogRsrc = resource.ResourceFile(path).getResource() Index: fpop.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/fpop/fpop.py,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** fpop.py 5 May 2004 16:53:25 -0000 1.42 --- fpop.py 10 May 2004 00:45:18 -0000 1.43 *************** *** 140,144 **** if not os.path.exists(self.configPath): os.mkdir(self.configPath) ! basePath = self.stack.app.applicationDirectory self.inifile = os.path.join(self.configPath, CONFIG_FILE) if not os.path.exists(self.inifile): --- 140,144 ---- if not os.path.exists(self.configPath): os.mkdir(self.configPath) ! basePath = self.application.applicationDirectory self.inifile = os.path.join(self.configPath, CONFIG_FILE) if not os.path.exists(self.inifile): |
From: Kevin A. <ka...@us...> - 2004-05-10 00:46:03
|
Update of /cvsroot/pythoncard/PythonCard/samples/radioclient In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16543/samples/radioclient Modified Files: radioclient.py Log Message: removed Stack class, changed self.stack.app references to self.application changed childWindow, Background, and CustomDialog inits so stack arg isn't passed in. only did minimal testing of tools and samples Index: radioclient.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/radioclient/radioclient.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** radioclient.py 5 May 2004 16:53:28 -0000 1.24 --- radioclient.py 10 May 2004 00:45:21 -0000 1.25 *************** *** 91,95 **** self.previewWindow.visible = True ! self.stack.app.shell.autoComplete = self.menuBar.getChecked('menuOptionsAutoComplete') if self.components.fldContent.canPaste(): --- 91,95 ---- self.previewWindow.visible = True ! self.application.shell.autoComplete = self.menuBar.getChecked('menuOptionsAutoComplete') if self.components.fldContent.canPaste(): *************** *** 195,199 **** def on_menuOptionsAutoComplete_select(self, event): ! self.stack.app.shell.autoComplete = self.menuBar.getChecked('menuOptionsAutoComplete') def on_radioPreviewPost_command(self, event): --- 195,199 ---- def on_menuOptionsAutoComplete_select(self, event): ! self.application.shell.autoComplete = self.menuBar.getChecked('menuOptionsAutoComplete') def on_radioPreviewPost_command(self, event): |
From: Kevin A. <ka...@us...> - 2004-05-10 00:45:35
|
Update of /cvsroot/pythoncard/PythonCard/tools/textEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16543/tools/textEditor Modified Files: textEditor.pyw Log Message: removed Stack class, changed self.stack.app references to self.application changed childWindow, Background, and CustomDialog inits so stack arg isn't passed in. only did minimal testing of tools and samples Index: textEditor.pyw =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/textEditor/textEditor.pyw,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** textEditor.pyw 30 Apr 2004 16:26:12 -0000 1.72 --- textEditor.pyw 10 May 2004 00:45:25 -0000 1.73 *************** *** 32,36 **** def __init__(self, aBg, searchText='', wholeWordsOnly=0, caseSensitive=0) : # load the resource ! path = os.path.join(aBg.stack.app.applicationDirectory, \ model.internationalResourceName('find')) aDialogRsrc = resource.ResourceFile(path).getResource() --- 32,36 ---- def __init__(self, aBg, searchText='', wholeWordsOnly=0, caseSensitive=0) : # load the resource ! path = os.path.join(aBg.application.applicationDirectory, \ model.internationalResourceName('find')) aDialogRsrc = resource.ResourceFile(path).getResource() *************** *** 96,100 **** log.info('textEditor filename: ' + filename) if not os.path.exists(filename): ! filename = os.path.abspath(os.path.join(self.stack.app.startingDirectory, sys.argv[1])) #print filename if os.path.isfile(filename): --- 96,100 ---- log.info('textEditor filename: ' + filename) if not os.path.exists(filename): ! filename = os.path.abspath(os.path.join(self.application.startingDirectory, sys.argv[1])) #print filename if os.path.isfile(filename): *************** *** 520,532 **** self.loadShell() ! if self.stack.app.shell is not None: ! self.stack.app.shellFrame.visible = not self.stack.app.shellFrame.visible def on_menuScriptletSaveShellSelection_select(self, event): ! if self.stack.app.shell is not None: ! txt = self.stack.app.shell.GetSelectedText() lines = [] for line in txt.splitlines(): ! lines.append(self.stack.app.shell.lstripPrompt(line)) # this is the quick way to convert a list back into a string # appending to strings can be slow because it creates a new string --- 520,532 ---- self.loadShell() ! if self.application.shell is not None: ! self.application.shellFrame.visible = not self.application.shellFrame.visible def on_menuScriptletSaveShellSelection_select(self, event): ! if self.application.shell is not None: ! txt = self.application.shell.GetSelectedText() lines = [] for line in txt.splitlines(): ! lines.append(self.application.shell.lstripPrompt(line)) # this is the quick way to convert a list back into a string # appending to strings can be slow because it creates a new string *************** *** 535,539 **** try: wildcard = "Python files (*.py)|*.py|All Files (*.*)|*.*" ! scriptletsDir = os.path.join(self.stack.app.applicationDirectory, 'scriptlets') result = dialog.saveFileDialog(None, "Save As", scriptletsDir, 'scriptlet.py', wildcard) if result['accepted']: --- 535,539 ---- try: wildcard = "Python files (*.py)|*.py|All Files (*.*)|*.*" ! scriptletsDir = os.path.join(self.application.applicationDirectory, 'scriptlets') result = dialog.saveFileDialog(None, "Save As", scriptletsDir, 'scriptlet.py', wildcard) if result['accepted']: *************** *** 549,556 **** #curDir = os.getcwd() ! if self.stack.app.shell is not None: wildcard = "Python files (*.py)|*.py|All Files (*.*)|*.*" # wildcard = '*.py' ! scriptletsDir = os.path.join(self.stack.app.applicationDirectory, 'scriptlets') result = dialog.openFileDialog(self, 'Open', scriptletsDir, '', wildcard) if result['accepted']: --- 549,556 ---- #curDir = os.getcwd() ! if self.application.shell is not None: wildcard = "Python files (*.py)|*.py|All Files (*.*)|*.*" # wildcard = '*.py' ! scriptletsDir = os.path.join(self.application.applicationDirectory, 'scriptlets') result = dialog.openFileDialog(self, 'Open', scriptletsDir, '', wildcard) if result['accepted']: *************** *** 558,562 **** try: command = 'execfile(%r)' % filename ! self.stack.app.shell.run(command=command, prompt=0, verbose=0) except: pass --- 558,562 ---- try: command = 'execfile(%r)' % filename ! self.application.shell.run(command=command, prompt=0, verbose=0) except: pass |
From: Kevin A. <ka...@us...> - 2004-05-10 00:45:35
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16543/tools/resourceEditor Modified Files: resourceEditor.py Log Message: removed Stack class, changed self.stack.app references to self.application changed childWindow, Background, and CustomDialog inits so stack arg isn't passed in. only did minimal testing of tools and samples Index: resourceEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/resourceEditor.py,v retrieving revision 1.192 retrieving revision 1.193 diff -C2 -d -r1.192 -r1.193 *** resourceEditor.py 9 May 2004 19:46:25 -0000 1.192 --- resourceEditor.py 10 May 2004 00:45:24 -0000 1.193 *************** *** 77,81 **** if wx.Platform == '__WXMSW__': ! path = os.path.join(self.stack.app.applicationDirectory, 'images', 'sizingHandle.bmp') sizingHandleTemplate = {'type':'ImageButton', 'name':'topLeft', --- 77,81 ---- if wx.Platform == '__WXMSW__': ! path = os.path.join(self.application.applicationDirectory, 'images', 'sizingHandle.bmp') sizingHandleTemplate = {'type':'ImageButton', 'name':'topLeft', *************** *** 87,91 **** elif wx.Platform == '__WXMAC__': #self.resizingHandleColor = (0,0,128) ! path = os.path.join(self.stack.app.applicationDirectory, 'images', 'sizingHandle.bmp') sizingHandleTemplate = {'type':'Image', 'name':'topLeft', --- 87,91 ---- elif wx.Platform == '__WXMAC__': #self.resizingHandleColor = (0,0,128) ! path = os.path.join(self.application.applicationDirectory, 'images', 'sizingHandle.bmp') sizingHandleTemplate = {'type':'Image', 'name':'topLeft', *************** *** 125,129 **** self.alignToGrid = self.menuBar.getChecked('menuOptionsAlignToGrid') ! path = os.path.join(self.stack.app.applicationDirectory, 'templates', \ RESOURCE_TEMPLATE) self.rsrc = resource.ResourceFile(path).getResource() --- 125,129 ---- self.alignToGrid = self.menuBar.getChecked('menuOptionsAlignToGrid') ! path = os.path.join(self.application.applicationDirectory, 'templates', \ RESOURCE_TEMPLATE) self.rsrc = resource.ResourceFile(path).getResource() *************** *** 177,181 **** log.info('resourceEditor filename: ' + filename) if not os.path.exists(filename): ! filename = os.path.abspath(os.path.join(self.stack.app.startingDirectory, sys.argv[1])) if os.path.isfile(filename): if filename.endswith('rsrc.py'): --- 177,181 ---- log.info('resourceEditor filename: ' + filename) if not os.path.exists(filename): ! filename = os.path.abspath(os.path.join(self.application.startingDirectory, sys.argv[1])) if os.path.isfile(filename): if filename.endswith('rsrc.py'): *************** *** 366,371 **** if target.name not in self.sizingHandleNames: self.startName = target.name ! if self.stack.app.pw is not None: ! self.stack.app.pw.selectComponentsList(target.name, target.__class__.__name__) # KEA 2002-02-23 self.propertyEditorWindow.selectComponentList(target.name, target.__class__.__name__) --- 366,371 ---- if target.name not in self.sizingHandleNames: self.startName = target.name ! if self.application.pw is not None: ! self.application.pw.selectComponentsList(target.name, target.__class__.__name__) # KEA 2002-02-23 self.propertyEditorWindow.selectComponentList(target.name, target.__class__.__name__) *************** *** 694,698 **** self.resetAndClearWidgets() if self.filename is None: ! path = os.path.join(self.stack.app.applicationDirectory, 'templates', \ RESOURCE_TEMPLATE) self.rsrc = resource.ResourceFile(path).getResource() --- 694,698 ---- self.resetAndClearWidgets() if self.filename is None: ! path = os.path.join(self.application.applicationDirectory, 'templates', \ RESOURCE_TEMPLATE) self.rsrc = resource.ResourceFile(path).getResource() *************** *** 712,716 **** def getNewFileTemplates(self): ! templatesDir = os.path.join(self.stack.app.applicationDirectory, 'templates') fileList = os.listdir(templatesDir) #fileList.sort() --- 712,716 ---- def getNewFileTemplates(self): ! templatesDir = os.path.join(self.application.applicationDirectory, 'templates') fileList = os.listdir(templatesDir) #fileList.sort() *************** *** 849,854 **** self.startSize = (0, 0) self.offset = (0, 0) ! if self.stack.app.pw is not None: ! self.stack.app.pw.selectComponentsList('topLeft', 'ImageButton') # KEA 2002-02-23 self.propertyEditorWindow.clearComponentList() --- 849,854 ---- self.startSize = (0, 0) self.offset = (0, 0) ! if self.application.pw is not None: ! self.application.pw.selectComponentsList('topLeft', 'ImageButton') # KEA 2002-02-23 self.propertyEditorWindow.clearComponentList() *************** *** 918,925 **** self.components[c].Lower() ! if self.stack.app.pw is not None: ! self.stack.app.pw.clearComponentsList() ! self.stack.app.pw.displayComponents(self.components) ! self.stack.app.pw.selectComponentsList(name, self.components[name].__class__.__name__) # KEA 2002-02-23 ##self.propertyEditorWindow.Freeze() --- 918,925 ---- self.components[c].Lower() ! if self.application.pw is not None: ! self.application.pw.clearComponentsList() ! self.application.pw.displayComponents(self.components) ! self.application.pw.selectComponentsList(name, self.components[name].__class__.__name__) # KEA 2002-02-23 ##self.propertyEditorWindow.Freeze() |
From: Kevin A. <ka...@us...> - 2004-05-10 00:45:34
|
Update of /cvsroot/pythoncard/PythonCard/tools/codeEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16543/tools/codeEditor Modified Files: codeEditor.py Log Message: removed Stack class, changed self.stack.app references to self.application changed childWindow, Background, and CustomDialog inits so stack arg isn't passed in. only did minimal testing of tools and samples Index: codeEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/codeEditor/codeEditor.py,v retrieving revision 1.113 retrieving revision 1.114 diff -C2 -d -r1.113 -r1.114 *** codeEditor.py 5 May 2004 18:07:09 -0000 1.113 --- codeEditor.py 10 May 2004 00:45:23 -0000 1.114 *************** *** 100,104 **** log.info('codeEditor filename: ' + filename) if not os.path.exists(filename): ! filename = os.path.abspath(os.path.join(self.stack.app.startingDirectory, sys.argv[1])) #print filename if os.path.isfile(filename): --- 100,104 ---- log.info('codeEditor filename: ' + filename) if not os.path.exists(filename): ! filename = os.path.abspath(os.path.join(self.application.startingDirectory, sys.argv[1])) #print filename if os.path.isfile(filename): *************** *** 306,311 **** if config is not None: STCStyleEditor.initSTC(self.components.document, config, 'python') ! if self.stack.app.shell is not None: ! STCStyleEditor.initSTC(self.stack.app.shell, config, 'python') def setEditorStyle(self): --- 306,311 ---- if config is not None: STCStyleEditor.initSTC(self.components.document, config, 'python') ! if self.application.shell is not None: ! STCStyleEditor.initSTC(self.application.shell, config, 'python') def setEditorStyle(self): *************** *** 543,547 **** def on_menuFileNewWindow_select(self, event): app = os.path.split(sys.argv[0])[-1] ! filename = os.path.join(self.stack.app.applicationDirectory, app) python = sys.executable if ' ' in python: --- 543,547 ---- def on_menuFileNewWindow_select(self, event): app = os.path.split(sys.argv[0])[-1] ! filename = os.path.join(self.application.applicationDirectory, app) python = sys.executable if ' ' in python: *************** *** 553,559 **** # a File->Exit would iterate through each? """ ! path = os.path.join(self.stack.app.applicationDirectory, 'codeEditor') rsrc = resource.ResourceFile(model.internationalResourceName(path)).getResource() ! self.childWindow = CodeEditor(self.stack, self, rsrc.stack.backgrounds[0]) """ --- 553,559 ---- # a File->Exit would iterate through each? """ ! path = os.path.join(self.application.applicationDirectory, 'codeEditor') rsrc = resource.ResourceFile(model.internationalResourceName(path)).getResource() ! self.childWindow = CodeEditor(self, rsrc.stack.backgrounds[0]) """ *************** *** 894,931 **** self.loadShell() ! if self.stack.app.shell is not None: ! self.stack.app.shellFrame.visible = not self.stack.app.shellFrame.visible def on_menuScriptletNamespace_select(self, event): self.loadNamespace() ! if self.stack.app.namespace is not None: ! self.stack.app.namespaceFrame.visible = not self.stack.app.namespaceFrame.visible def on_menuScriptletSaveUserConfiguration_select(self, event): ! if self.stack.app.mw is not None: ! configuration.setOption('messageWatcherPosition', self.stack.app.mw.position) ! configuration.setOption('messageWatcherSize', self.stack.app.mw.size) configuration.setOption('showMessageWatcher', 0) ! if self.stack.app.namespaceFrame is not None: ! configuration.setOption('namespacePosition', self.stack.app.namespaceFrame.position) ! configuration.setOption('namespaceSize', self.stack.app.namespaceFrame.size) configuration.setOption('showNamespace', 0) ! if self.stack.app.pw is not None: ! configuration.setOption('propertyEditorPosition', self.stack.app.pw.position) ! configuration.setOption('propertyEditorSize', self.stack.app.pw.size) configuration.setOption('showPropertyEditor', 0) ! if self.stack.app.shellFrame is not None: ! configuration.setOption('shellPosition', self.stack.app.shellFrame.position) ! configuration.setOption('shellSize', self.stack.app.shellFrame.size) configuration.setOption('showShell', 0) configuration.saveConfig() def on_menuScriptletSaveShellSelection_select(self, event): ! if self.stack.app.shell is not None: ! txt = self.stack.app.shell.GetSelectedText() lines = [] for line in txt.splitlines(): ! lines.append(self.stack.app.shell.lstripPrompt(line)) # this is the quick way to convert a list back into a string # appending to strings can be slow because it creates a new string --- 894,931 ---- self.loadShell() ! if self.application.shell is not None: ! self.application.shellFrame.visible = not self.application.shellFrame.visible def on_menuScriptletNamespace_select(self, event): self.loadNamespace() ! if self.application.namespace is not None: ! self.application.namespaceFrame.visible = not self.application.namespaceFrame.visible def on_menuScriptletSaveUserConfiguration_select(self, event): ! if self.application.mw is not None: ! configuration.setOption('messageWatcherPosition', self.application.mw.position) ! configuration.setOption('messageWatcherSize', self.application.mw.size) configuration.setOption('showMessageWatcher', 0) ! if self.application.namespaceFrame is not None: ! configuration.setOption('namespacePosition', self.application.namespaceFrame.position) ! configuration.setOption('namespaceSize', self.application.namespaceFrame.size) configuration.setOption('showNamespace', 0) ! if self.application.pw is not None: ! configuration.setOption('propertyEditorPosition', self.application.pw.position) ! configuration.setOption('propertyEditorSize', self.application.pw.size) configuration.setOption('showPropertyEditor', 0) ! if self.application.shellFrame is not None: ! configuration.setOption('shellPosition', self.application.shellFrame.position) ! configuration.setOption('shellSize', self.application.shellFrame.size) configuration.setOption('showShell', 0) configuration.saveConfig() def on_menuScriptletSaveShellSelection_select(self, event): ! if self.application.shell is not None: ! txt = self.application.shell.GetSelectedText() lines = [] for line in txt.splitlines(): ! lines.append(self.application.shell.lstripPrompt(line)) # this is the quick way to convert a list back into a string # appending to strings can be slow because it creates a new string *************** *** 935,939 **** #wildcard = "Python files (*.py)|*.py|All Files (*.*)|*.*" wildcard = self.resource.strings.scriptletWildcard ! scriptletsDir = os.path.join(self.stack.app.applicationDirectory, 'scriptlets') result = dialog.saveFileDialog(None, self.resource.strings.saveAs, scriptletsDir, 'scriptlet.py', wildcard) if result['accepted']: --- 935,939 ---- #wildcard = "Python files (*.py)|*.py|All Files (*.*)|*.*" wildcard = self.resource.strings.scriptletWildcard ! scriptletsDir = os.path.join(self.application.applicationDirectory, 'scriptlets') result = dialog.saveFileDialog(None, self.resource.strings.saveAs, scriptletsDir, 'scriptlet.py', wildcard) if result['accepted']: *************** *** 948,952 **** try: command = 'execfile(%r)' % filename ! self.stack.app.shell.run(command=command, prompt=0, verbose=0) except: pass --- 948,952 ---- try: command = 'execfile(%r)' % filename ! self.application.shell.run(command=command, prompt=0, verbose=0) except: pass *************** *** 956,964 **** #curDir = os.getcwd() ! if self.stack.app.shell is not None: #wildcard = "Python files (*.py)|*.py|All Files (*.*)|*.*" wildcard = self.resource.strings.scriptletWildcard # wildcard = '*.py' ! scriptletsDir = os.path.join(self.stack.app.applicationDirectory, 'scriptlets') result = dialog.openFileDialog(self, self.resource.strings.openFile, scriptletsDir, '', wildcard) if result['accepted']: --- 956,964 ---- #curDir = os.getcwd() ! if self.application.shell is not None: #wildcard = "Python files (*.py)|*.py|All Files (*.*)|*.*" wildcard = self.resource.strings.scriptletWildcard # wildcard = '*.py' ! scriptletsDir = os.path.join(self.application.applicationDirectory, 'scriptlets') result = dialog.openFileDialog(self, self.resource.strings.openFile, scriptletsDir, '', wildcard) if result['accepted']: *************** *** 988,992 **** def on_runMacro_command(self, event): name = event.target.name[len('menuScriptlet'):] ! #scriptletsDir = os.path.join(self.stack.app.applicationDirectory, 'scriptlets') #filename = os.path.join(scriptletsDir, name + '.py') for macro in self.macros: --- 988,992 ---- def on_runMacro_command(self, event): name = event.target.name[len('menuScriptlet'):] ! #scriptletsDir = os.path.join(self.application.applicationDirectory, 'scriptlets') #filename = os.path.join(scriptletsDir, name + '.py') for macro in self.macros: *************** *** 1185,1189 **** def on_findFiles_command(self, event): ! fn = self.stack.app.applicationDirectory fn = os.path.join(fn, os.pardir, "findfiles", "findfiles.py") fn = os.path.normpath(fn) --- 1185,1189 ---- def on_findFiles_command(self, event): ! fn = self.application.applicationDirectory fn = os.path.join(fn, os.pardir, "findfiles", "findfiles.py") fn = os.path.normpath(fn) |
From: Kevin A. <ka...@us...> - 2004-05-10 00:45:33
|
Update of /cvsroot/pythoncard/PythonCard/samples/webgrabber In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16543/samples/webgrabber Modified Files: webgrabber.py Log Message: removed Stack class, changed self.stack.app references to self.application changed childWindow, Background, and CustomDialog inits so stack arg isn't passed in. only did minimal testing of tools and samples Index: webgrabber.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/webgrabber/webgrabber.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** webgrabber.py 5 May 2004 16:53:49 -0000 1.10 --- webgrabber.py 10 May 2004 00:45:23 -0000 1.11 *************** *** 111,115 **** dir = self.components.fldDirectory.text if dir == '': ! dir = self.stack.app.applicationDirectory result = dialog.directoryDialog(self, '', dir) if result['accepted']: --- 111,115 ---- dir = self.components.fldDirectory.text if dir == '': ! dir = self.application.applicationDirectory result = dialog.directoryDialog(self, '', dir) if result['accepted']: |
From: Kevin A. <ka...@us...> - 2004-05-10 00:45:33
|
Update of /cvsroot/pythoncard/PythonCard/samples/webserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16543/samples/webserver Modified Files: webserver.py Log Message: removed Stack class, changed self.stack.app references to self.application changed childWindow, Background, and CustomDialog inits so stack arg isn't passed in. only did minimal testing of tools and samples Index: webserver.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/webserver/webserver.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** webserver.py 5 May 2004 16:53:49 -0000 1.23 --- webserver.py 10 May 2004 00:45:23 -0000 1.24 *************** *** 452,456 **** os.mkdir(self.configPath) configPath = os.path.join(self.configPath, CONFIG_FILE) ! defaultPath = os.path.join(self.stack.app.applicationDirectory, CONFIG_FILE) if not os.path.exists(configPath): shutil.copy2(defaultPath, configPath) --- 452,456 ---- os.mkdir(self.configPath) configPath = os.path.join(self.configPath, CONFIG_FILE) ! defaultPath = os.path.join(self.application.applicationDirectory, CONFIG_FILE) if not os.path.exists(configPath): shutil.copy2(defaultPath, configPath) |
From: Kevin A. <ka...@us...> - 2004-05-09 23:58:19
|
Update of /cvsroot/pythoncard/PythonCard/samples/dbBrowser/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9019/samples/dbBrowser/scripts Modified Files: gadfly_sample.py mysql_sample.py Log Message: fixed rogue lines ending in just a carriage return Index: mysql_sample.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/dbBrowser/scripts/mysql_sample.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mysql_sample.py 21 Aug 2001 12:07:46 -0000 1.1 --- mysql_sample.py 9 May 2004 23:58:09 -0000 1.2 *************** *** 1,89 **** ! #!/usr/bin/python ! # Usage: python mysql_sample.py <username> <password> ! # ! # If you do not specify a username and a password then you will need ! # to have 'open' access to your local MySQL database. ! # ! # This script kind of assumes you are one Windows. With the Windows binary ! # distribution of MySQL you get two databases 'for free', one called MYSQL ! # and another called 'test'. We create the tables in 'test' if the user does ! # not specify a database name. If there is no database called 'test' on *nix ! # then we are in trouble. ! # ! import MySQLdb, sys ! ! # Specify some default values ! usageString="Usage: python %s <username> <password> <db name>" % sys.argv[0] ! dbName='test' ! ! if __name__=="__main__": ! if len(sys.argv) > 1: ! if sys.argv[1] in ("-h","--help"): ! print usageString ! sys.exit(0) ! if sys.argv[3]: ! # There is a database name on the command line ! dbName=sys.argv[3] ! # We assume arguments 1 and 2 are username and password ! try: ! db=MySQLdb.connect(user=sys.argv[1], passwd=sys.argv[2], db=dbName) ! except MySQLdb.OperationalError: ! print usageString ! print "Invalid username, password or db name, please try again" ! sys.exit(1) ! else: ! # Free entry for all ! try: ! db=MySQLdb.connect(db=dbName) ! except MySQLdb.OperationalError: ! print usageString ! print "You cannot connect to the 'test' database without a valid username and password" ! sys.exit(1) ! # We have connected to a database now, lets issue some SQL ! # There is no error handling here, if anything goes wrong exceptions ! # will be raised by the MySQLdb package ! cursor=db.cursor() ! stmt=""" ! CREATE TABLE currencies ! ( currency_code VARCHAR(3) NOT NULL ! ,currency_desc VARCHAR(255) ! ,PRIMARY KEY ( currency_code ) ! ) ! """ ! result=cursor.execute(stmt) ! ! stmt=""" ! INSERT INTO currencies ! ( currency_code, currency_desc ) ! VALUES ! ( 'USD', 'US Dollars'), ! ( 'AUD', 'Australian Dollars'), ! ( 'UKP', 'Pounds Sterling'), ! ( 'FFR', 'French Francs'), ! ( 'HKD', 'Hong Kong Dollar'), ! ( 'CHF', 'Swiss Franc'), ! ( 'CAD', 'Canadian Dollar'), ! ( 'VND', 'Vietnamese Dong') ! """ ! result=cursor.execute(stmt) ! ! stmt=""" ! CREATE TABLE exchange_rates ! ( exchange_date DATE NOT NULL ! ,currency_from VARCHAR(3) NOT NULL ! ,currency_to VARCHAR(3) NOT NULL ! ,exchange_rate NUMERIC(15,3) ! ) ! """ ! result=cursor.execute(stmt) ! ! stmt=""" ! INSERT INTO exchange_rates ! ( exchange_date, currency_from, currency_to, exchange_rate ) ! VALUES ! ( '2001-08-01', 'USD', 'AUD', 1.869 ), ! ( '2001-08-01', 'USD', 'UKP', 0.750 ), ! ( '2001-08-01', 'UKP', 'HKD', 11.02 ) ! """ ! result=cursor.execute(stmt) ! --- 1,89 ---- ! #!/usr/bin/python ! # Usage: python mysql_sample.py <username> <password> ! # ! # If you do not specify a username and a password then you will need ! # to have 'open' access to your local MySQL database. ! # ! # This script kind of assumes you are one Windows. With the Windows binary ! # distribution of MySQL you get two databases 'for free', one called MYSQL ! # and another called 'test'. We create the tables in 'test' if the user does ! # not specify a database name. If there is no database called 'test' on *nix ! # then we are in trouble. ! # ! import MySQLdb, sys ! ! # Specify some default values ! usageString="Usage: python %s <username> <password> <db name>" % sys.argv[0] ! dbName='test' ! ! if __name__=="__main__": ! if len(sys.argv) > 1: ! if sys.argv[1] in ("-h","--help"): ! print usageString ! sys.exit(0) ! if sys.argv[3]: ! # There is a database name on the command line ! dbName=sys.argv[3] ! # We assume arguments 1 and 2 are username and password ! try: ! db=MySQLdb.connect(user=sys.argv[1], passwd=sys.argv[2], db=dbName) ! except MySQLdb.OperationalError: ! print usageString ! print "Invalid username, password or db name, please try again" ! sys.exit(1) ! else: ! # Free entry for all ! try: ! db=MySQLdb.connect(db=dbName) ! except MySQLdb.OperationalError: ! print usageString ! print "You cannot connect to the 'test' database without a valid username and password" ! sys.exit(1) ! # We have connected to a database now, lets issue some SQL ! # There is no error handling here, if anything goes wrong exceptions ! # will be raised by the MySQLdb package ! cursor=db.cursor() ! stmt=""" ! CREATE TABLE currencies ! ( currency_code VARCHAR(3) NOT NULL ! ,currency_desc VARCHAR(255) ! ,PRIMARY KEY ( currency_code ) ! ) ! """ ! result=cursor.execute(stmt) ! ! stmt=""" ! INSERT INTO currencies ! ( currency_code, currency_desc ) ! VALUES ! ( 'USD', 'US Dollars'), ! ( 'AUD', 'Australian Dollars'), ! ( 'UKP', 'Pounds Sterling'), ! ( 'FFR', 'French Francs'), ! ( 'HKD', 'Hong Kong Dollar'), ! ( 'CHF', 'Swiss Franc'), ! ( 'CAD', 'Canadian Dollar'), ! ( 'VND', 'Vietnamese Dong') ! """ ! result=cursor.execute(stmt) ! ! stmt=""" ! CREATE TABLE exchange_rates ! ( exchange_date DATE NOT NULL ! ,currency_from VARCHAR(3) NOT NULL ! ,currency_to VARCHAR(3) NOT NULL ! ,exchange_rate NUMERIC(15,3) ! ) ! """ ! result=cursor.execute(stmt) ! ! stmt=""" ! INSERT INTO exchange_rates ! ( exchange_date, currency_from, currency_to, exchange_rate ) ! VALUES ! ( '2001-08-01', 'USD', 'AUD', 1.869 ), ! ( '2001-08-01', 'USD', 'UKP', 0.750 ), ! ( '2001-08-01', 'UKP', 'HKD', 11.02 ) ! """ ! result=cursor.execute(stmt) ! Index: gadfly_sample.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/dbBrowser/scripts/gadfly_sample.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gadfly_sample.py 29 Jan 2003 15:38:02 -0000 1.1 --- gadfly_sample.py 9 May 2004 23:58:09 -0000 1.2 *************** *** 1,80 **** ! #!/usr/bin/python ! # Usage: python gadfly_sample.py <databaseName> <databaseDirectory> ! # ! # Based on the mysql_sample.py script shipped with the PythonCard dbBrowser sample ! __author__ = "Andy Todd <an...@ha...>" ! ! import gadfly, sys ! ! # Specify some default values ! usageString="Usage: python %s <databaseName> <databaseDirectory>" % sys.argv[0] ! ! if __name__=="__main__": ! if len(sys.argv) > 1: ! if sys.argv[1] in ("-h","--help") or len(sys.argv) != 3: ! print usageString ! sys.exit(0) ! # There is a database name on the command line ! dbName=sys.argv[1] ! dbDir=sys.argv[2] ! # If the database doesn't already exist we need to create it ! try: ! db=gadfly.gadfly(dbName, dbDir) ! except IOError: ! print "Database %s doesn't exist, creating it ..." % dbName ! db=gadfly.gadfly() ! db.startup(dbName, dbDir) ! ! # We have connected to a database now, lets issue some SQL ! # There is no error handling here, if anything goes wrong exceptions ! # will be raised by the MySQLdb package ! cursor=db.cursor() ! stmt=""" ! CREATE TABLE currencies ! ( currency_code VARCHAR(3) ! ,currency_desc VARCHAR(255) ! ) ! """ ! result=cursor.execute(stmt) ! db.commit() ! stmt="""CREATE UNIQUE INDEX currency_pk ON currencies(currency_code)""" ! result=cursor.execute(stmt) ! db.commit() ! ! stmt=""" ! INSERT INTO currencies ! ( currency_code, currency_desc ) ! VALUES ! ( ?, ? )""" ! cursor.execute(stmt, ( 'USD', 'US Dollars')) ! cursor.execute(stmt, ( 'AUD', 'Australian Dollars')) ! cursor.execute(stmt, ( 'UKP', 'Pounds Sterling')) ! cursor.execute(stmt, ( 'FFR', 'French Francs')) ! cursor.execute(stmt, ( 'HKD', 'Hong Kong Dollar')) ! cursor.execute(stmt, ( 'CHF', 'Swiss Franc')) ! cursor.execute(stmt, ( 'CAD', 'Canadian Dollar')) ! cursor.execute(stmt, ( 'VND', 'Vietnamese Dong')) ! db.commit() ! ! stmt=""" ! CREATE TABLE exchange_rates ! ( exchange_date VARCHAR ! ,currency_from VARCHAR(3) ! ,currency_to VARCHAR(3) ! ,exchange_rate FLOAT ! ) ! """ ! result=cursor.execute(stmt) ! db.commit() ! ! stmt=""" ! INSERT INTO exchange_rates ! ( exchange_date, currency_from, currency_to, exchange_rate ) ! VALUES ! ( ?, ?, ?, ? ) ! """ ! cursor.execute(stmt, ( '2001-08-01', 'USD', 'AUD', 1.869 )) ! cursor.execute(stmt, ( '2001-08-01', 'USD', 'UKP', 0.750 )) ! cursor.execute(stmt, ( '2001-08-01', 'UKP', 'HKD', 11.02 )) ! db.commit() ! --- 1,80 ---- ! #!/usr/bin/python ! # Usage: python gadfly_sample.py <databaseName> <databaseDirectory> ! # ! # Based on the mysql_sample.py script shipped with the PythonCard dbBrowser sample ! __author__ = "Andy Todd <an...@ha...>" ! ! import gadfly, sys ! ! # Specify some default values ! usageString="Usage: python %s <databaseName> <databaseDirectory>" % sys.argv[0] ! ! if __name__=="__main__": ! if len(sys.argv) > 1: ! if sys.argv[1] in ("-h","--help") or len(sys.argv) != 3: ! print usageString ! sys.exit(0) ! # There is a database name on the command line ! dbName=sys.argv[1] ! dbDir=sys.argv[2] ! # If the database doesn't already exist we need to create it ! try: ! db=gadfly.gadfly(dbName, dbDir) ! except IOError: ! print "Database %s doesn't exist, creating it ..." % dbName ! db=gadfly.gadfly() ! db.startup(dbName, dbDir) ! ! # We have connected to a database now, lets issue some SQL ! # There is no error handling here, if anything goes wrong exceptions ! # will be raised by the MySQLdb package ! cursor=db.cursor() ! stmt=""" ! CREATE TABLE currencies ! ( currency_code VARCHAR(3) ! ,currency_desc VARCHAR(255) ! ) ! """ ! result=cursor.execute(stmt) ! db.commit() ! stmt="""CREATE UNIQUE INDEX currency_pk ON currencies(currency_code)""" ! result=cursor.execute(stmt) ! db.commit() ! ! stmt=""" ! INSERT INTO currencies ! ( currency_code, currency_desc ) ! VALUES ! ( ?, ? )""" ! cursor.execute(stmt, ( 'USD', 'US Dollars')) ! cursor.execute(stmt, ( 'AUD', 'Australian Dollars')) ! cursor.execute(stmt, ( 'UKP', 'Pounds Sterling')) ! cursor.execute(stmt, ( 'FFR', 'French Francs')) ! cursor.execute(stmt, ( 'HKD', 'Hong Kong Dollar')) ! cursor.execute(stmt, ( 'CHF', 'Swiss Franc')) ! cursor.execute(stmt, ( 'CAD', 'Canadian Dollar')) ! cursor.execute(stmt, ( 'VND', 'Vietnamese Dong')) ! db.commit() ! ! stmt=""" ! CREATE TABLE exchange_rates ! ( exchange_date VARCHAR ! ,currency_from VARCHAR(3) ! ,currency_to VARCHAR(3) ! ,exchange_rate FLOAT ! ) ! """ ! result=cursor.execute(stmt) ! db.commit() ! ! stmt=""" ! INSERT INTO exchange_rates ! ( exchange_date, currency_from, currency_to, exchange_rate ) ! VALUES ! ( ?, ?, ?, ? ) ! """ ! cursor.execute(stmt, ( '2001-08-01', 'USD', 'AUD', 1.869 )) ! cursor.execute(stmt, ( '2001-08-01', 'USD', 'UKP', 0.750 )) ! cursor.execute(stmt, ( '2001-08-01', 'UKP', 'HKD', 11.02 )) ! db.commit() ! |