本文整理汇总了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]})