Update of /cvsroot/pywin32/pywin32/com/win32comext/axdebug
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv824
Modified Files:
__init__.py adb.py codecontainer.py contexts.py debugger.py
documents.py dump.py expressions.py gateways.py stackframe.py
util.py
Log Message:
convert tabs to spaces via reindent.py
Index: expressions.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/expressions.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** expressions.py 18 Jun 2006 13:09:36 -0000 1.4
--- expressions.py 18 Jun 2006 13:18:26 -0000 1.5
***************
*** 10,156 ****
# Given an object, return a nice string
def MakeNiceString(ob):
! stream = cStringIO.StringIO()
! pprint(ob, stream)
! return string.strip(stream.getvalue())
class ProvideExpressionContexts(gateways.ProvideExpressionContexts):
! pass
class ExpressionContext(gateways.DebugExpressionContext):
! def __init__(self, frame):
! self.frame = frame
! def ParseLanguageText(self, code, radix, delim, flags):
! return _wrap(Expression(self.frame, code, radix, delim, flags), axdebug.IID_IDebugExpression)
! def GetLanguageInfo(self):
! # print "GetLanguageInfo"
! return "Python", "{DF630910-1C1D-11d0-AE36-8C0F5E000000}"
!
class Expression(gateways.DebugExpression):
! def __init__(self, frame, code, radix, delim, flags):
! self.callback = None
! self.frame = frame
! self.code = code
! self.radix = radix
! self.delim = delim
! self.flags = flags
! self.isComplete = 0
! self.result=None
! self.hresult = winerror.E_UNEXPECTED
! def Start(self, callback):
! try:
! try:
! try:
! self.result = eval(self.code, self.frame.f_globals, self.frame.f_locals)
! except SyntaxError:
! exec self.code in self.frame.f_globals, self.frame.f_locals
! self.result = ""
! self.hresult = 0
! except:
! l = traceback.format_exception_only(sys.exc_info()[0], sys.exc_info()[1])
! # l is a list of strings with trailing "\n"
! self.result = string.join(map(lambda s:s[:-1], l), "\n")
! self.hresult = winerror.E_FAIL
! finally:
! self.isComplete = 1
! callback.onComplete()
! def Abort(self):
! print "** ABORT **"
!
! def QueryIsComplete(self):
! return self.isComplete
!
! def GetResultAsString(self):
! # print "GetStrAsResult returning", self.result
! return self.hresult, MakeNiceString(self.result)
!
! def GetResultAsDebugProperty(self):
! result = _wrap(DebugProperty(self.code, self.result, None, self.hresult), axdebug.IID_IDebugProperty)
! return self.hresult, result
def MakeEnumDebugProperty(object, dwFieldSpec, nRadix, iid, stackFrame = None):
! name_vals = []
! if hasattr(object, "has_key"): # If it is a dict.
! name_vals = object.items()
! dictionary = object
! elif hasattr(object, "__dict__"): #object with dictionary, module
! name_vals = object.__dict__.items()
! dictionary = object.__dict__
! infos = []
! for name, val in name_vals:
! infos.append(GetPropertyInfo(name, val, dwFieldSpec, nRadix, 0, dictionary, stackFrame))
! return _wrap(EnumDebugPropertyInfo(infos), axdebug.IID_IEnumDebugPropertyInfo)
def GetPropertyInfo(obname, obvalue, dwFieldSpec, nRadix, hresult=0, dictionary = None, stackFrame = None):
! # returns a tuple
! name = typ = value = fullname = attrib = dbgprop = None
! if dwFieldSpec & axdebug.DBGPROP_INFO_VALUE:
! value = MakeNiceString(obvalue)
! if dwFieldSpec & axdebug.DBGPROP_INFO_NAME:
! name = obname
! if dwFieldSpec & axdebug.DBGPROP_INFO_TYPE:
! if hresult:
! typ = "Error"
! else:
! try:
! typ = type(obvalue).__name__
! except AttributeError:
! typ = str(type(obvalue))
! if dwFieldSpec & axdebug.DBGPROP_INFO_FULLNAME:
! fullname = obname
! if dwFieldSpec & axdebug.DBGPROP_INFO_ATTRIBUTES:
! if hasattr(obvalue, "has_key") or hasattr(obvalue, "__dict__"): # If it is a dict or object
! attrib = axdebug.DBGPROP_ATTRIB_VALUE_IS_EXPANDABLE
! else:
! attrib = 0
! if dwFieldSpec & axdebug.DBGPROP_INFO_DEBUGPROP:
! dbgprop = _wrap(DebugProperty(name, obvalue, None, hresult, dictionary, stackFrame), axdebug.IID_IDebugProperty)
! return name, typ, value, fullname, attrib, dbgprop
from win32com.server.util import ListEnumeratorGateway
class EnumDebugPropertyInfo(ListEnumeratorGateway):
! """A class to expose a Python sequence as an EnumDebugCodeContexts
! Create an instance of this class passing a sequence (list, tuple, or
! any sequence protocol supporting object) and it will automatically
! support the EnumDebugCodeContexts interface for the object.
! """
! _public_methods_ = ListEnumeratorGateway._public_methods_ + ["GetCount"]
! _com_interfaces_ = [ axdebug.IID_IEnumDebugPropertyInfo]
! def GetCount(self):
! return len(self._list_)
! def _wrap(self, ob):
! return ob
class DebugProperty:
! _com_interfaces_ = [axdebug.IID_IDebugProperty]
! _public_methods_ = ['GetPropertyInfo', 'GetExtendedInfo', 'SetValueAsString',
! 'EnumMembers', 'GetParent'
! ]
! def __init__(self, name, value, parent = None, hresult = 0, dictionary = None, stackFrame = None):
! self.name = name
! self.value = value
! self.parent = parent
! self.hresult = hresult
! self.dictionary = dictionary
! self.stackFrame = stackFrame
! def GetPropertyInfo(self, dwFieldSpec, nRadix):
! return GetPropertyInfo(self.name, self.value, dwFieldSpec, nRadix, self.hresult, dictionary, stackFrame)
! def GetExtendedInfo(self): ### Note - not in the framework.
! RaiseNotImpl("DebugProperty::GetExtendedInfo")
! def SetValueAsString(self, value, radix):
! if self.stackFrame and self.dictionary:
! self.dictionary[self.name]= eval(value,self.stackFrame.f_globals, self.stackFrame.f_locals)
! else:
! RaiseNotImpl("DebugProperty::SetValueAsString")
! def EnumMembers(self, dwFieldSpec, nRadix, iid):
! # Returns IEnumDebugPropertyInfo
! return MakeEnumDebugProperty(self.value, dwFieldSpec, nRadix, iid, self.stackFrame)
! def GetParent(self):
! # return IDebugProperty
! RaiseNotImpl("DebugProperty::GetParent")
--- 10,156 ----
# Given an object, return a nice string
def MakeNiceString(ob):
! stream = cStringIO.StringIO()
! pprint(ob, stream)
! return string.strip(stream.getvalue())
class ProvideExpressionContexts(gateways.ProvideExpressionContexts):
! pass
class ExpressionContext(gateways.DebugExpressionContext):
! def __init__(self, frame):
! self.frame = frame
! def ParseLanguageText(self, code, radix, delim, flags):
! return _wrap(Expression(self.frame, code, radix, delim, flags), axdebug.IID_IDebugExpression)
! def GetLanguageInfo(self):
! # print "GetLanguageInfo"
! return "Python", "{DF630910-1C1D-11d0-AE36-8C0F5E000000}"
!
class Expression(gateways.DebugExpression):
! def __init__(self, frame, code, radix, delim, flags):
! self.callback = None
! self.frame = frame
! self.code = code
! self.radix = radix
! self.delim = delim
! self.flags = flags
! self.isComplete = 0
! self.result=None
! self.hresult = winerror.E_UNEXPECTED
! def Start(self, callback):
! try:
! try:
! try:
! self.result = eval(self.code, self.frame.f_globals, self.frame.f_locals)
! except SyntaxError:
! exec self.code in self.frame.f_globals, self.frame.f_locals
! self.result = ""
! self.hresult = 0
! except:
! l = traceback.format_exception_only(sys.exc_info()[0], sys.exc_info()[1])
! # l is a list of strings with trailing "\n"
! self.result = string.join(map(lambda s:s[:-1], l), "\n")
! self.hresult = winerror.E_FAIL
! finally:
! self.isComplete = 1
! callback.onComplete()
! def Abort(self):
! print "** ABORT **"
!
! def QueryIsComplete(self):
! return self.isComplete
!
! def GetResultAsString(self):
! # print "GetStrAsResult returning", self.result
! return self.hresult, MakeNiceString(self.result)
!
! def GetResultAsDebugProperty(self):
! result = _wrap(DebugProperty(self.code, self.result, None, self.hresult), axdebug.IID_IDebugProperty)
! return self.hresult, result
def MakeEnumDebugProperty(object, dwFieldSpec, nRadix, iid, stackFrame = None):
! name_vals = []
! if hasattr(object, "has_key"): # If it is a dict.
! name_vals = object.items()
! dictionary = object
! elif hasattr(object, "__dict__"): #object with dictionary, module
! name_vals = object.__dict__.items()
! dictionary = object.__dict__
! infos = []
! for name, val in name_vals:
! infos.append(GetPropertyInfo(name, val, dwFieldSpec, nRadix, 0, dictionary, stackFrame))
! return _wrap(EnumDebugPropertyInfo(infos), axdebug.IID_IEnumDebugPropertyInfo)
def GetPropertyInfo(obname, obvalue, dwFieldSpec, nRadix, hresult=0, dictionary = None, stackFrame = None):
! # returns a tuple
! name = typ = value = fullname = attrib = dbgprop = None
! if dwFieldSpec & axdebug.DBGPROP_INFO_VALUE:
! value = MakeNiceString(obvalue)
! if dwFieldSpec & axdebug.DBGPROP_INFO_NAME:
! name = obname
! if dwFieldSpec & axdebug.DBGPROP_INFO_TYPE:
! if hresult:
! typ = "Error"
! else:
! try:
! typ = type(obvalue).__name__
! except AttributeError:
! typ = str(type(obvalue))
! if dwFieldSpec & axdebug.DBGPROP_INFO_FULLNAME:
! fullname = obname
! if dwFieldSpec & axdebug.DBGPROP_INFO_ATTRIBUTES:
! if hasattr(obvalue, "has_key") or hasattr(obvalue, "__dict__"): # If it is a dict or object
! attrib = axdebug.DBGPROP_ATTRIB_VALUE_IS_EXPANDABLE
! else:
! attrib = 0
! if dwFieldSpec & axdebug.DBGPROP_INFO_DEBUGPROP:
! dbgprop = _wrap(DebugProperty(name, obvalue, None, hresult, dictionary, stackFrame), axdebug.IID_IDebugProperty)
! return name, typ, value, fullname, attrib, dbgprop
from win32com.server.util import ListEnumeratorGateway
class EnumDebugPropertyInfo(ListEnumeratorGateway):
! """A class to expose a Python sequence as an EnumDebugCodeContexts
! Create an instance of this class passing a sequence (list, tuple, or
! any sequence protocol supporting object) and it will automatically
! support the EnumDebugCodeContexts interface for the object.
! """
! _public_methods_ = ListEnumeratorGateway._public_methods_ + ["GetCount"]
! _com_interfaces_ = [ axdebug.IID_IEnumDebugPropertyInfo]
! def GetCount(self):
! return len(self._list_)
! def _wrap(self, ob):
! return ob
class DebugProperty:
! _com_interfaces_ = [axdebug.IID_IDebugProperty]
! _public_methods_ = ['GetPropertyInfo', 'GetExtendedInfo', 'SetValueAsString',
! 'EnumMembers', 'GetParent'
! ]
! def __init__(self, name, value, parent = None, hresult = 0, dictionary = None, stackFrame = None):
! self.name = name
! self.value = value
! self.parent = parent
! self.hresult = hresult
! self.dictionary = dictionary
! self.stackFrame = stackFrame
! def GetPropertyInfo(self, dwFieldSpec, nRadix):
! return GetPropertyInfo(self.name, self.value, dwFieldSpec, nRadix, self.hresult, dictionary, stackFrame)
! def GetExtendedInfo(self): ### Note - not in the framework.
! RaiseNotImpl("DebugProperty::GetExtendedInfo")
! def SetValueAsString(self, value, radix):
! if self.stackFrame and self.dictionary:
! self.dictionary[self.name]= eval(value,self.stackFrame.f_globals, self.stackFrame.f_locals)
! else:
! RaiseNotImpl("DebugProperty::SetValueAsString")
! def EnumMembers(self, dwFieldSpec, nRadix, iid):
! # Returns IEnumDebugPropertyInfo
! return MakeEnumDebugProperty(self.value, dwFieldSpec, nRadix, iid, self.stackFrame)
! def GetParent(self):
! # return IDebugProperty
! RaiseNotImpl("DebugProperty::GetParent")
Index: gateways.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/gateways.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** gateways.py 6 Jan 2000 04:45:44 -0000 1.2
--- gateways.py 18 Jun 2006 13:18:26 -0000 1.3
***************
*** 11,453 ****
class EnumDebugCodeContexts(ListEnumeratorGateway):
! """A class to expose a Python sequence as an EnumDebugCodeContexts
! Create an instance of this class passing a sequence (list, tuple, or
! any sequence protocol supporting object) and it will automatically
! support the EnumDebugCodeContexts interface for the object.
! """
! _com_interfaces_ = [ axdebug.IID_IEnumDebugCodeContexts ]
class EnumDebugStackFrames(ListEnumeratorGateway):
! """A class to expose a Python sequence as an EnumDebugStackFrames
! Create an instance of this class passing a sequence (list, tuple, or
! any sequence protocol supporting object) and it will automatically
! support the EnumDebugStackFrames interface for the object.
! """
! _com_interfaces_ = [ axdebug.IID_IEnumDebugStackFrames ]
class EnumDebugApplicationNodes(ListEnumeratorGateway):
! """A class to expose a Python sequence as an EnumDebugStackFrames
! Create an instance of this class passing a sequence (list, tuple, or
! any sequence protocol supporting object) and it will automatically
! support the EnumDebugApplicationNodes interface for the object.
! """
! _com_interfaces_ = [ axdebug.IID_IEnumDebugApplicationNodes ]
class EnumRemoteDebugApplications(ListEnumeratorGateway):
! _com_interfaces_ = [ axdebug.IID_IEnumRemoteDebugApplications ]
class EnumRemoteDebugApplicationThreads(ListEnumeratorGateway):
! _com_interfaces_ = [ axdebug.IID_IEnumRemoteDebugApplicationThreads ]
class DebugDocumentInfo:
! _public_methods_ = ["GetName", "GetDocumentClassId"]
! _com_interfaces_ = [axdebug.IID_IDebugDocumentInfo]
! def __init__(self):
! pass
! def GetName(self, dnt):
! """ Get the one of the name of the document
! dnt -- int DOCUMENTNAMETYPE
! """
! RaiseNotImpl("GetName")
! def GetDocumentClassId(self):
! """
! Result must be an IID object (or string representing one).
! """
! RaiseNotImpl("GetDocumentClassId")
!
class DebugDocumentProvider(DebugDocumentInfo):
! _public_methods_ = DebugDocumentInfo._public_methods_ + ["GetDocument"]
! _com_interfaces_ = DebugDocumentInfo._com_interfaces_ + [axdebug.IID_IDebugDocumentProvider]
! def GetDocument(self):
! RaiseNotImpl("GetDocument")
class DebugApplicationNode(DebugDocumentProvider):
! """Provides the functionality of IDebugDocumentProvider, plus a context within a project tree.
! """
! _public_methods_ = string.split("""EnumChildren GetParent SetDocumentProvider
! Close Attach Detach""") + \
! DebugDocumentProvider._public_methods_
! _com_interfaces_ = [axdebug.IID_IDebugDocumentProvider] + \
! DebugDocumentProvider._com_interfaces_
! def __init__(self):
! DebugDocumentProvider.__init__(self)
! def EnumChildren(self):
! # Result is type PyIEnumDebugApplicationNodes
! RaiseNotImpl("EnumChildren")
! def GetParent(self):
! # result is type PyIDebugApplicationNode
! RaiseNotImpl("GetParent")
! def SetDocumentProvider(self, pddp): # PyIDebugDocumentProvider pddp
! # void result.
! RaiseNotImpl("SetDocumentProvider")
! def Close(self):
! # void result.
! RaiseNotImpl("Close")
! def Attach(self, parent): # PyIDebugApplicationNode
! # void result.
! RaiseNotImpl("Attach")
! def Detach(self):
! # void result.
! RaiseNotImpl("Detach")
class DebugApplicationNodeEvents:
! """Event interface for DebugApplicationNode object.
! """
! _public_methods_ = string.split("onAddChild onRemoveChild onDetach")
! _com_interfaces_ = [axdebug.IID_IDebugApplicationNodeEvents]
! def __init__(self):
! pass
! def onAddChild(self, child): # PyIDebugApplicationNode
! # void result.
! RaiseNotImpl("onAddChild")
! def onRemoveChild(self, child): # PyIDebugApplicationNode
! # void result.
! RaiseNotImpl("onRemoveChild")
! def onDetach(self):
! # void result.
! RaiseNotImpl("onDetach")
! def onAttach(self, parent): # PyIDebugApplicationNode
! # void result.
! RaiseNotImpl("onAttach")
class DebugDocument(DebugDocumentInfo):
! """The base interface to all debug documents.
! """
! _public_methods_ = DebugDocumentInfo._public_methods_
! _com_interfaces_ = [axdebug.IID_IDebugDocument] + DebugDocumentInfo._com_interfaces_
class DebugDocumentText(DebugDocument):
! """The interface to a text only debug document.
! """
! _com_interfaces_ = [axdebug.IID_IDebugDocumentText] + \
! DebugDocument._com_interfaces_
! _public_methods_ = ["GetDocumentAttributes", "GetSize",
! "GetPositionOfLine", "GetLineOfPosition", "GetText",
! "GetPositionOfContext", "GetContextOfPosition"] + \
! DebugDocument._public_methods_
! def __init__(self):
! pass
! # IDebugDocumentText
! def GetDocumentAttributes(self):
! # Result is int (TEXT_DOC_ATTR)
! RaiseNotImpl("GetDocumentAttributes")
! def GetSize(self):
! # Result is (numLines, numChars)
! RaiseNotImpl("GetSize")
! def GetPositionOfLine(self, cLineNumber):
! # Result is int char position
! RaiseNotImpl("GetPositionOfLine")
! def GetLineOfPosition(self, charPos):
! # Result is int, int (lineNo, offset)
! RaiseNotImpl("GetLineOfPosition")
! def GetText(self, charPos, maxChars, wantAttr):
! """Params
! charPos -- integer
! maxChars -- integer
! wantAttr -- Should the function compute attributes.
! Return value must be (string, attribtues). attributes may be
! None if(not wantAttr)
! """
! RaiseNotImpl("GetText")
! def GetPositionOfContext(self, debugDocumentContext):
! """Params
! debugDocumentContext -- a PyIDebugDocumentContext object.
!
! Return value must be (charPos, numChars)
! """
! RaiseNotImpl("GetPositionOfContext")
! def GetContextOfPosition(self, charPos, maxChars):
! """Params are integers.
! Return value must be PyIDebugDocumentContext object
! """
! print self
! RaiseNotImpl("GetContextOfPosition")
class DebugDocumentTextExternalAuthor:
! """Allow external editors to edit file-based debugger documents, and to notify the document when the source file has been changed.
! """
! _public_methods_ = ["GetPathName", "GetFileName", "NotifyChanged"]
! _com_interfaces_ = [axdebug.IID_IDebugDocumentTextExternalAuthor]
! def __init__(self):
! pass
! def GetPathName(self):
! """Return the full path (including file name) to the document's source file.
!
! Result must be (filename, fIsOriginal), where
! - if fIsOriginalPath is TRUE if the path refers to the original file for the document.
! - if fIsOriginalPath is FALSE if the path refers to a newly created temporary file.
! raise Exception(winerror.E_FAIL) if no source file can be created/determined.
! """
! RaiseNotImpl("GetPathName")
!
! def GetFileName(self):
! """Return just the name of the document, with no path information. (Used for "Save As...")
! Result is a string
! """
! RaiseNotImpl("GetFileName")
!
! def NotifyChanged(self):
! """ Notify the host that the document's source file has been saved and
! that its contents should be refreshed.
! """
! RaiseNotImpl("NotifyChanged")
class DebugDocumentTextEvents:
! _public_methods_ = string.split("""onDestroy onInsertText onRemoveText
! onReplaceText onUpdateTextAttributes onUpdateDocumentAttributes""")
! _com_interfaces_ = [ axdebug.IID_IDebugDocumentTextEvents ]
! def __init__(self):
! pass
! def onDestroy(self):
! # Result is void.
! RaiseNotImpl("onDestroy")
! def onInsertText(self, cCharacterPosition, cNumToInsert):
! # Result is void.
! RaiseNotImpl("onInsertText")
! def onRemoveText(self, cCharacterPosition, cNumToRemove):
! # Result is void.
! RaiseNotImpl("onRemoveText")
! def onReplaceText(self, cCharacterPosition, cNumToReplace):
! # Result is void.
! RaiseNotImpl("onReplaceText")
! def onUpdateTextAttributes(self, cCharacterPosition, cNumToUpdate):
! # Result is void.
! RaiseNotImpl("onUpdateTextAttributes")
! def onUpdateDocumentAttributes(self,textdocattr): # TEXT_DOC_ATTR
! # Result is void.
! RaiseNotImpl("onUpdateDocumentAttributes")
class DebugDocumentContext:
! _public_methods_ = [ 'GetDocument', 'EnumCodeContexts']
! _com_interfaces_ = [ axdebug.IID_IDebugDocumentContext ]
! def __init__(self):
! pass
! def GetDocument(self):
! """Return value must be a PyIDebugDocument object
! """
! RaiseNotImpl("GetDocument")
! def EnumCodeContexts(self):
! """Return value must be a PyIEnumDebugCodeContexts object
! """
! RaiseNotImpl("EnumCodeContexts")
class DebugCodeContext:
! _public_methods_ = [ 'GetDocumentContext', 'SetBreakPoint']
! _com_interfaces_ = [ axdebug.IID_IDebugCodeContext ]
! def __init__(self):
! pass
! def GetDocumentContext(self):
! """Return value must be a PyIDebugDocumentContext object
! """
! RaiseNotImpl("GetDocumentContext")
! def SetBreakPoint(self, bps):
! """bps -- an integer with flags.
! """
! RaiseNotImpl("SetBreakPoint")
class DebugStackFrame:
! """Abstraction representing a logical stack frame on the stack of a thread."""
! _public_methods_ = [ 'GetCodeContext', 'GetDescriptionString', 'GetLanguageString', 'GetThread', 'GetDebugProperty']
! _com_interfaces_ = [ axdebug.IID_IDebugStackFrame ]
! def __init__(self):
! pass
! def GetCodeContext(self):
! """Returns the current code context associated with the stack frame.
! Return value must be a IDebugCodeContext object
! """
! RaiseNotImpl("GetCodeContext")
! def GetDescriptionString(self, fLong):
! """Returns a textual description of the stack frame.
!
! fLong -- A flag indicating if the long name is requested.
! """
! RaiseNotImpl("GetDescriptionString")
! def GetLanguageString(self):
! """Returns a short or long textual description of the language.
!
! fLong -- A flag indicating if the long name is requested.
! """
! RaiseNotImpl("GetLanguageString")
! def GetThread(self):
! """ Returns the thread associated with this stack frame.
! Result must be a IDebugApplicationThread
! """
! RaiseNotImpl("GetThread")
! def GetDebugProperty(self):
! RaiseNotImpl("GetDebugProperty")
class DebugDocumentHost:
! """The interface from the IDebugDocumentHelper back to
! the smart host or language engine. This interface
! exposes host specific functionality such as syntax coloring.
! """
! _public_methods_ = [ 'GetDeferredText', 'GetScriptTextAttributes', 'OnCreateDocumentContext', 'GetPathName', 'GetFileName', 'NotifyChanged']
! _com_interfaces_ = [ axdebug.IID_IDebugDocumentHost ]
! def __init__(self):
! pass
! def GetDeferredText(self, dwTextStartCookie, maxChars, bWantAttr):
! RaiseNotImpl("GetDeferredText")
!
! def GetScriptTextAttributes(self, codeText, delimterText, flags):
! # Result must be an attribute sequence of same "length" as the code.
! RaiseNotImpl("GetScriptTextAttributes")
!
! def OnCreateDocumentContext(self):
! # Result must be a PyIUnknown
! RaiseNotImpl("OnCreateDocumentContext")
!
! def GetPathName(self):
! # Result must be (string, int) where the int is a BOOL
! # - TRUE if the path refers to the original file for the document.
! # - FALSE if the path refers to a newly created temporary file.
! # - raise Exception(scode=E_FAIL) if no source file can be created/determined.
! RaiseNotImpl("GetPathName")
!
! def GetFileName(self):
! # Result is a string with just the name of the document, no path information.
! RaiseNotImpl("GetFileName")
!
! def NotifyChanged(self):
! RaiseNotImpl("NotifyChanged")
# Additional gateway related functions.
class DebugDocumentTextConnectServer:
! _public_methods_ = win32com.server.connect.IConnectionPointContainer_methods + win32com.server.connect.IConnectionPoint_methods
! _com_interfaces_ = [pythoncom.IID_IConnectionPoint, pythoncom.IID_IConnectionPointContainer]
! # IConnectionPoint interfaces
! def __init__(self):
! self.cookieNo = -1
! self.connections = {}
! def EnumConnections(self):
! RaiseNotImpl("EnumConnections")
! def GetConnectionInterface(self):
! RaiseNotImpl("GetConnectionInterface")
! def GetConnectionPointContainer(self):
! return _wrap(self)
! def Advise(self, pUnk):
! # Creates a connection to the client. Simply allocate a new cookie,
! # find the clients interface, and store it in a dictionary.
! interface = pUnk.QueryInterface(axdebug.IID_IDebugDocumentTextEvents,1)
! self.cookieNo = self.cookieNo + 1
! self.connections[self.cookieNo] = interface
! return self.cookieNo
! def Unadvise(self, cookie):
! # Destroy a connection - simply delete interface from the map.
! try:
! del self.connections[cookie]
! except KeyError:
! return Exception(scode=winerror.E_UNEXPECTED)
! # IConnectionPointContainer interfaces
! def EnumConnectionPoints(self):
! RaiseNotImpl("EnumConnectionPoints")
! def FindConnectionPoint(self, iid):
! # Find a connection we support. Only support the single event interface.
! if iid==axdebug.IID_IDebugDocumentTextEvents:
! return _wrap(self)
! raise Exception(scode=winerror.E_NOINTERFACE) # ??
class RemoteDebugApplicationEvents:
! _public_methods_ = ["OnConnectDebugger","OnDisconnectDebugger","OnSetName","OnDebugOutput","OnClose","OnEnterBreakPoint","OnLeaveBreakPoint","OnCreateThread","OnDestroyThread","OnBreakFlagChange"]
! _com_interfaces_ = [axdebug.IID_IRemoteDebugApplicationEvents]
! def OnConnectDebugger(self, appDebugger):
! """appDebugger -- a PyIApplicationDebugger
! """
! RaiseNotImpl("OnConnectDebugger")
! def OnDisconnectDebugger(self):
! RaiseNotImpl("OnDisconnectDebugger")
! def OnSetName(self, name):
! RaiseNotImpl("OnSetName")
! def OnDebugOutput(self, string):
! RaiseNotImpl("OnDebugOutput")
! def OnClose(self):
! RaiseNotImpl("OnClose")
! def OnEnterBreakPoint(self, rdat):
! """rdat -- PyIRemoteDebugApplicationThread
! """
! RaiseNotImpl("OnEnterBreakPoint")
! def OnLeaveBreakPoint(self, rdat):
! """rdat -- PyIRemoteDebugApplicationThread
! """
! RaiseNotImpl("OnLeaveBreakPoint")
! def OnCreateThread(self, rdat):
! """rdat -- PyIRemoteDebugApplicationThread
! """
! RaiseNotImpl("OnCreateThread")
! def OnDestroyThread(self, rdat):
! """rdat -- PyIRemoteDebugApplicationThread
! """
! RaiseNotImpl("OnDestroyThread")
! def OnBreakFlagChange(self, abf, rdat):
! """abf -- int - one of the axdebug.APPBREAKFLAGS constants
! rdat -- PyIRemoteDebugApplicationThread
! RaiseNotImpl("OnBreakFlagChange")
! """
class DebugExpressionContext:
! _public_methods_ = ["ParseLanguageText", "GetLanguageInfo"]
! _com_interfaces_ = [axdebug.IID_IDebugExpressionContext]
! def __init__(self):
! pass
! def ParseLanguageText(self, code, radix, delim, flags):
! """
! result is IDebugExpression
! """
! RaiseNotImpl("ParseLanguageText")
! def GetLanguageInfo(self):
! """
! result is (string langName, iid langId)
! """
! RaiseNotImpl("GetLanguageInfo")
class DebugExpression:
! _public_methods_ = ["Start", "Abort", "QueryIsComplete", "GetResultAsString", "GetResultAsDebugProperty"]
! _com_interfaces_ = [axdebug.IID_IDebugExpression]
! def Start(self, callback):
! """
! callback -- an IDebugExpressionCallback
!
! result - void
! """
! RaiseNotImpl("Start")
! def Abort(self):
! """
! no params
! result -- void
! """
! RaiseNotImpl("Abort")
! def QueryIsComplete(self):
! """
! no params
! result -- void
! """
! RaiseNotImpl("QueryIsComplete")
! def GetResultAsString(self):
! RaiseNotImpl("GetResultAsString")
! def GetResultAsDebugProperty(self):
! RaiseNotImpl("GetResultAsDebugProperty")
class ProvideExpressionContexts:
! _public_methods_ = ["EnumExpressionContexts"]
! _com_interfaces_ = [axdebug.IID_IProvideExpressionContexts]
! def EnumExpressionContexts(self):
! RaiseNotImpl("EnumExpressionContexts")
!
--- 11,452 ----
class EnumDebugCodeContexts(ListEnumeratorGateway):
! """A class to expose a Python sequence as an EnumDebugCodeContexts
! Create an instance of this class passing a sequence (list, tuple, or
! any sequence protocol supporting object) and it will automatically
! support the EnumDebugCodeContexts interface for the object.
! """
! _com_interfaces_ = [ axdebug.IID_IEnumDebugCodeContexts ]
class EnumDebugStackFrames(ListEnumeratorGateway):
! """A class to expose a Python sequence as an EnumDebugStackFrames
! Create an instance of this class passing a sequence (list, tuple, or
! any sequence protocol supporting object) and it will automatically
! support the EnumDebugStackFrames interface for the object.
! """
! _com_interfaces_ = [ axdebug.IID_IEnumDebugStackFrames ]
class EnumDebugApplicationNodes(ListEnumeratorGateway):
! """A class to expose a Python sequence as an EnumDebugStackFrames
! Create an instance of this class passing a sequence (list, tuple, or
! any sequence protocol supporting object) and it will automatically
! support the EnumDebugApplicationNodes interface for the object.
! """
! _com_interfaces_ = [ axdebug.IID_IEnumDebugApplicationNodes ]
class EnumRemoteDebugApplications(ListEnumeratorGateway):
! _com_interfaces_ = [ axdebug.IID_IEnumRemoteDebugApplications ]
class EnumRemoteDebugApplicationThreads(ListEnumeratorGateway...
[truncated message content] |