예제 #1
0
	def __init__(self, provider, handle = None):
		if handle is None:
			self._cb = core.BNDownloadInstanceCallbacks()
			self._cb.context = 0
			self._cb.destroyInstance = self._cb.destroyInstance.__class__(self._destroy_instance)
			self._cb.performRequest = self._cb.performRequest.__class__(self._perform_request)
			self.handle = core.BNInitDownloadInstance(provider.handle, self._cb)
			self.__class__._registered_instances.append(self)
		else:
			self.handle = core.handle_of_type(handle, core.BNDownloadInstance)
		self._must_free = handle is not None
예제 #2
0
 def __init__(self, provider, handle=None):
     if handle is None:
         self._cb = core.BNDownloadInstanceCallbacks()
         self._cb.context = 0
         self._cb.destroyInstance = self._cb.destroyInstance.__class__(
             self._destroy_instance)
         self._cb.performRequest = self._cb.performRequest.__class__(
             self._perform_request)
         self.handle = core.BNInitDownloadInstance(provider.handle,
                                                   self._cb)
     else:
         self.handle = core.handle_of_type(handle, core.BNDownloadInstance)
     self._outputCallbacks = None