当前位置: 首页>>代码示例>>Python>>正文


Python objc.super方法代码示例

本文整理汇总了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 
开发者ID:jssimporter,项目名称:python-jss,代码行数:23,代码来源:nsurlsession_adapter.py

示例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 
开发者ID:jssimporter,项目名称:python-jss,代码行数:23,代码来源:nsurlsession_adapter.py

示例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 
开发者ID:EDCD,项目名称:EDMarketConnector,代码行数:6,代码来源:protocol.py

示例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 
开发者ID:hbldh,项目名称:bleak,代码行数:30,代码来源:CentralManagerDelegate.py

示例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 
开发者ID:hbldh,项目名称:bleak,代码行数:31,代码来源:PeripheralDelegate.py

示例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 
开发者ID:macadmins,项目名称:installapplications,代码行数:42,代码来源:gurl.py


注:本文中的objc.super方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。