Skip to content

Commit 6489b04

Browse files
author
vinnie87
committed
Fix: Modules Tab load
Fix: Modules Tab load
1 parent 89f2f74 commit 6489b04

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

Server/Application_py266/Main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class Root(object):
4545
seqsMap = SequencesDict()
4646
modsMap = ModulesDict()
4747
oumodsMap = OutputModulesDict()
48+
allmodsMap = AllModulesDict()
4849

4950
srvsMap = ServicesDict()
5051

@@ -221,7 +222,7 @@ def allmodules(self, _dc=101, ver=-2, cnf=-2):
221222
cnf = int(cnf)
222223
ver = int(ver)
223224
cnf = self.cnfMap.get(cnf)
224-
data = self.funcs.getAllModules(cnf,ver,self.modsMap,self.idgen,db, self.log)
225+
data = self.funcs.getAllModules(cnf,ver,self.allmodsMap,self.idgen,db, self.log)
225226
if (data == None):
226227
# print ("Exception - Error")
227228
self.log.error('ERROR: allmodules - data returned null object')

Server/Application_py266/exposed/exposed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ def getAllModules(self, cnf = -2, ver = -2, modsMap = None, idgen = None, db = N
939939
if (templates_dict.has_key(m2t)):
940940
temp = templates_dict.get(m2t)
941941
md = ModuleDetails(m.id, m.name, temp.id_mtype, "", temp.name)
942-
md.gid = modsMap.putModule(idgen,md)
942+
md.gid = modsMap.put(idgen,md)
943943

944944
else:
945945
log.error('ERROR: Module key error') #print "ERROR KEY"

Server/Application_py266/utils.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,26 @@ def get(self,gid):
5353
else:
5454
return -2
5555

56+
class AllModulesDict(object):
57+
58+
def __init__(self):
59+
self.allmodDict = {}
60+
61+
def put(self, counter, module):
62+
mid = module.id
63+
if (mid in self.allmodDict.values()):
64+
return [k for k, v in self.allmodDict.iteritems() if v == mid][0]
65+
else:
66+
gid = counter.getNext()
67+
self.allmodDict[gid] = mid
68+
return gid
69+
70+
def get(self,gid):
71+
if self.allmodDict.has_key(gid):
72+
return self.allmodDict.get(gid)
73+
else:
74+
return -2
75+
5676
class OutputModulesDict(object):
5777

5878
def __init__(self):

0 commit comments

Comments
 (0)