本文整理汇总了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