Exemplo n.º 1
0
 def OnViewCreated(self, view):
     print("OnViewCreated", view)
     # And if our demo view has been registered, it may well
     # be that view!
     try:
         pyview = unwrap(view)
         print("and look - its a Python implemented view!", pyview)
     except ValueError:
         pass
Exemplo n.º 2
0
def _dump_wrapped():
    from win32com.server.util import unwrap
    print "Wrapped items:"
    for key, items in all_wrapped.iteritems():
        print key,
        try:
            ob = unwrap(key)
            print ob, sys.getrefcount(ob)
        except:
            print "<error>"
Exemplo n.º 3
0
def _dump_wrapped():
    from win32com.server.util import unwrap
    print("Wrapped items:")
    for key, items in all_wrapped.items():
        print(key, end=' ')
        try:
            ob = unwrap(key)
            print(ob, sys.getrefcount(ob))
        except:
            print("<error>")
Exemplo n.º 4
0
Arquivo: util.py Projeto: 89sos98/main
def _dump_wrapped():
    from win32com.server.util import unwrap
    print "Wrapped items:"
    for key, items in all_wrapped.iteritems():
        print key,
        try:
            ob = unwrap(key)
            print ob, sys.getrefcount(ob)
        except:
            print "<error>"
Exemplo n.º 5
0
def _dump_wrapped():
    from win32com.server.util import unwrap
    print("Wrapped items:")
    for key, items in all_wrapped.items():
        print(key, end=' ')
        try:
            ob = unwrap(key)
            print(ob, sys.getrefcount(ob))
        except:
            print("<error>")
Exemplo n.º 6
0
    def KissChild(self, child):
        print "KissChild called with child", child
        # Our child is a PyIDispatch object, so we will attempt
        # to use it as such.  To make it into something useful,
        # we must convert it to a win32com.client.Dispatch object.
        dispatch = win32com.client.Dispatch(child)
        print "KissChild called with child named", dispatch.Name

        # Now, assuming it is a Python child object, lets
        # unwrap it to get the object back!
        child = unwrap(child)
        print "The Python child is", child
Exemplo n.º 7
0
def unwrap_complex_type(param, param_type):
    param = util.unwrap(param)
    for membername, membertype in param_type.soap_members.items():
        member = getattr(param, membername)
        if type(member).__name__ == 'PyIDispatch':
            member = unwrap_complex_type(member, membertype)
        elif membertype is DateTime:
            member = coerce_date_time(member)
        elif type(member) in [types.ListType, types.TupleType]:
            newmember = []
            for item in member:
                if type(item).__name__ == 'PyIDispatch':
                    item = unwrap_complex_type(item, membertype.serializer)
                newmember.append(item)
            member = newmember
        setattr(param, membername, member)
    return param
Exemplo n.º 8
0
def unwrap_complex_type(param, param_type):
    param = util.unwrap(param)
    for membername, membertype in param_type.soap_members.items():
        member = getattr(param, membername)
        if type(member).__name__ == "PyIDispatch":
            member = unwrap_complex_type(member, membertype)
        elif membertype is DateTime:
            member = coerce_date_time(member)
        elif type(member) in [types.ListType, types.TupleType]:
            newmember = []
            for item in member:
                if type(item).__name__ == "PyIDispatch":
                    item = unwrap_complex_type(item, membertype.serializer)
                newmember.append(item)
            member = newmember
        setattr(param, membername, member)
    return param
Exemplo n.º 9
0
 def getPage(self, site, title):
     os.chdir(pywikipediaDir)
     siteObj = unwrap(site)
     page = WikiPage(siteObj, title)
     return wrap(page)
Exemplo n.º 10
0
 def GetPositionOfContext(self, context):
     trace("GetPositionOfContext", context)
     context = unwrap(context)
     return context.offset, context.length
Exemplo n.º 11
0
 def GetPositionOfContext(self, context):
     trace("GetPositionOfContext", context)
     context = unwrap(context)
     return context.offset, context.length
Exemplo n.º 12
0
 def getPage(self, site, title):
     os.chdir(pywikipediaDir)
     siteObj = unwrap(site)
     page = WikiPage(siteObj, title)
     return wrap(page)