Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
|
dapnetapisetidentificationaddress [2018/05/22 21:02] df2et |
dapnetapisetidentificationaddress [2026/01/30 14:10] (aktuell) dj7lc |
||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | Mithilfe dieses Python scripts können die identificationAddresses aller Sender auf einen bestimmten Wert (.z.B. 8) gesetzt werden: | + | ====== Set all identificationAddress ====== |
| - | + | ||
| + | By means of this script in python the ''identificationAddresses'' of all transmitters can be set to determined value (e.g. 8). It's for information / documentatin only and not necessary for normal user interactions. | ||
| <code> | <code> | ||
| Zeile 11: | Zeile 12: | ||
| login = 'callsign' | login = 'callsign' | ||
| passwd = 'passwd' | passwd = 'passwd' | ||
| - | url = 'http://dapnet.db0sda.ampr.org:8080/transmitters' | + | url = 'http://dapnet.db0sda.hamnet.radio:8080/transmitters' |
| identificationAddress = 8 | identificationAddress = 8 | ||
| Zeile 36: | Zeile 37: | ||
| time.sleep(5) | time.sleep(5) | ||
| - | url = url + '/' + name | + | print 'Changing: ' + name |
| + | newurl = url + '/' + name | ||
| try: | try: | ||
| - | response = requests.put(url, headers=headers, data=newjson, auth=HTTPBasicAuth(login, passwd)) | + | response = requests.put(newurl, headers=headers, data=newjson, auth=HTTPBasicAuth(login, passwd)) |
| response.raise_for_status() | response.raise_for_status() | ||
| except requests.exceptions.RequestException as e: | except requests.exceptions.RequestException as e: | ||