-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwatch_pp.py
More file actions
executable file
·34 lines (31 loc) · 856 Bytes
/
watch_pp.py
File metadata and controls
executable file
·34 lines (31 loc) · 856 Bytes
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
30
31
32
33
34
#!/usr/bin/python3
import suds
import suds.client
import suds.wsse
import sys
import timeit
import getopt
import csv
url="https://tt.poczta-polska.pl/Sledzenie/services/Sledzenie?wsdl"
username="sledzeniepp"
password="PPSA"
def show_data(client,numer):
spr=client.service.sprawdzPrzesylke(numer)
if not spr.danePrzesylki:
print("Brak przesylki %s" % (numer,))
return
for i in spr.danePrzesylki.zdarzenia[0]:
print(numer,i.czas, i.jednostka.nazwa, i.kod, i.nazwa)
if len(sys.argv) > 1:
numery=list(sys.argv[1:])
else:
numery={
'RQ260561184SG' : 'fasttech',
}
security = suds.wsse.Security()
token = suds.wsse.UsernameToken(username,password)
security.tokens.append(token)
client=suds.client.Client(url)
client.set_options(wsse=security)
for numer in numery:
show_data(client,numer)