Changeset 21956 in vbox for trunk/src/VBox/Main
- Timestamp:
- Aug 4, 2009 1:37:40 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/glue/vboxapi.py
r21906 r21956 82 82 'values_as_string': pre-processed values ready for 'print' statement 83 83 """ 84 # Get around the problem with input arrays returned in output 84 # Get around the problem with input arrays returned in output 85 85 # parameters (see #3953) for MSCOM. 86 86 if self.isMscom: … … 108 108 109 109 def ComifyName(name): 110 return name[0].capitalize()+name[1:] 110 return name[0].capitalize()+name[1:] 111 111 112 112 _COMForward = { 'getattr' : None, 113 113 'setattr' : None} 114 114 115 115 def CustomGetAttr(self, attr): 116 116 # fastpath … … 197 197 VBOX_TLB_MAJOR = 1 198 198 VBOX_TLB_MINOR = 0 199 199 200 200 def __init__(self, params): 201 201 from win32com import universal … … 214 214 self.handles.append(handle) 215 215 _COMForward['getattr'] = DispatchBaseClass.__dict__['__getattr__'] 216 DispatchBaseClass.__dict__['__getattr__'] = CustomGetAttr 216 DispatchBaseClass.__dict__['__getattr__'] = CustomGetAttr 217 217 _COMForward['setattr'] = DispatchBaseClass.__dict__['__setattr__'] 218 DispatchBaseClass.__dict__['__setattr__'] = CustomSetAttr 218 DispatchBaseClass.__dict__['__setattr__'] = CustomSetAttr 219 219 win32com.client.gencache.EnsureDispatch('VirtualBox.Session') 220 220 win32com.client.gencache.EnsureDispatch('VirtualBox.VirtualBox') … … 257 257 str = "" 258 258 str += "import win32com.server.util\n" 259 #str += "import win32com.server.register\n"260 #str += "from win32com import universal\n"261 259 str += "import pythoncom\n" 262 #str += "universal.RegisterInterfaces(tlb_guid, 0, 1, 0, ['"+iface+"'])\n"263 260 264 261 str += "class "+iface+"Impl(BaseClass):\n" … … 266 263 str += " _typelib_guid_ = tlb_guid\n" 267 264 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"273 265 274 266 # generate capitalized version of callbacks - that's how Python COM 275 267 # looks them up on Windows 276 268 for m in dir(impl): 277 if m.startswith("on"): 269 if m.startswith("on"): 278 270 str += " "+ComifyName(m)+"=BaseClass."+m+"\n" 279 271 280 272 str += " def __init__(self): BaseClass.__init__(self, arg)\n" 281 #str += "win32com.server.register.UseCommandLine("+iface+"Impl)\n"282 283 273 str += "result = win32com.server.util.wrap("+iface+"Impl())\n" 284 274 exec (str,d,d) … … 388 378 self.password = "" 389 379 self.url = None 390 self.vbox = None 391 392 def getSessionObject(self, vbox): 380 self.vbox = None 381 382 def getSessionObject(self, vbox): 393 383 return self.wsmgr.getSessionObject(vbox) 394 384 … … 466 456 else: 467 457 style = "XPCOM" 468 458 469 459 exec "self.platform = Platform"+style+"(platparams)" 470 460 471 461 self.constants = VirtualBoxReflectionInfo() 472 462 self.type = self.platform.getType() 473 463 self.remote = self.platform.getRemote() 474 self.style = style 464 self.style = style 475 465 self.mgr = SessionManager(self) 476 466 477 467 try: 478 468 self.vbox = self.platform.getVirtualBox() … … 527 517 528 518 def getPerfCollector(self, vbox): 529 return PerfCollector(self, vbox) 519 return PerfCollector(self, vbox)
Note:
See TracChangeset
for help on using the changeset viewer.