|
From: Phil E. <l2...@us...> - 2005-05-12 08:32:59
|
Update of /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30090 Modified Files: standaloneBuilder.py Log Message: Corrected copyright message and removed inaccurate list of PythonCard developers. Added a work around for the fact that wxFileDialog is happy to accept non-existent filenames. Adding a script now checks for a matching resource file and pops up a dialog to see if you want to add the resource file at the same time. Index: standaloneBuilder.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/standaloneBuilder.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** standaloneBuilder.py 9 May 2005 09:58:02 -0000 1.10 --- standaloneBuilder.py 12 May 2005 08:32:50 -0000 1.11 *************** *** 2,6 **** # # PythonCard standaloneBuilder tool - Phil Edwards <ph...@li...> ! # Copyright (c) 2001-2003 PythonCard developers # All rights reserved. # --- 2,6 ---- # # PythonCard standaloneBuilder tool - Phil Edwards <ph...@li...> ! # Copyright (c) 2001-2005 PythonCard developers # All rights reserved. # *************** *** 27,54 **** # SUCH DAMAGE. # - # The PythonCard developers are; - # Kevin Altis (al...@se...) - # Rowland Smith - # Patrick K O'Brien (po...@or...) - # Neil Hodgson (ne...@sc...) - # Robin Dunn (ro...@al...) - # Dan Winkler - # Andy Todd (an...@ha...) - # Simon Kittle - # Juergen Rauch - # Richard Wolff - # Dan Shafer - # Randy Lea - # Riaan Booysen - # David Primmer - # Fred Pacquier - # Gene Cash - # Thomas Heller - # Phil Edwards (ph...@li...) - # David McNab - # Jon Dyte (jo...@to...) - # Roman Suzi (rn...@on...) - # William Volkman - # # vim: ai et sw=4 ts=4 --- 27,30 ---- *************** *** 270,273 **** --- 246,250 ---- bull = dialog.alertDialog(self, wrap_string(msg, 60), title) else: + self.checkResourceFile(result.paths[0]) self.components.mainScript.text = rpath self.documentChanged = True *************** *** 290,293 **** --- 267,271 ---- bull = dialog.alertDialog(self, wrap_string(msg, 70), title) else: + self.checkResourceFile(p) current.append(path) current.sort() *************** *** 598,601 **** --- 576,597 ---- # ############################################################################## + def checkResourceFile(self, path): + # when adding a script, see if there is a matching resource file + root, ext = os.path.splitext(path) + script = os.path.basename(path) + resfile = root + '.rsrc.py' + if os.path.isfile(resfile): + # is it already in the list of resource files? + if not os.path.basename(resfile) in self.components.resList.items: + txt = '%s has a matching PythonCard resource file. Would you like to also' % (script) + txt += ' add the resource file to your project?' + result = dialog.messageDialog(self, wrap_string(txt, 60), 'Please confirm', + wx.ICON_EXCLAMATION|wx.YES_NO|wx.YES_DEFAULT) + if result.accepted: + x = self.components.resList.items + x.append(os.path.basename(resfile)) + x.sort() + self.components.resList.items = x + def runScript(self, useInterpreter): item = self.pathJoin(self.components.mainScript.text) *************** *** 820,835 **** if result.accepted: for p in result.paths: ! if refpath is None: ! # we want the whole path to the item ! path = os.path.basename(p) else: ! # we just want the part thats relative to 'refpath' ! path = string.replace(p, refpath + os.sep, '') ! if not (path in x): ! x.append(path) ! x.sort() ! self.documentChanged = True ! self.updateStatusBar() ! self.Refresh() return x --- 816,836 ---- if result.accepted: for p in result.paths: ! if not os.path.exists(p): ! title = 'Invalid filename!' ! txt = '%s is not a valid filename!' % p ! bull = dialog.alertDialog(self, wrap_string(txt, 70), title) else: ! if refpath is None: ! # we want the whole path to the item ! path = os.path.basename(p) ! else: ! # we just want the part thats relative to 'refpath' ! path = string.replace(p, refpath + os.sep, '') ! if not (path in x): ! x.append(path) ! x.sort() ! self.documentChanged = True ! self.updateStatusBar() ! self.Refresh() return x |