Пример #1
0
 def project_info(self, project_name):
     """Return a project's long name and description."""
     project_url = "%s%s/" % (self.server_url, project_name)
     response, content = self._get(project_url, 'project')
     if response.status != 200:
         raise RecordStoreAccessError("Error in accessing %s\n%s: %s" % (project_url, response.status, content))
     data = serialization.decode_project_data(content)
     return dict((k, data[k]) for k in ("name", "description"))
Пример #2
0
 def project_info(self, project_name):
     """Return a project's long name and description."""
     project_url = "%s%s/" % (self.server_url, project_name)
     response, content = self._get(project_url, 'project')
     if response.status != 200:
         raise RecordStoreAccessError("Error in accessing %s\n%s: %s" % (project_url, response.status, content))
     data = serialization.decode_project_data(content)
     return dict((k, data[k]) for k in ("name", "description"))
Пример #3
0
 def list(self, project_name, tags=None):
     project_url = "%s%s/" % (self.server_url, project_name)
     if tags:
         if not isinstance(tags, list):
             tags = [tags]
         project_url += "?tags=%s" % ",".join(tags)
     response, content = self._get(project_url, 'project')
     if response.status != 200:
         raise RecordStoreAccessError("Could not access %s\n%s: %s" % (project_url, response.status, content))
     record_urls = serialization.decode_project_data(content)["records"]
     records = []
     for record_url in record_urls:
         records.append(self._get_record(record_url))
     return records
Пример #4
0
 def list(self, project_name, tags=None):
     project_url = "%s%s/" % (self.server_url, project_name)
     if tags:
         if not hasattr(tags, "__iter__"):
             tags = [tags]
         project_url += "?tags=%s" % ",".join(tags)
     response, content = self._get(project_url, 'project')
     if response.status != 200:
         raise RecordStoreAccessError("Could not access %s\n%s: %s" % (project_url, response.status, content))
     record_urls = serialization.decode_project_data(content)["records"]
     records = []
     for record_url in record_urls:
         records.append(self._get_record(record_url))
     return records