Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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