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 |