コード例 #1
0
 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")
     ]
コード例 #2
0
    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
コード例 #3
0
 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")]
コード例 #4
0
    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
コード例 #5
0
    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
コード例 #6
0
ファイル: catalog.py プロジェクト: ischneider/gsconfig
 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")
     ]
コード例 #7
0
ファイル: catalog.py プロジェクト: ruben11291/master-thesis
 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)
コード例 #8
0
ファイル: catalog.py プロジェクト: ROGUE-JCTD/gsconfig.py
 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")]
コード例 #9
0
 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)