From: Andy T. <an...@us...> - 2005-12-13 11:13:49
|
Update of /cvsroot/pythoncard/PythonCard/samples/searchexplorer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19204/searchexplorer Modified Files: searchexplorer.py Log Message: Removed all of the plain except: clauses I could Index: searchexplorer.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/searchexplorer/searchexplorer.py,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** searchexplorer.py 10 May 2004 00:45:21 -0000 1.34 --- searchexplorer.py 13 Dec 2005 11:13:25 -0000 1.35 *************** *** 2,22 **** """ - KEA notes to myself - - __version__ = "$Revision$" - __date__ = "$Date$" - __author__ = "Kevin Altis <al...@se...>" - App Name: SearchExplorer Created: 2001-07-21 Description: The first useful application using the PythonCard prototype. - I really need to learn to do doc strings correctly! Are there additional - standard doc string identifiers for the creation date, how about strings - for all the different @ names you can do in javadoc? - - use of __init__ will go away as soon as there is a doMeFirst, openStack, - openBackground message fired when the application starts up - List widget needs to support selections by number rather than just by string List widget needs to support more methods for inserting, appending, clearing, etc. --- 2,9 ---- *************** *** 72,75 **** --- 59,65 ---- """ + __version__ = "$Revision$" + __date__ = "$Date$" + __author__ = "Kevin Altis <al...@se...>" import urllib *************** *** 77,81 **** import pprint ! from PythonCard import configuration, dialog, model, util import os, sys import shutil --- 67,71 ---- import pprint ! from PythonCard import configuration, dialog, model, util, log import os, sys import shutil *************** *** 86,89 **** --- 76,80 ---- def on_initialize(self, event): + self.changed = 0 wFldSearch = self.components.fldSearch # copy the clipboard to fldSearch when the app starts *************** *** 101,115 **** basePath = self.application.applicationDirectory self.sfFilename = os.path.join(self.configPath, FAVORITES_FILE) if not os.path.exists(self.sfFilename): ! shutil.copy2(os.path.join(basePath, FAVORITES_FILE), self.sfFilename) ! ! try: ! #self.sitesDict = eval(open(self.sfFilename).read()) self.sitesDict = util.readAndEvalFile(self.sfFilename) - except: - dialog.messageDialog(self, 'Unable to load ' + self.sfFilename, 'SearchExplorer exiting') - sys.exit() - - self.changed = 0 defaultSite = 'Google' --- 92,103 ---- basePath = self.application.applicationDirectory self.sfFilename = os.path.join(self.configPath, FAVORITES_FILE) + log.debug('Favourites are in %s' % self.sfFilename) if not os.path.exists(self.sfFilename): ! try: ! shutil.copy2(os.path.join(basePath, FAVORITES_FILE), self.sfFilename) ! except IOError: ! dialog.messageDialog(self, 'Unable to load ' + self.sfFilename, 'SearchExplorer exiting') ! sys.exit() self.sitesDict = util.readAndEvalFile(self.sfFilename) defaultSite = 'Google' *************** *** 143,154 **** # to simulate transparent saves if self.changed: ! try: ! f = open(self.sfFilename, "w") ! #s = repr(self.sitesDict) ! #f.write(s) ! pprint.pprint(self.sitesDict, f) ! f.close() ! except: ! pass # argh def doLaunch(self): --- 131,139 ---- # to simulate transparent saves if self.changed: ! f = open(self.sfFilename, "w") ! #s = repr(self.sitesDict) ! #f.write(s) ! pprint.pprint(self.sitesDict, f) ! f.close() def doLaunch(self): *************** *** 206,214 **** site = self.components.listSites.stringSelection pastSearches = self.sitesDict[site]['pastSearches'] ! try: ! pastSearches.remove(doomed) # update self.sitesDict[site]['pastSearches'] ! self.changed = 1 ! except: ! pass wListPastSearches.items = pastSearches --- 191,196 ---- site = self.components.listSites.stringSelection pastSearches = self.sitesDict[site]['pastSearches'] ! pastSearches.remove(doomed) # update self.sitesDict[site]['pastSearches'] ! self.changed = 1 wListPastSearches.items = pastSearches *************** *** 249,256 **** else: ins = widget.getInsertionPoint() ! try: ! widget.replace(ins, ins + 1, '') ! except: ! pass def on_menuEditSelectAll_select(self, event): --- 231,235 ---- else: ins = widget.getInsertionPoint() ! widget.replace(ins, ins + 1, '') def on_menuEditSelectAll_select(self, event): |