VirtualBox

Changeset 20818 in vbox


Ignore:
Timestamp:
Jun 23, 2009 12:06:23 PM (15 years ago)
Author:
vboxsync
Message:

Python: generate capitalized version of callbacks on Windows, now Win32 callbacks work just fine

Location:
trunk/src/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxShell/vboxshell.py

    r20694 r20818  
    196196        print "onGuestPropertyChange: %s" %(id)
    197197   
    198 
    199198
    200199g_hasreadline = 1
     
    373372            ctx['global'].waitForEvents(500)
    374373    # We need to catch all exceptions here, otherwise callback will never be unregistered
    375     except Exception,e:
    376         print e
     374    except:
    377375        if g_verbose:
    378376                traceback.print_exc()
    379         pass   
    380377    vbox.unregisterCallback(cb)
    381378
  • trunk/src/VBox/Main/glue/vboxapi.py

    r20807 r20818  
    165165        #str += "   _reg_desc_ = 'Generated callback implementation class'\n"
    166166        #str += "   _reg_policy_spec_ = 'win32com.server.policy.EventHandlerPolicy'\n"
     167
     168        # generate capitalized version of callbacks - that's how Python COM
     169        # looks them up on Windows
     170        for m in dir(impl):
     171           if m.startswith("on"):     
     172             str += "   "+m[0].capitalize()+m[1:]+"=BaseClass."+m+"\n"
    167173
    168174        str += "   def __init__(self): BaseClass.__init__(self, arg)\n"
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette