import sys, os, objc
import Foundation
import _metadata

# The framework should be added to the path, so we just need to find it
frameworkPath = ''
for p in sys.path:
    if "ATDeviceElements.framework" in p:
        i = p.index("ATDeviceElements.framework")
        frameworkPath = p[:i+len("ATDeviceElements.framework")]

# Check if we found the framework in the path
if not frameworkPath:
    raise ImportError("Couldn't find ATDeviceElements in path")

sys.modules['ATDeviceElements'] = objc.ObjCLazyModule('ATDeviceElements',
     "com.apple.ATDeviceElements",
     objc.pathForFramework(frameworkPath),
     _metadata.__dict__, None, {
         'objc': objc,
         '__path__': frameworkPath,
     }, (Foundation,))


