Example #1
0
def main_screen():
    (tethering.wifi, tethering.ssid,
     tethering.passphrase) = get_tethering_status("wifi")
    tethering.ethernet= get_tethering_status("ethernet")
    tethering.bluetooth = get_tethering_status("bluetooth")
    tethering.gadget = get_tethering_status("gadget")

    if tethering.wifi== None:
        tethering.wifi = "OFF"

    if tethering.ethernet== None:
        tethering.ethernet = "OFF"

    if tethering.bluetooth == None:
        tethering.bluetooth = "OFF"

    if tethering.gadget == None:
        tethering.gadget = "OFF"

    tethering.form.get('ssid').value = tethering.ssid
    tethering.form.get('passphrase').value = tethering.passphrase
    tethering.form.get('wifi').value = tethering.wifi
    tethering.form.get('ethernet').value = tethering.ethernet
    tethering.form.get('bluetooth').value = tethering.bluetooth
    tethering.form.get('gadget').value = tethering.gadget

    offlinemode_status = get_offlinemode_status()
    if offlinemode_status == True:
        technology.offlinemode = "ON"
    else:
        technology.offlinemode = "OFF"
    technology.form.get('offlinemode').value = technology.offlinemode

    (technology.wired, technology.wifi, technology.cellular,
     technology.bluetooth, technology.gadget) = get_technology_status()
    technology.form.get('wired').value = technology.wired
    technology.form.get('wifi').value = technology.wifi
    technology.form.get('cellular').value = technology.cellular
    technology.form.get('bluetooth').value = technology.bluetooth
    technology.form.get('gadget').value = technology.gadget

    return render.base(listing(),
                       title, logout, help)
Example #2
0
def update(input):
    offlinemode_status = get_offlinemode_status()
    if input.offlinemode != offlinemode_status:
        if input.offlinemode == "ON":
            mode = dbus.Boolean(1)
        else:
            mode = dbus.Boolean(0)
        set_offlinemode_status(mode)

    if input.wired != wired:
        set_technology_status("ethernet", input.wired)

    if input.wifi != wifi:
        set_technology_status("wifi", input.wifi)

    if input.cellular != cellular:
        set_technology_status("cellular", input.cellular)

    if input.bluetooth != bluetooth:
        set_technology_status("bluetooth", input.bluetooth)

    if input.gadget != gadget:
        set_technology_status("gadget", input.gadget)