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:
edistar 2008-09-16 17:46:43 +00:00
parent 5a6b1d38f2
commit d639b4e2ac
2 changed files with 6 additions and 14 deletions

View file

@ -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)

View file

@ -0,0 +1,3 @@
from PyTrackerClient import *
test=TrackClient('edistar','refeco3','80.61.221.9')
ecore.main_loop_begin()