File: afpstats

package info (click to toggle)
netatalk 3.1.12~ds-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 14,756 kB
  • sloc: ansic: 104,976; sh: 8,247; xml: 7,394; perl: 1,936; makefile: 1,430; python: 1,342; yacc: 309; lex: 49
file content (29 lines) | stat: -rwxr-xr-x 548 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/python3

usage = """Usage:
python afpstats.py
"""

import sys
from traceback import print_exc
import dbus

def main():
    bus = dbus.SystemBus()

    try:
        remote_object = bus.get_object("org.netatalk.AFPStats",
                                       "/org/netatalk/AFPStats")

    except dbus.DBusException:
        print_exc()
        sys.exit(1)

    iface = dbus.Interface(remote_object, "org.netatalk.AFPStats")

    reply = iface.GetUsers()
    for name in reply:
        print(name)

if __name__ == '__main__':
    main()