Exemple #1
0
 def nextElement(self):
     if self.elements:
         return self.elements.pop(0)
     elif self.token:
         self.elements, self.token = self._getElements(self.token)
         return self.nextElement()
     raise NoSuchElementException()
Exemple #2
0
 def getValue(self, key):
     if key in self._value:
         return self._getValue(key)
     print(
         "KeyMap.getValue() Error: %s  **************************************"
         % key)
     raise NoSuchElementException()
Exemple #3
0
 def removeByName(self, name):
     log.debug("removeByName called" + str(name))
     uri = expandUri(name)
     if self.provCtx.isUrlInPackage(uri):
         self.provCtx.removePackageByUrl(uri)
     else:
         log.debug("removeByName unknown uri " + str(name) + ", ignoring")
         raise NoSuchElementException(uri + "is not in package", self)
     log.debug("removeByName called" + str(uri) + " successful")
Exemple #4
0
 def nextElement(self):
     if self.rows:
         return self.rows.pop(0)
     elif self.token:
         self.rows, self.token, self.sync, error = self._getRows(self.token)
         if not error:
             return self.nextElement()
         logMessage(self.ctx, SEVERE, error, "OAuth2Service","Enumerator()")
     raise NoSuchElementException()
Exemple #5
0
 def nextElement(self):
     if self.hasMoreElements():
         response, self.error = self._getResponse()
         return response
     raise NoSuchElementException()
Exemple #6
0
 def nextElement(self):
     if self.next is not self.end:
         return self.next
     raise NoSuchElementException('no more elements exist', self)
Exemple #7
0
 def _getNoSuchElementException(self, code):
     e = NoSuchElementException()
     e.Message = getMessage(self.ctx, code)
     e.Context = self
     return e
Exemple #8
0
 def getByName(self, name):
     if not self.hasByName(name):
         raise NoSuchElementException()
     return self._typemap[name]
Exemple #9
0
 def setCurrentController(self, controller):
     if controller in self.controllers:
         self.controller = controller
     else:
         raise NoSuchElementException("controller not found", self)