1#!/usr/bin/env python 2 3usage = """Usage: 4python afpstats.py 5""" 6 7import sys 8from traceback import print_exc 9import dbus 10 11def main(): 12 bus = dbus.SystemBus() 13 14 try: 15 remote_object = bus.get_object("org.netatalk.AFPStats", 16 "/org/netatalk/AFPStats") 17 18 except dbus.DBusException: 19 print_exc() 20 sys.exit(1) 21 22 iface = dbus.Interface(remote_object, "org.netatalk.AFPStats") 23 24 reply = iface.GetUsers() 25 for name in reply: 26 print name 27 28if __name__ == '__main__': 29 main() 30