Skip to content

Commit

Permalink
Fix PR#17 commit 'misc changes', it broke list/edit SRs
Browse files Browse the repository at this point in the history
Signed-off-by: Bernhard Kaindl <bernhard.kaindl@cloud.com>
  • Loading branch information
bernhardkaindl committed Dec 4, 2023
1 parent 67a114b commit 128fd38
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions XSConsoleHotData.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,19 @@ def __iter__(self):
raise Exception(Lang("Cannot iterate over type '")+str(type(iterData))+"'")
return self

# This method will hide fields called 'next' in the xapi database. If any appear, __iter__ will need to
# return a new object type and this method will need to be moved into that
# This method will hide fields called '__next__' in the xapi database.
# If any appear, __iter__ will need to return a new object type
# and this method will need to be moved into that:
def __next__(self):
if len(self.iterKeys) <= 0:
raise StopIteration
retVal = HotAccessor(self.name[:], self.refs[:]) # [:] copies the array
retVal.refs[-1] = self.iterKeys.pop(0)
return retVal

if sys.version_info < (3, 0):
next = __next__ # Python2 iterator calls next() to get the next item.

def __getitem__(self, inParam):
# These are square brackets selecting a particular item from a dict using its OpaqueRef
if not isinstance(inParam, (int, HotOpaqueRef)):
Expand Down

0 comments on commit 128fd38

Please sign in to comment.