From: Mark H. <mha...@us...> - 2007-05-06 12:03:51
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/axscript/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7246 Modified Files: error.py framework.py pyscript.py Log Message: die, string module, die Index: pyscript.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/client/pyscript.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** pyscript.py 30 Jan 2007 22:35:57 -0000 1.10 --- pyscript.py 6 May 2007 12:03:51 -0000 1.11 *************** *** 16,20 **** import win32com.server.register import sys - import string import traceback import scriptdispatch --- 16,19 ---- *************** *** 37,41 **** def AddCR(text): return re.sub('\n','\r\n',text) - # return string.join(string.split(text,'\n'),'\r\n') class AXScriptCodeBlock(framework.AXScriptCodeBlock): --- 36,39 ---- *************** *** 103,107 **** def _DoFindAttribute_(self, obj, attr): try: ! return obj.subItems[string.lower(attr)].attributeObject except KeyError: pass --- 101,105 ---- def _DoFindAttribute_(self, obj, attr): try: ! return obj.subItems[attr.lower()].attributeObject except KeyError: pass *************** *** 138,142 **** # If a known subitem, return it. try: ! return self._scriptItem_.subItems[string.lower(attr)].attributeObject except KeyError: # Otherwise see if the dispatch can give it to us --- 136,140 ---- # If a known subitem, return it. try: ! return self._scriptItem_.subItems[attr.lower()].attributeObject except KeyError: # Otherwise see if the dispatch can give it to us *************** *** 147,151 **** # XXX - todo - if a known item, then should call its default # dispatch method. ! attr=string.lower(attr) if self._scriptItem_.dispatchContainer: try: --- 145,149 ---- # XXX - todo - if a known item, then should call its default # dispatch method. ! attr=attr.lower() if self._scriptItem_.dispatchContainer: try: *************** *** 309,313 **** def MakeEventMethodName(self, subItemName, eventName): ! return string.upper(subItemName[0])+subItemName[1:] + "_" + string.upper(eventName[0])+eventName[1:] def DoAddScriptlet(self, defaultName, code, itemName, subItemName, eventName, delimiter,sourceContextCookie, startLineNumber): --- 307,311 ---- def MakeEventMethodName(self, subItemName, eventName): ! return subItemName[0].upper()+subItemName[1:] + "_" + eventName[0].upper()+eventName[1:] def DoAddScriptlet(self, defaultName, code, itemName, subItemName, eventName, delimiter,sourceContextCookie, startLineNumber): *************** *** 337,341 **** if codeBlock is not None: realCode = "def %s():\n" % funcName ! for line in string.split(framework.RemoveCR(codeBlock.codeText),"\n"): realCode = realCode + '\t' + line + '\n' realCode = realCode + '\n' --- 335,339 ---- if codeBlock is not None: realCode = "def %s():\n" % funcName ! for line in framework.RemoveCR(codeBlock.codeText).split("\n"): realCode = realCode + '\t' + line + '\n' realCode = realCode + '\n' *************** *** 353,359 **** except KeyError: # Not there _exactly_ - do case ins search. ! funcNameLook = string.lower(funcName) for attr in self.globalNameSpaceModule.__dict__.keys(): ! if funcNameLook==string.lower(attr): function = self.globalNameSpaceModule.__dict__[attr] # cache back in scriptlets, to avoid this overhead next time --- 351,357 ---- except KeyError: # Not there _exactly_ - do case ins search. ! funcNameLook = funcName.lower() for attr in self.globalNameSpaceModule.__dict__.keys(): ! if funcNameLook==attr.lower(): function = self.globalNameSpaceModule.__dict__[attr] # cache back in scriptlets, to avoid this overhead next time Index: error.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/client/error.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** error.py 17 Oct 2006 03:09:07 -0000 1.7 --- error.py 6 May 2007 12:03:51 -0000 1.8 *************** *** 6,10 **** """ ! import sys, string, traceback from win32com.axscript import axscript import winerror --- 6,10 ---- """ ! import sys, traceback from win32com.axscript import axscript import winerror *************** *** 27,31 **** def AddCR(text): return re.sub('\n','\r\n',text) - # return string.join(string.split(text,'\n'),'\r\n') class IActiveScriptError: --- 27,30 ---- *************** *** 113,117 **** self.lineno = lineno self.colno = offset - 1 ! self.linetext = ExpandTabs(string.rstrip(line)) def _BuildFromOther(self, site, type, value, tb): --- 112,116 ---- self.lineno = lineno self.colno = offset - 1 ! self.linetext = ExpandTabs(line.rstrip()) def _BuildFromOther(self, site, type, value, tb): *************** *** 120,124 **** if debugging: # Full traceback if debugging. list=traceback.format_exception(type, value, tb) ! self.description = ExpandTabs(string.join(list,"")) print "Script Traceback is", self.description return --- 119,123 ---- if debugging: # Full traceback if debugging. list=traceback.format_exception(type, value, tb) ! self.description = ExpandTabs(''.join(list)) print "Script Traceback is", self.description return *************** *** 166,170 **** list = list + traceback.format_exception_only(type, value) # list=traceback.format_exception(type, value, tb_top, depth) ! self.description = ExpandTabs(string.join(list,"")) # Clear tracebacks etc. tb = tb_top = tb_look = None --- 165,169 ---- list = list + traceback.format_exception_only(type, value) # list=traceback.format_exception(type, value, tb_top, depth) ! self.description = ExpandTabs(''.join(list)) # Clear tracebacks etc. tb = tb_top = tb_look = None *************** *** 187,191 **** line = codeBlock.GetLineNo(lineno) if line: ! line = string.strip(line) else: line = None --- 186,190 ---- line = codeBlock.GetLineNo(lineno) if line: ! line = line.strip() else: line = None Index: framework.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/client/framework.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** framework.py 6 May 2007 11:39:24 -0000 1.23 --- framework.py 6 May 2007 12:03:51 -0000 1.24 *************** *** 7,11 **** There are classes defined for the engine itself, and for ScriptItems """ ! import sys, string from win32com.axscript import axscript import win32com.server.util --- 7,11 ---- There are classes defined for the engine itself, and for ScriptItems """ ! import sys from win32com.axscript import axscript import win32com.server.util *************** *** 122,131 **** pos = -1 for i in range(no-1): ! pos = string.find(self.codeText, '\n', pos+1) if pos==-1: pos=len(self.codeText) ! epos = string.find(self.codeText, '\n', pos+1) if epos==-1: epos=len(self.codeText) ! return string.strip(self.codeText[pos+1:epos]) class Event: --- 122,131 ---- pos = -1 for i in range(no-1): ! pos = self.codeText.find('\n', pos+1) if pos==-1: pos=len(self.codeText) ! epos = self.codeText.find('\n', pos+1) if epos==-1: epos=len(self.codeText) ! return self.codeText[pos+1:epos].strip() class Event: *************** *** 338,345 **** def GetSubItem(self, name): ! return self.subItems[string.lower(name)] def GetCreateSubItem(self, parentItem, name, dispatch, flags): ! keyName = string.lower(name) try: rc = self.subItems[keyName] --- 338,345 ---- def GetSubItem(self, name): ! return self.subItems[name.lower()] def GetCreateSubItem(self, parentItem, name, dispatch, flags): ! keyName = name.lower() try: rc = self.subItems[keyName] |