def get_workspaces(self): rest_url = urljoin(self.service_url, "workspaces.xml") description = self.get_xml(rest_url) return [ workspace_from_index(self, node) for node in description.findall("workspace") ]
def get_workspaces(self, names=None): ''' Returns a list of workspaces in the catalog. If names is specified, will only return workspaces that match. names can either be a comma delimited string or an array. Will return an empty list if no workspaces are found. ''' if names is None: names = [] elif isinstance(names, basestring): names = map(str.strip, str(names).split(',')) description = self.get_xml("%s/workspaces.xml" % self.service_url) workspaces = [] workspaces.extend([ workspace_from_index(self, node) for node in description.findall("workspace") ]) if workspaces and names: named_workspaces = [] for ws in workspaces: if ws.name in names: named_workspaces.append(ws) return named_workspaces return workspaces
def get_workspaces(self): rest_url = urljoin( self.service_url, "workspaces.xml" ) description = self.get_xml(rest_url) return [workspace_from_index(self, node) for node in description.findall("workspace")]
def get_workspaces(self, names=None): ''' Returns a list of workspaces in the catalog. If names is specified, will only return workspaces that match. names can either be a comma delimited string or an array. Will return an empty list if no workspaces are found. ''' if names is None: names = [] elif isinstance(names, basestring): names = [s.strip() for s in names.split(',') if s.strip()] data = self.get_xml("{}/workspaces.xml".format(self.service_url)) workspaces = [] workspaces.extend([workspace_from_index(self, node) for node in data.findall("workspace")]) if workspaces and names: return ([ws for ws in workspaces if ws.name in names]) return workspaces
def get_workspaces(self): description = self.get_xml("%s/workspaces.xml" % self.service_url) return [ workspace_from_index(self, node) for node in description.findall("workspace") ]
def get_default_workspace(self): ws = Workspace(self, "default") # must fetch and resolve the 'real' workspace from the response ws.fetch() return workspace_from_index(self, ws.dom)
def get_workspaces(self): description = self.get_xml("%s/workspaces.xml" % self.service_url) return [workspace_from_index(self, node) for node in description.findall("workspace")]