本文整理匯總了Python中objc.super方法的典型用法代碼示例。如果您正苦於以下問題:Python objc.super方法的具體用法?Python objc.super怎麽用?Python objc.super使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類objc
的用法示例。
在下文中一共展示了objc.super方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: initWithAdapter_
# 需要導入模塊: import objc [as 別名]
# 或者: from objc import super [as 別名]
def initWithAdapter_(self, adapter):
self = objc.super(NSURLSessionAdapterDelegate, self).init()
if self is None:
return None
self.adapter = adapter
self.bytesReceived = 0
self.expectedLength = -1
self.percentComplete = 0
self.done = False
self.error = None
self.SSLError = None
self.output = NSMutableData.dataWithCapacity_(1024)
self.status = None
self.headers = {}
self.verify = True
self.credential = None
self.history = []
return self
示例2: __init__
# 需要導入模塊: import objc [as 別名]
# 或者: from objc import super [as 別名]
def __init__(self, credential=None, force_basic=False):
# type: (Optional[NSURLCredential], bool) -> None
"""NSURLSessionAdapter implements a requests adapter using PyObjC + NSURLSession.
Because of the way the delegate deals with authentication, we cannot support requests style auth which may only
act on the content of the request. For NSURLSessionAdapter you should use NSURLCredentialAuth, which supplies an
NSURLCredential object whenever authentication is required by the remote host.
:param credential: NSURLCredential that will be used if the server requests basic auth.
:param force_basic: Force basic authentication to be used for every request by preparing the Authorization
header. This is sometimes required because NSURLSession only checks with the delegate for credentials when
the server sends a "challenge". Some web services never even send a challenge.
"""
super(NSURLSessionAdapter, self).__init__()
self.verify = True
self.credential = credential
self.force_basic = force_basic
self.configuration = None
self.delegate = None
self.session = None
示例3: init
# 需要導入模塊: import objc [as 別名]
# 或者: from objc import super [as 別名]
def init(self):
self = objc.super(EventHandler, self).init()
NSAppleEventManager.sharedAppleEventManager().setEventHandler_andSelector_forEventClass_andEventID_(self, 'handleEvent:withReplyEvent:', kInternetEventClass, kAEGetURL)
return self
示例4: init
# 需要導入模塊: import objc [as 別名]
# 或者: from objc import super [as 別名]
def init(self):
"""macOS init function for NSObject"""
self = objc.super(CentralManagerDelegate, self).init()
if self is None:
return None
self.event_loop = asyncio.get_event_loop()
self.connected_peripheral_delegate = None
self.connected_peripheral = None
self._connection_state = CMDConnectionState.DISCONNECTED
self.powered_on_event = asyncio.Event()
self.devices = {}
self.callbacks = {}
self.disconnected_callback = None
if not self.compliant():
logger.warning("CentralManagerDelegate is not compliant")
self.central_manager = CBCentralManager.alloc().initWithDelegate_queue_(
self, dispatch_queue_create(b"bleak.corebluetooth", DISPATCH_QUEUE_SERIAL)
)
return self
# User defined functions
示例5: initWithPeripheral_
# 需要導入模塊: import objc [as 別名]
# 或者: from objc import super [as 別名]
def initWithPeripheral_(self, peripheral: CBPeripheral):
"""macOS init function for NSObject"""
self = objc.super(PeripheralDelegate, self).init()
if self is None:
return None
self.peripheral = peripheral
self.peripheral.setDelegate_(self)
self._event_loop = asyncio.get_event_loop()
self._services_discovered_event = asyncio.Event()
self._service_characteristic_discovered_events = _EventDict()
self._characteristic_descriptor_discover_events = _EventDict()
self._characteristic_read_events = _EventDict()
self._characteristic_write_events = _EventDict()
self._descriptor_read_events = _EventDict()
self._descriptor_write_events = _EventDict()
self._characteristic_notify_change_events = _EventDict()
self._characteristic_notify_callbacks = {}
if not self.compliant():
logger.warning("PeripheralDelegate is not compliant")
return self
示例6: initWithOptions_
# 需要導入模塊: import objc [as 別名]
# 或者: from objc import super [as 別名]
def initWithOptions_(self, options):
'''Set up our Gurl object'''
self = super(Gurl, self).init()
if not self:
return None
self.follow_redirects = options.get('follow_redirects', False)
self.ignore_system_proxy = options.get('ignore_system_proxy', False)
self.destination_path = options.get('file')
self.can_resume = options.get('can_resume', False)
self.url = options.get('url')
self.additional_headers = options.get('additional_headers', {})
self.username = options.get('username')
self.password = options.get('password')
self.download_only_if_changed = options.get(
'download_only_if_changed', False)
self.cache_data = options.get('cache_data')
self.connection_timeout = options.get('connection_timeout', 60)
if NSURLSESSION_AVAILABLE:
self.minimum_tls_protocol = options.get(
'minimum_tls_protocol', kTLSProtocol1)
self.log = options.get('logging_function', NSLogWrapper)
self.resume = False
self.response = None
self.headers = None
self.status = None
self.error = None
self.SSLerror = None
self.done = False
self.redirection = []
self.destination = None
self.bytesReceived = 0
self.expectedLength = -1
self.percentComplete = 0
self.connection = None
self.session = None
self.task = None
return self