contexts.py :  » Windows » pyExcelerator » pywin32-214 » com » win32comext » axdebug » Python Open Source

Home
Python Open Source
1.3.1.2 Python
2.Ajax
3.Aspect Oriented
4.Blog
5.Build
6.Business Application
7.Chart Report
8.Content Management Systems
9.Cryptographic
10.Database
11.Development
12.Editor
13.Email
14.ERP
15.Game 2D 3D
16.GIS
17.GUI
18.IDE
19.Installer
20.IRC
21.Issue Tracker
22.Language Interface
23.Log
24.Math
25.Media Sound Audio
26.Mobile
27.Network
28.Parser
29.PDF
30.Project Management
31.RSS
32.Search
33.Security
34.Template Engines
35.Test
36.UML
37.USB Serial
38.Web Frameworks
39.Web Server
40.Web Services
41.Web Unit
42.Wiki
43.Windows
44.XML
Python Open Source » Windows » pyExcelerator 
pyExcelerator » pywin32 214 » com » win32comext » axdebug » contexts.py
""" A module for managing the AXDebug I*Contexts

"""
import gateways, axdebug
import pythoncom, win32com.server.util

# Utility function for wrapping object created by this module.
from util import _wrap,_wrap_remove,trace
import adb

class DebugCodeContext(gateways.DebugCodeContext, gateways.DebugDocumentContext):
    # NOTE: We also implement the IDebugDocumentContext interface for Simple Hosts.
    # Thus, debugDocument may be NULL when we have smart hosts - but in that case, we
    # wont be called upon to provide it.
    _public_methods_ = gateways.DebugCodeContext._public_methods_ + \
                       gateways.DebugDocumentContext._public_methods_
    _com_interfaces_ = gateways.DebugCodeContext._com_interfaces_ + \
                       gateways.DebugDocumentContext._com_interfaces_

    def __init__(self, lineNo, charPos, len, codeContainer, debugSite):
        self.debugSite = debugSite
        self.offset = charPos
        self.length = len
        self.breakPointState = 0
        self.lineno = lineNo
        gateways.DebugCodeContext.__init__(self)
        self.codeContainer = codeContainer

    def _Close(self):
        self.debugSite = None

    def GetDocumentContext(self):
        if self.debugSite is not None:
            # We have a smart host - let him give it to us.
            return self.debugSite.GetDocumentContextFromPosition(
                    self.codeContainer.sourceContext,
                    self.offset,
                    self.length)
        else:
            # Simple host - Fine - Ill do it myself!
            return _wrap(self, axdebug.IID_IDebugDocumentContext)

    def SetBreakPoint(self, bps):
        self.breakPointState = bps
        adb.OnSetBreakPoint(self, bps, self.lineno)

    # The DebugDocumentContext methods for simple hosts.
    def GetDocument(self):
        return self.codeContainer.debugDocument

    def EnumCodeContexts(self):
        return _wrap(EnumDebugCodeContexts([self]), axdebug.IID_IEnumDebugCodeContexts)

class EnumDebugCodeContexts(gateways.EnumDebugCodeContexts):
    def _wrap(self, obj):
        return _wrap(obj, axdebug.IID_IDebugCodeContext)
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.