本文整理匯總了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