本文整理汇总了Python中AppKit.NSBundle.bundleWithPath_方法的典型用法代码示例。如果您正苦于以下问题:Python NSBundle.bundleWithPath_方法的具体用法?Python NSBundle.bundleWithPath_怎么用?Python NSBundle.bundleWithPath_使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppKit.NSBundle
的用法示例。
在下文中一共展示了NSBundle.bundleWithPath_方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: load
# 需要导入模块: from AppKit import NSBundle [as 别名]
# 或者: from AppKit.NSBundle import bundleWithPath_ [as 别名]
# statement from all source files in the program, then also delete it here.
from AppKit import NSUserDefaults, NSBundle
from PyObjCTools import Conversion
import os
import objc
from miro import prefs
from miro.plat import bundle
from miro.plat import keychain
from miro.plat import resources
from miro.plat.filenames import os_filename_to_filename_type, filename_type_to_os_filename
sysconfPath = objc.pathForFramework('/System/Library/Frameworks/SystemConfiguration.framework')
sysconfBundle = NSBundle.bundleWithPath_(sysconfPath)
objc.loadBundleFunctions(sysconfBundle, globals(), ((u'SCDynamicStoreCopyProxies', '@@'), ))
MOVIES_DIRECTORY_PARENT = os.path.expanduser('~/Movies')
SUPPORT_DIRECTORY_PARENT = os.path.expanduser('~/Library/Application Support')
def load():
domain = bundle.getBundleIdentifier()
plist = NSUserDefaults.standardUserDefaults().persistentDomainForName_(domain)
try:
pydict = Conversion.pythonCollectionFromPropertyList(plist)
except:
print "WARNING!! Error while converting the preference property list to python dictionary:"
print plist