本文整理匯總了Python中pyload.webui.PYLOAD.getConfigDict方法的典型用法代碼示例。如果您正苦於以下問題:Python PYLOAD.getConfigDict方法的具體用法?Python PYLOAD.getConfigDict怎麽用?Python PYLOAD.getConfigDict使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pyload.webui.PYLOAD
的用法示例。
在下文中一共展示了PYLOAD.getConfigDict方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: info
# 需要導入模塊: from pyload.webui import PYLOAD [as 別名]
# 或者: from pyload.webui.PYLOAD import getConfigDict [as 別名]
def info():
conf = PYLOAD.getConfigDict()
extra = os.uname() if hasattr(os, "uname") else tuple()
data = {"python" : sys.version,
"os" : " ".join((os.name, sys.platform) + extra),
"version" : PYLOAD.getServerVersion(),
"folder" : os.path.abspath(PYLOAD_DIR), "config": os.path.abspath(""),
"download" : os.path.abspath(conf['general']['download_folder']['value']),
"freespace": formatSize(PYLOAD.freeSpace()),
"remote" : conf['remote']['port']['value'],
"webif" : conf['webui']['port']['value'],
"language" : conf['general']['language']['value']}
return render_to_response("info.html", data, [pre_processor])
示例2: load_config
# 需要導入模塊: from pyload.webui import PYLOAD [as 別名]
# 或者: from pyload.webui.PYLOAD import getConfigDict [as 別名]
def load_config(category, section):
conf = None
if category == "general":
conf = PYLOAD.getConfigDict()
elif category == "plugin":
conf = PYLOAD.getPluginConfigDict()
for key, option in conf[section].iteritems():
if key in ("desc", "outline"): continue
if ";" in option['type']:
option['list'] = option['type'].split(";")
option['value'] = decode(option['value'])
return render_to_response("settings_item.html", {"skey": section, "section": conf[section]})