Exemplo n.º 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()
Exemplo n.º 2
0
 def getValue(self, key):
     if key in self._value:
         return self._getValue(key)
     print(
         "KeyMap.getValue() Error: %s  **************************************"
         % key)
     raise NoSuchElementException()
Exemplo n.º 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")
Exemplo n.º 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()
Exemplo n.º 5
0
 def nextElement(self):
     if self.hasMoreElements():
         response, self.error = self._getResponse()
         return response
     raise NoSuchElementException()
Exemplo n.º 6
0
 def nextElement(self):
     if self.next is not self.end:
         return self.next
     raise NoSuchElementException('no more elements exist', self)
Exemplo n.º 7
0
 def _getNoSuchElementException(self, code):
     e = NoSuchElementException()
     e.Message = getMessage(self.ctx, code)
     e.Context = self
     return e
Exemplo n.º 8
0
 def getByName(self, name):
     if not self.hasByName(name):
         raise NoSuchElementException()
     return self._typemap[name]
Exemplo n.º 9
0
 def setCurrentController(self, controller):
     if controller in self.controllers:
         self.controller = controller
     else:
         raise NoSuchElementException("controller not found", self)