Exemplo n.º 1
0
This module does not contain docstrings for the wrapped code, check Apple's
documentation for details on how to use these functions and classes.
'''
import sys
import objc
import CoreFoundation

from Foundation import _metadata
from Foundation._inlines import _inline_list_

objc.addConvenienceForClass('NSAttributedString',
                            (('__len__', lambda self: self.length()), ))

# XXX
objc.addConvenienceForBasicMapping('NSMergeConflict', True)
objc.addConvenienceForBasicMapping('NSUbiquitousKeyValueStore', False)
objc.addConvenienceForBasicMapping('NSUserDefaults', False)


def _setup_conveniences():
    NSNull = objc.lookUpClass('NSNull')

    def nscache_getitem(self, key):
        value = self.objectForKey_(key)
        if value is None:
            raise KeyError(key)

        elif value is NSNull.null():
            return None
Exemplo n.º 2
0
'''
Python mapping for the ImageKit framework.

This module does not contain docstrings for the wrapped code, check Apple's
documentation for details on how to use these functions and classes.
'''
import sys
import objc
import Cocoa

from Quartz.ImageKit import _metadata

objc.addConvenienceForBasicMapping('IKImageBrowserGridGroup', False)
objc.addConvenienceForBasicMapping('IKImageCell', False)
objc.addConvenienceForBasicMapping('IKImageState', False)
objc.addConvenienceForBasicSequence('IKLinkedList', True)

sys.modules['Quartz.ImageKit'] = mod = objc.ObjCLazyModule(
    'Quartz.ImageKit', "com.apple.imageKit",
    objc.pathForFramework(
        "/System/Library/Frameworks/Quartz.framework/Frameworks/ImageKit.framework"
    ), _metadata.__dict__, None, {
        '__doc__': __doc__,
        '__path__': __path__,
        '__loader__': globals().get('__loader__', None),
        'objc': objc,
    }, (Cocoa, ))

import sys
del sys.modules['Quartz.ImageKit._metadata']
'''
Python mapping for the ImageKit framework.

This module does not contain docstrings for the wrapped code, check Apple's
documentation for details on how to use these functions and classes.
'''
import sys
import objc
import Cocoa

from Quartz.ImageKit import _metadata
import Quartz.ImageKit._imagekit

objc.addConvenienceForBasicMapping('IKImageBrowserGridGroup', False)
objc.addConvenienceForBasicMapping('IKImageCell', False)
objc.addConvenienceForBasicMapping('IKImageState', False)
objc.addConvenienceForBasicSequence('IKLinkedList', True)

sys.modules['Quartz.ImageKit'] = mod = objc.ObjCLazyModule('Quartz.ImageKit',
    "com.apple.imageKit",
    objc.pathForFramework("/System/Library/Frameworks/Quartz.framework/Frameworks/ImageKit.framework"),
    _metadata.__dict__, None, {
       '__doc__': __doc__,
       '__path__': __path__,
       '__loader__': globals().get('__loader__', None),
       'objc': objc,
    }, ( Cocoa, ))

import sys
del sys.modules['Quartz.ImageKit._metadata']
Exemplo n.º 4
0
"""
Python mapping for the ImageKit framework.

This module does not contain docstrings for the wrapped code, check Apple's
documentation for details on how to use these functions and classes.
"""
import sys

import Cocoa
import objc
from Quartz.ImageKit import _metadata
from Quartz.ImageKit import _imagekit

objc.addConvenienceForBasicMapping("IKImageBrowserGridGroup", False)
objc.addConvenienceForBasicMapping("IKImageCell", False)
objc.addConvenienceForBasicMapping("IKImageState", False)
objc.addConvenienceForBasicSequence("IKLinkedList", True)

sys.modules["Quartz.ImageKit"] = mod = objc.ObjCLazyModule(
    "Quartz.ImageKit",
    "com.apple.imageKit",
    objc.pathForFramework(
        "/System/Library/Frameworks/Quartz.framework/Frameworks/ImageKit.framework"
    ),
    _metadata.__dict__,
    None,
    {
        "__doc__": __doc__,
        "__path__": __path__,
        "__loader__": globals().get("__loader__", None),
        "objc": objc,
Exemplo n.º 5
0
This module does not contain docstrings for the wrapped code, check Apple's
documentation for details on how to use these functions and classes.
'''
import sys
import objc
import CoreFoundation
from Foundation import _metadata
from Foundation_inlines import _inline_list_
import os

objc.addConvenienceForClass('NSAttributedString', (
    ('__len__',     lambda self: self.length()),
))
#objc.addConvenienceForBasicMapping('NSMergeConflict', True)
#objc.addConvenienceForBasicMapping('NSUbiquitousKeyValueStore', False)
objc.addConvenienceForBasicMapping('NSUserDefaults', False)

def _setup_conveniences():
    NSNull = objc.lookUpClass('NSNull')
    def nscache_getitem(self, key):
        value = self.objectForKey_(key)
        if value is None:
            raise KeyError(key)

        elif value is NSNull.null():
            return None

    def nscache_get(self, key, default=None):
        value = self.objectForKey_(key)
        if value is None:
            return default
Exemplo n.º 6
0
Python mapping for the Foundation framework.

This module does not contain docstrings for the wrapped code, check Apple's
documentation for details on how to use these functions and classes.
"""
import sys
import objc
import CoreFoundation

from Foundation import _metadata
from Foundation._inlines import _inline_list_

objc.addConvenienceForClass("NSAttributedString", (("__len__", lambda self: self.length()),))

# XXX
objc.addConvenienceForBasicMapping("NSMergeConflict", True)
objc.addConvenienceForBasicMapping("NSUbiquitousKeyValueStore", False)
objc.addConvenienceForBasicMapping("NSUserDefaults", False)


def _setup_conveniences():
    NSNull = objc.lookUpClass("NSNull")

    def nscache_getitem(self, key):
        value = self.objectForKey_(key)
        if value is None:
            raise KeyError(key)

        elif value is NSNull.null():
            return None