#!/usr/bin/python3

import dbus
import os

priv = "com.ubuntu.systemservice.setproxy"

session_bus = dbus.SessionBus()
system_bus = dbus.SystemBus()

ser = dbus.Interface(system_bus.get_object("com.ubuntu.SystemService","/"),
                     "com.ubuntu.SystemService")

print (ser.get_proxy("http"))

res = ser.set_proxy("http", "http://test:3128/")
print (res)

ser.set_proxy("http","")
ser.set_proxy("ftp","")

print ("new http proxy: '%s'" % ser.get_proxy("http"))
print ("new ftp proxy: '%s'" % ser.get_proxy("ftp"))

#print ser.get_proxy("http-invalid-proto")
