get rid of small bugs and add clientscript.py to test my client class
git-svn-id: http://www.neo1973-germany.de/svn@157 46df4e5c-bc4e-4628-a0fc-830ba316316d
This commit is contained in:
parent
5a6b1d38f2
commit
d639b4e2ac
2 changed files with 6 additions and 14 deletions
|
@ -14,7 +14,7 @@ from dbus import SystemBus, Interface
|
|||
from optparse import OptionParser
|
||||
|
||||
class TrackClient:
|
||||
def __init__(self, username, passwordhash, host, port):
|
||||
def __init__(self, username='anonymous', passwordhash='', host='localhost', port='49152'):
|
||||
self.InitSocket(host, port)
|
||||
self.InitDbusStuff()
|
||||
self.InitUserHash(username, passwordhash)
|
||||
|
@ -62,6 +62,8 @@ class TrackClient:
|
|||
# prepare data for sending
|
||||
UDPData = "%s,%s,%s,%s" % (lat, lon, alt, utctime)
|
||||
self.SendData(self.__username, self.__pwhash, 'Transmit', UDPData)
|
||||
# Debug message:
|
||||
print "Updated Data"
|
||||
|
||||
def InitUserHash(self, username, pwhash):
|
||||
# set username and password globally in the class
|
||||
|
@ -72,16 +74,3 @@ class TrackClient:
|
|||
# put together and send data to TransmitUDP()
|
||||
senddata = "%s;%s;%s;%s" % (username, pwhash, action, data)
|
||||
self.TransmitUDP(senddata)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
3
PyTracker/trunk/clientscript.py
Normal file
3
PyTracker/trunk/clientscript.py
Normal file
|
@ -0,0 +1,3 @@
|
|||
from PyTrackerClient import *
|
||||
test=TrackClient('edistar','refeco3','80.61.221.9')
|
||||
ecore.main_loop_begin()
|
Loading…
Reference in a new issue