當前位置: 首頁>>代碼示例>>Python>>正文


Python NSBundle.bundleWithPath_方法代碼示例

本文整理匯總了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
開發者ID:codito,項目名稱:miro,代碼行數:32,代碼來源:config.py


注:本文中的AppKit.NSBundle.bundleWithPath_方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。