def getParentalControlList():
    if not config.ParentalControl.configured.value:
        return {"result": True, "services": []}

    if config.ParentalControl.type.value == "whitelist":
        tservices = parentalControl.openListFromFile(LIST_WHITELIST)
    else:
        tservices = parentalControl.openListFromFile(LIST_BLACKLIST)

    services = []
    for service in tservices:
        tservice = ServiceReference(service)
        services.append({"servicereference": service, "servicename": tservice.getServiceName()})

    return {"result": True, "services": services}
Exemple #2
0
def getParentalControlList():
    if not config.ParentalControl.configured.value:
        return {"result": True, "services": []}

    if config.ParentalControl.type.value == "whitelist":
        tservices = parentalControl.openListFromFile(LIST_WHITELIST)
    else:
        tservices = parentalControl.openListFromFile(LIST_BLACKLIST)

    services = []
    for service in tservices:
        tservice = ServiceReference(service)
        services.append({
            "servicereference": service,
            "servicename": tservice.getServiceName()
        })

    return {"result": True, "services": services}