Skip to content

Commit

Permalink
Refs #8633. Changed search to use xml and a fixed cycle depth
Browse files Browse the repository at this point in the history
The search now uses xml again and is fixed to 1 cycle into the past (although this will be fixed to a spinbox in another ticket to allow the user to set how many cycles into the past they want to search)
  • Loading branch information
keithnbrown committed Jan 7, 2014
1 parent 648a6ad commit 8328f14
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Code/Mantid/scripts/Reflectometry/isis_reflgui/latest_isis_runs.py
Expand Up @@ -99,11 +99,13 @@ def gettextway(self, eID):
item = line[3:8] + ": " + line[28:52].strip()
runnames.append(item)
return runnames
def getxmlway(self, eID):
def getxmlway(self, eID, maxDepth):
runnames = []
tree = xml.parse(self.main_path)
dom = tree.getroot()
for cycle in dom:
depth = 0
revDom = reversed(dom)
for cycle in revDom:
journal_file = cycle.attrib.get('name')
journal_path = os.path.join(self.base_path, journal_file)
cycle_id = self.__findCycleId(journal_path)
Expand All @@ -122,6 +124,11 @@ def getxmlway(self, eID):
if title and runno:
journalentry = runno + ": " + title
runnames.append(journalentry)
depth = depth + 1
if depth == maxDepth:
break
return runnames
def getJournalRuns(self, eID):
return self.gettextway(eID)
def getJournalRuns(self, eID, maxDepth = 1):
if maxDepth < 1:
maxDepth = 1
return self.getxmlway(eID, maxDepth)

0 comments on commit 8328f14

Please sign in to comment.