parameters: (self)
docstring: execute search
docstring_summary: execute search
docstring_tokens: execute search
function: def search(self):
          """execute search"""
  
          self.catalog = None
          self.constraints = []
  
          # clear all fields and disable buttons
          self.clear_results()
  
          # set current catalog
          current_text = self.cmbConnectionsSearch.currentText()
          key = '/MetaSearch/%s' % current_text
          self.catalog_url = self.settings.value('%s/url' % key)
          self.catalog_username = self.settings.value('%s/username' % key)
          self.catalog_password = self.settings.value('%s/password' % key)
          self.catalog_type = self.settings.value('%s/catalog-type' % key)
  
          # start position and number of records to return
          self.startfrom = 1
  
          # bbox
          # CRS is WGS84 with axis order longitude, latitude
          # defined by 'urn:ogc:def:crs:OGC:1.3:CRS84'
          minx = self.leWest.text()
          miny = self.leSouth.text()
          maxx = self.leEast.text()
          maxy = self.leNorth.text()
          bbox = [minx, miny, maxx, maxy]
          keywords = self.leKeywords.text()
  
          # build request
          if not self._get_catalog():
              return
  
          # TODO: allow users to select resources types
          # to find ('service', 'dataset', etc.)
          try:
              with OverrideCursor(Qt.WaitCursor):
                  self.catalog.query_records(bbox, keywords, self.maxrecords,
                                             self.startfrom)
  
          except Exception as err:
              QMessageBox.warning(self, self.tr('Search error'),
                                  self.tr('Search error: {0}').format(err))
              return
  
          if self.catalog.matches == 0:
              self.lblResults.setText(self.tr('0 results'))
              return
  
          self.display_results()
function_tokens: def search ( self ) : self . catalog = None self . constraints = [ ] # clear all fields and disable buttons self . clear_results ( ) # set current catalog current_text = self . cmbConnectionsSearch . currentText ( ) key = '/MetaSearch/%s' % current_text self . catalog_url = self . settings . value ( '%s/url' % key ) self . catalog_username = self . settings . value ( '%s/username' % key ) self . catalog_password = self . settings . value ( '%s/password' % key ) self . catalog_type = self . settings . value ( '%s/catalog-type' % key ) # start position and number of records to return self . startfrom = 1 # bbox # CRS is WGS84 with axis order longitude, latitude # defined by 'urn:ogc:def:crs:OGC:1.3:CRS84' minx = self . leWest . text ( ) miny = self . leSouth . text ( ) maxx = self . leEast . text ( ) maxy = self . leNorth . text ( ) bbox = [ minx , miny , maxx , maxy ] keywords = self . leKeywords . text ( ) # build request if not self . _get_catalog ( ) : return # TODO: allow users to select resources types # to find ('service', 'dataset', etc.) try : with OverrideCursor ( Qt . WaitCursor ) : self . catalog . query_records ( bbox , keywords , self . maxrecords , self . startfrom ) except Exception as err : QMessageBox . warning ( self , self . tr ( 'Search error' ) , self . tr ( 'Search error: {0}' ) . format ( err ) ) return if self . catalog . matches == 0 : self . lblResults . setText ( self . tr ( '0 results' ) ) return self . display_results ( )