first commit
This commit is contained in:
10
Foundation/Conversion.py
Executable file
10
Foundation/Conversion.py
Executable file
@@ -0,0 +1,10 @@
|
||||
"""
|
||||
Compatibility module
|
||||
"""
|
||||
import warnings
|
||||
|
||||
warnings.warn(
|
||||
"import PyObjCTools.Conversion instead of Foundation.Conversion",
|
||||
DeprecationWarning)
|
||||
|
||||
from PyObjCTools.Conversion import *
|
||||
BIN
Foundation/_Foundation.so
Executable file
BIN
Foundation/_Foundation.so
Executable file
Binary file not shown.
49
Foundation/__init__.py
Executable file
49
Foundation/__init__.py
Executable file
@@ -0,0 +1,49 @@
|
||||
import objc as _objc
|
||||
from _Foundation import *
|
||||
|
||||
NSClassFromString = _objc.lookUpClass
|
||||
|
||||
# Do something smart to collect Foundation classes...
|
||||
|
||||
if _objc.platform == 'MACOSX':
|
||||
_objc.loadBundle(
|
||||
'Foundation',
|
||||
globals(),
|
||||
bundle_identifier=u'com.apple.Foundation',
|
||||
)
|
||||
else:
|
||||
_objc.loadBundle(
|
||||
'Foundation',
|
||||
globals(),
|
||||
bundle_path=_objc.pathForFramework(
|
||||
u'/System/Library/Frameworks/Foundation.framework',
|
||||
),
|
||||
)
|
||||
|
||||
def _initialize():
|
||||
import sys, os
|
||||
if 'PYOBJCFRAMEWORKS' in os.environ:
|
||||
paths = os.environ['PYOBJCFRAMEWORKS'].split(":")
|
||||
count = 0
|
||||
for path in paths:
|
||||
bundle = NSBundle.bundleWithPath_(path)
|
||||
bundle.principalClass()
|
||||
sys.path.insert(count, str(bundle.resourcePath()))
|
||||
count = count + 1
|
||||
|
||||
initPath = bundle.pathForResource_ofType_( "Init", "py")
|
||||
if initPath:
|
||||
execfile(initPath, globals(), locals())
|
||||
|
||||
_initialize()
|
||||
|
||||
import protocols # no need to export these, just register with PyObjC
|
||||
|
||||
#
|
||||
# (informal) protocols eported for b/w compatibility
|
||||
#
|
||||
from protocols import NSConnectionDelegateMethods, \
|
||||
NSDistantObjectRequestMethods, \
|
||||
NSCopyLinkMoveHandler, NSKeyedArchiverDelegate, \
|
||||
NSKeyedUnarchiverDelegate, NSNetServiceDelegateMethods, \
|
||||
NSNetServiceBrowserDelegateMethods, NSPortDelegateMethods
|
||||
1856
Foundation/protocols.py
Executable file
1856
Foundation/protocols.py
Executable file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user