From: Kevin A. <ka...@us...> - 2004-10-24 22:48:21
|
Update of /cvsroot/pythoncard/PythonCard/tools/oneEditor/scriptlets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15894 Modified Files: documentWordCount.py insertDateAndTime.py insertDialog.py selectionWordCount.py unorderedList.py Log Message: theoretically I've fixed these to use the new document and path refs Index: insertDateAndTime.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/oneEditor/scriptlets/insertDateAndTime.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** insertDateAndTime.py 3 Oct 2004 23:58:01 -0000 1.1 --- insertDateAndTime.py 24 Oct 2004 22:48:12 -0000 1.2 *************** *** 2,4 **** now = time.localtime(time.time()) dateStr = time.strftime("%A, %B %d, %Y, %I:%M %p", now) ! comp.document.ReplaceSelection(dateStr) --- 2,4 ---- now = time.localtime(time.time()) dateStr = time.strftime("%A, %B %d, %Y, %I:%M %p", now) ! self.currentDocument.ReplaceSelection(dateStr) Index: insertDialog.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/oneEditor/scriptlets/insertDialog.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** insertDialog.py 3 Oct 2004 23:58:01 -0000 1.1 --- insertDialog.py 24 Oct 2004 22:48:12 -0000 1.2 *************** *** 83,86 **** # could get the current indent and insert the appropriate # number of spaces before each line of the template here ! comp.document.ReplaceSelection(dialogText) --- 83,86 ---- # could get the current indent and insert the appropriate # number of spaces before each line of the template here ! self.currentDocument.ReplaceSelection(dialogText) Index: unorderedList.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/oneEditor/scriptlets/unorderedList.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** unorderedList.py 3 Oct 2004 23:58:01 -0000 1.1 --- unorderedList.py 24 Oct 2004 22:48:12 -0000 1.2 *************** *** 1,7 **** # inserts "\t* " before each line in the selection ! text = bg.components.document.GetSelectedText() unorderedList = "" for i in text.splitlines(1): unorderedList += "\t* " + i ! bg.components.document.ReplaceSelection(unorderedList) --- 1,7 ---- # inserts "\t* " before each line in the selection ! text = self.currentDocument.GetSelectedText() unorderedList = "" for i in text.splitlines(1): unorderedList += "\t* " + i ! self.currentDocument.ReplaceSelection(unorderedList) Index: selectionWordCount.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/oneEditor/scriptlets/selectionWordCount.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** selectionWordCount.py 3 Oct 2004 23:58:01 -0000 1.1 --- selectionWordCount.py 24 Oct 2004 22:48:12 -0000 1.2 *************** *** 10,18 **** return chars, words, lines ! if bg.documentPath is None: filename = 'Untitled' else: ! filename = os.path.basename(bg.documentPath) ! text = util.normalizeEOL(bg.components.document.GetSelectedText()) ! dialog.MessageDialog(bg, "Document: %s\n" % filename + "%d chars, %d words, %d lines" % wordCount(text), 'Word Count', wx.ICON_INFORMATION | wx.OK) --- 10,18 ---- return chars, words, lines ! if self.currentPage.documentPath is None: filename = 'Untitled' else: ! filename = os.path.basename(self.currentPage.documentPath) ! text = util.normalizeEOL(self.currentDocument.GetSelectedText()) ! dialog.messageDialog(self, "Document: %s\n" % filename + "%d chars, %d words, %d lines" % wordCount(text), 'Word Count', wx.ICON_INFORMATION | wx.OK) Index: documentWordCount.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/oneEditor/scriptlets/documentWordCount.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** documentWordCount.py 3 Oct 2004 23:58:01 -0000 1.1 --- documentWordCount.py 24 Oct 2004 22:48:12 -0000 1.2 *************** *** 10,17 **** return chars, words, lines ! if bg.documentPath is None: filename = 'Untitled' else: ! filename = os.path.basename(bg.documentPath) ! dialog.MessageDialog(bg, "Document: %s\n" % filename + "%d chars, %d words, %d lines" % wordCount(util.normalizeEOL(bg.components.document.text)), 'Word Count', wx.ICON_INFORMATION | wx.OK) --- 10,17 ---- return chars, words, lines ! if self.currentPage.documentPath is None: filename = 'Untitled' else: ! filename = os.path.basename(self.currentPage.documentPath) ! dialog.messageDialog(self, "Document: %s\n" % filename + "%d chars, %d words, %d lines" % wordCount(util.normalizeEOL(self.currentDocument.text)), 'Word Count', wx.ICON_INFORMATION | wx.OK) |