From d639b4e2acd65e73e093b0325577fdbab54d8809 Mon Sep 17 00:00:00 2001 From: edistar Date: Tue, 16 Sep 2008 17:46:43 +0000 Subject: [PATCH] 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 --- PyTracker/trunk/PyTrackerClient.py | 17 +++-------------- PyTracker/trunk/clientscript.py | 3 +++ 2 files changed, 6 insertions(+), 14 deletions(-) create mode 100644 PyTracker/trunk/clientscript.py diff --git a/PyTracker/trunk/PyTrackerClient.py b/PyTracker/trunk/PyTrackerClient.py index ce5e968..a24b283 100644 --- a/PyTracker/trunk/PyTrackerClient.py +++ b/PyTracker/trunk/PyTrackerClient.py @@ -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) - - - - - - - - - - - - - diff --git a/PyTracker/trunk/clientscript.py b/PyTracker/trunk/clientscript.py new file mode 100644 index 0000000..0d55228 --- /dev/null +++ b/PyTracker/trunk/clientscript.py @@ -0,0 +1,3 @@ +from PyTrackerClient import * +test=TrackClient('edistar','refeco3','80.61.221.9') +ecore.main_loop_begin()