示例#1
0
 def _resolve_style(self, element):
     if ":" in element.find('name').text:
         ws_name, style_name = element.find('name').text.split(':')
     else:
         style_name = element.find('name').text
         ws_name = None
     atom_link = [n for n in element.getchildren() if 'href' in n.attrib]
     if atom_link and ws_name is None:
         ws_name = workspace_from_url(atom_link[0].get("href"))
     return self.catalog.get_styles(names=style_name, workspaces=ws_name)[0]
示例#2
0
 def _resolve_style(self, element):
     if ":" in element.find('name').text:
         ws_name, style_name = element.find('name').text.split(':')
     else:
         style_name = element.find('name').text
         ws_name = None
     atom_link = [n for n in element.getchildren() if 'href' in n.attrib]
     if atom_link and ws_name is None:
         ws_name = workspace_from_url(atom_link[0].get("href"))
     return self.catalog.get_styles(names=style_name, workspaces=ws_name)[0]
示例#3
0
 def resource(self):
     if self.dom is None:
         self.fetch()
     name = self.dom.find("resource/name").text
     atom_link = [n for n in self.dom.find("resource").getchildren() if 'href' in n.attrib]
     ws_name = workspace_from_url(atom_link[0].get('href'))
     if self.gs_version >= "2.13":
         if ":" in name:
             ws_name, name = name.split(':')
     return self.catalog.get_resources(names=name, workspaces=ws_name)[0]
示例#4
0
 def resource(self):
     if self.dom is None:
         self.fetch()
     name = self.dom.find("resource/name").text
     atom_link = [
         n for n in self.dom.find("resource").getchildren()
         if 'href' in n.attrib
     ]
     ws_name = workspace_from_url(atom_link[0].get('href'))
     if self.gs_version >= "2.13":
         if ":" in name:
             ws_name, name = name.split(':')
     store_name = resource_from_url(atom_link[0].get('href'), ws_name)
     _resources = self.catalog.get_resources(names=[name],
                                             stores=[store_name],
                                             workspaces=[ws_name])
     return _resources[0] if len(_resources) > 0 else _resources