Esempio n. 1
0
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", {
            "sorted_conf":
            lambda c: sorted(c.items(),
                             key=lambda i: i[1]['idx'] if i[0] not in
                             ("desc", "outline") else 0),
            "skey":
            section,
            "section":
            conf[section]
        })
Esempio n. 2
0
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])
Esempio n. 3
0
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]})
Esempio n. 4
0
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": abspath(PYLOAD_DIR),
        "config": abspath(""),
        "download": 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])
Esempio n. 5
0
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]
    })