summaryrefslogtreecommitdiff
path: root/maximus
diff options
context:
space:
mode:
authorburet2008-03-05 16:06:58 +0000
committerburet2008-03-05 16:06:58 +0000
commitf2f531b365d547b59fe6e1c1e9f2260992827b5b (patch)
treec0a306ae00ac347970bbbc152cdcf51071aac5f6 /maximus
parent3a115d509d2c95f8caf81155316a30c824ab20b4 (diff)
Maximus V2: Python
=> Get the value of the define INTERFACE_BUFFER_LIST_NUM_SLOTS in the Cesar station script. git-svn-id: svn+ssh://pessac/svn/cesar/trunk@1566 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'maximus')
-rw-r--r--maximus/python/lib/cesar/sta_cesar.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/maximus/python/lib/cesar/sta_cesar.py b/maximus/python/lib/cesar/sta_cesar.py
index 5c8c9ba3f4..90f3675d85 100644
--- a/maximus/python/lib/cesar/sta_cesar.py
+++ b/maximus/python/lib/cesar/sta_cesar.py
@@ -3,9 +3,22 @@
#print __name__
from maximus.station import *
+from string import *
-# Constant defining the additional number of MME buffers to allocate into the station
-INTERFACE_BUFFER_LIST_NUM_SLOTS = 2
+# Find constant defining the additional number of MME buffers to allocate into the station
+base = '../../../../'
+header = 'interface/interface.h'
+define = 'INTERFACE_BUFFER_LIST_NUM_SLOTS'
+f = open(__file__[:__file__.find(".py") - len(__name__)] + base + header, 'r') # or ".pyc"
+s = f.read()
+f.close()
+begin = s.find(define) + len(define)
+while s[begin] == " " or s[begin] == "\t":
+ begin += 1
+end = begin
+while s[end] in digits: # digits is the string '0123456789'
+ end += 1
+INTERFACE_BUFFER_LIST_NUM_SLOTS = int(s[begin:end])
def STACesar(maximus,\
executable = None,\