VirtualBox

Changeset 21956 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Aug 4, 2009 1:37:40 PM (15 years ago)
Author:
vboxsync
Message:

Python: spaces cleanup, fixed typo in callback names

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/glue/vboxapi.py

    r21906 r21956  
    8282        'values_as_string': pre-processed values ready for 'print' statement
    8383        """
    84         # Get around the problem with input arrays returned in output 
     84        # Get around the problem with input arrays returned in output
    8585        # parameters (see #3953) for MSCOM.
    8686        if self.isMscom:
     
    108108
    109109def ComifyName(name):
    110     return name[0].capitalize()+name[1:]   
     110    return name[0].capitalize()+name[1:]
    111111
    112112_COMForward = { 'getattr' : None,
    113113                'setattr' : None}
    114          
     114
    115115def CustomGetAttr(self, attr):
    116116    # fastpath
     
    197197    VBOX_TLB_MAJOR = 1
    198198    VBOX_TLB_MINOR = 0
    199    
     199
    200200    def __init__(self, params):
    201201            from win32com import universal
     
    214214            self.handles.append(handle)
    215215            _COMForward['getattr'] = DispatchBaseClass.__dict__['__getattr__']
    216             DispatchBaseClass.__dict__['__getattr__'] = CustomGetAttr           
     216            DispatchBaseClass.__dict__['__getattr__'] = CustomGetAttr
    217217            _COMForward['setattr'] = DispatchBaseClass.__dict__['__setattr__']
    218             DispatchBaseClass.__dict__['__setattr__'] = CustomSetAttr           
     218            DispatchBaseClass.__dict__['__setattr__'] = CustomSetAttr
    219219            win32com.client.gencache.EnsureDispatch('VirtualBox.Session')
    220220            win32com.client.gencache.EnsureDispatch('VirtualBox.VirtualBox')
     
    257257        str = ""
    258258        str += "import win32com.server.util\n"
    259         #str += "import win32com.server.register\n"
    260         #str += "from win32com import universal\n"
    261259        str += "import pythoncom\n"
    262         #str += "universal.RegisterInterfaces(tlb_guid, 0, 1, 0, ['"+iface+"'])\n"
    263260
    264261        str += "class "+iface+"Impl(BaseClass):\n"
     
    266263        str += "   _typelib_guid_ = tlb_guid\n"
    267264        str += "   _typelib_version_ = 1, 0\n"
    268         #str += "   _reg_clsctx_ = pythoncom.CLSCTX_LOCAL_SERVER\n"
    269         #str += "   _reg_clsid_ = '{F21202A2-959A-4149-B1C3-68B9013F3335}'\n"
    270         #str += "   _reg_progid_ = 'VirtualBox."+iface+"Impl'\n"
    271         #str += "   _reg_desc_ = 'Generated callback implementation class'\n"
    272         #str += "   _reg_policy_spec_ = 'win32com.server.policy.EventHandlerPolicy'\n"
    273265
    274266        # generate capitalized version of callbacks - that's how Python COM
    275267        # looks them up on Windows
    276268        for m in dir(impl):
    277            if m.startswith("on"):     
     269           if m.startswith("on"):
    278270             str += "   "+ComifyName(m)+"=BaseClass."+m+"\n"
    279271
    280272        str += "   def __init__(self): BaseClass.__init__(self, arg)\n"
    281         #str += "win32com.server.register.UseCommandLine("+iface+"Impl)\n"
    282 
    283273        str += "result = win32com.server.util.wrap("+iface+"Impl())\n"
    284274        exec (str,d,d)
     
    388378            self.password = ""
    389379            self.url = None
    390         self.vbox = None       
    391 
    392     def getSessionObject(self, vbox):       
     380        self.vbox = None
     381
     382    def getSessionObject(self, vbox):
    393383        return self.wsmgr.getSessionObject(vbox)
    394384
     
    466456            else:
    467457                style = "XPCOM"
    468        
     458
    469459        exec "self.platform = Platform"+style+"(platparams)"
    470            
     460
    471461        self.constants = VirtualBoxReflectionInfo()
    472462        self.type = self.platform.getType()
    473463        self.remote = self.platform.getRemote()
    474         self.style = style 
     464        self.style = style
    475465        self.mgr = SessionManager(self)
    476        
     466
    477467        try:
    478468            self.vbox = self.platform.getVirtualBox()
     
    527517
    528518    def getPerfCollector(self, vbox):
    529         return PerfCollector(self, vbox)       
     519        return PerfCollector(self, vbox)
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