Esempio n. 1
0
    ConfigSelection,
    ConfigSet,
    ConfigSubList,
    ConfigNumber,
    NoSave,
)
from Components.ConfigList import ConfigListScreen
from Components.Sources.StaticText import StaticText

from GrowleeConnection import gotNotification, emergencyDisable, growleeConnection

from . import NOTIFICATIONID

growlee = ConfigSubsection()
config.plugins.growlee = growlee
growlee.hostcount = ConfigNumber(default=0)
growlee.hosts = ConfigSubList()


def addHost(name):
    s = ConfigSubsection()
    s.name = ConfigText(default=name, fixed_size=False)
    s.enable_incoming = ConfigYesNo(default=False)
    s.enable_outgoing = ConfigYesNo(default=False)
    s.address = ConfigText(fixed_size=False)
    s.password = ConfigPassword()
    s.protocol = ConfigSelection(
        default="growl",
        choices=[
            ("growl", "Growl"),
            ("gntp", "GNTP"),
Esempio n. 2
0
from Screens.Setup import SetupSummary
from Screens.Screen import Screen
from Components.ActionMap import ActionMap
from Components.config import config, getConfigListEntry, ConfigSubsection, \
  ConfigText, ConfigPassword, ConfigYesNo, ConfigSelection, ConfigSet, \
  ConfigSubList, ConfigNumber, NoSave
from Components.ConfigList import ConfigListScreen
from Components.Sources.StaticText import StaticText

from GrowleeConnection import gotNotification, emergencyDisable, growleeConnection

from . import NOTIFICATIONID

growlee = ConfigSubsection()
config.plugins.growlee = growlee
growlee.hostcount = ConfigNumber(default=0)
growlee.hosts = ConfigSubList()


def addHost(name):
    s = ConfigSubsection()
    s.name = ConfigText(default=name, fixed_size=False)
    s.enable_incoming = ConfigYesNo(default=False)
    s.enable_outgoing = ConfigYesNo(default=False)
    s.address = ConfigText(fixed_size=False)
    s.password = ConfigPassword()
    s.protocol = ConfigSelection(default="growl",
                                 choices=[("growl", "Growl"), ("gntp", "GNTP"),
                                          ("snarl", "Snarl"),
                                          ("prowl", "Prowl"),
                                          ("syslog", "Syslog UDP")])