summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--For Weekly Test/30-07-2011/DbClass.py13
-rw-r--r--For Weekly Test/30-07-2011/DeviceAddress.py27
-rw-r--r--For Weekly Test/30-07-2011/DeviceAddressClass.py37
-rw-r--r--For Weekly Test/30-07-2011/DeviceAddressClass.pyc (renamed from For Weekly Test/30-07-2011/DeviceAddress.pyc)bin1211 -> 1211 bytes
-rwxr-xr-xFor Weekly Test/30-07-2011/gsmselftest.py4
5 files changed, 39 insertions, 42 deletions
diff --git a/For Weekly Test/30-07-2011/DbClass.py b/For Weekly Test/30-07-2011/DbClass.py
index 442e777..ae220a9 100644
--- a/For Weekly Test/30-07-2011/DbClass.py
+++ b/For Weekly Test/30-07-2011/DbClass.py
@@ -106,24 +106,11 @@ class DBMySQLConnection:
if self.connectionCreated == 1:
try:
successful = self.cur.execute("SELECT `deviceIP`,`number` FROM DeviceAddressTable where `deviceName`=%s", deviceName)
- #self.cur.execute()
output = self.cur.fetchall() #get the mysql response
#parse the output from the mysql by creating a list
#with lists where each attribue(column) gets independent
#element of the list
-
-
-# for record in output:
-# columns = list()
-# for entry in record:
-# columns.append(str(entry))
-# columns.append(str(0))
-# self.tasksList.append(columns)
-
-
-
-
deviceAddr = ''
for record in output:
columns = list()
diff --git a/For Weekly Test/30-07-2011/DeviceAddress.py b/For Weekly Test/30-07-2011/DeviceAddress.py
deleted file mode 100644
index 6f0039d..0000000
--- a/For Weekly Test/30-07-2011/DeviceAddress.py
+++ /dev/null
@@ -1,27 +0,0 @@
-class DeviceAddress:
-
- def __init__(self):
- self.add = None
- self.num = None
-
- def findDevice(self, device):
- file = open('DeviceAddress.txt', 'r')
-
- for line in file:
-
- first = line.find('[')
- second= line.find(']') # search for position
- find = line[first+1:second]
-
- stop = line.find(':')
- newLine =line[stop+1:]
- stop2 = newLine.find(':')
-
- no = newLine[stop2+1:]
- stop3 = no.find(':')
-
-
- if find == device:
- self.add = newLine[0:stop2]
- self.num = no[0:stop3]
- file.close()
diff --git a/For Weekly Test/30-07-2011/DeviceAddressClass.py b/For Weekly Test/30-07-2011/DeviceAddressClass.py
new file mode 100644
index 0000000..21c9dc0
--- /dev/null
+++ b/For Weekly Test/30-07-2011/DeviceAddressClass.py
@@ -0,0 +1,37 @@
+class DeviceAddress:
+
+ def __init__(self):
+ self.add = None
+ self.num = None
+ self.portAdd = ''
+
+ def findDevice(self, device):
+ file = open('DeviceAddress.txt', 'r')
+
+ for line in file:
+
+ first = line.find('[')
+ second= line.find(']') # search for position
+ find = line[first+1:second]
+
+ stop = line.find(':')
+ IPAddress =line[stop+1:]
+ stop2 = IPAddress.find(':')
+
+ number = IPAddress[stop2+1:]
+ stop3 = number.find(':')
+
+ portAddress = number[stop3+1:]
+ stop4 = portAddress.find(':')
+
+
+ if find == device:
+ print device
+ self.add = IPAddress[0:stop2]
+ self.num = number[0:stop3]
+ if stop4 <> -1:
+ self.portAdd = portAddress[0:stop4]
+ break
+
+
+ file.close()
diff --git a/For Weekly Test/30-07-2011/DeviceAddress.pyc b/For Weekly Test/30-07-2011/DeviceAddressClass.pyc
index 98dae9c..98dae9c 100644
--- a/For Weekly Test/30-07-2011/DeviceAddress.pyc
+++ b/For Weekly Test/30-07-2011/DeviceAddressClass.pyc
Binary files differ
diff --git a/For Weekly Test/30-07-2011/gsmselftest.py b/For Weekly Test/30-07-2011/gsmselftest.py
index 9af77b1..b62531f 100755
--- a/For Weekly Test/30-07-2011/gsmselftest.py
+++ b/For Weekly Test/30-07-2011/gsmselftest.py
@@ -3,7 +3,7 @@ import sys
import ControllerClass
import DbClass
import PingClass
-import DeviceAddress
+import DeviceAddressClass
from time import sleep
def ping(handler):
@@ -60,7 +60,7 @@ def doTest(callFrom,callTo):
global testRepeat
testRepeat = None
ping(callFrom)
- device = DeviceAddress.DeviceAddress()
+ device = DeviceAddressClass.DeviceAddress()
if serverStatus <> 0: