Switch to unified view

a/samplescripts/Analog-Input b/samplescripts/Analog-Input
...
...
69
# Upmpdcli friendly-name, the actual value comes from a parameter when
69
# Upmpdcli friendly-name, the actual value comes from a parameter when
70
# executed from upmpdcli (as normal). Used to compute a Uuid in
70
# executed from upmpdcli (as normal). Used to compute a Uuid in
71
# conjunction with the node name and script name
71
# conjunction with the node name and script name
72
upmpdcli_fname = "UpMpd"
72
upmpdcli_fname = "UpMpd"
73
73
74
externalvolume = False
75
74
def usage(f):
76
def usage(f):
75
    print("Usage: %s [-h] [-f friendlyname]" % sys.argv[0], file=f)
77
    print("Usage: %s [-h] [-f friendlyname]" % sys.argv[0], file=f)
76
    sys.exit(1)
78
    sys.exit(1)
77
79
78
args = sys.argv[1:]
80
args = sys.argv[1:]
79
opts, args = getopt.getopt(args, "hup:f:")
81
opts, args = getopt.getopt(args, "hup:f:e")
80
for opt, arg in opts:
82
for opt, arg in opts:
81
    if opt in ['-h']:
83
    if opt in ['-h']:
82
        usage(sys.stdout)
84
        usage(sys.stdout)
83
    elif opt in ['-f']:
85
    elif opt in ['-f']:
84
        upmpdcli_fname = arg
86
        upmpdcli_fname = arg
87
    elif opt in ['-e']:
88
        externalvolume = True    
85
    else:
89
    else:
86
        print("unknown option %s\n"%opt, file=sys.stderr)
90
        print("unknown option %s\n"%opt, file=sys.stderr)
87
        usage(sys.stderr)
91
        usage(sys.stderr)
88
92
89
93