summaryrefslogtreecommitdiff
path: root/test/set-timezone
blob: dfc1c981a35f99f034b9700063b2594aa0dc4039 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/python

import sys
import dbus

if (len(sys.argv) != 2):
	print "Usage: %s <timezone>" % (sys.argv[0])
	sys.exit(1)

bus = dbus.SystemBus()

clock = dbus.Interface(bus.get_object('net.connman', '/'),
					'net.connman.Clock')

print "Setting timezone to %s" % (sys.argv[1])

try:
	clock.SetProperty("Timezone", dbus.String(sys.argv[1], variant_level=1),
			  signature=dbus.Signature('sv'))
except dbus.exceptions.DBusException, e_msg:
	print e_msg