Esempio n. 1
0
 def __init__(self, base_url, alias, repo_id):
     """
     :param base_url: The base URL.
     :type base_url: str
     :param alias: The httpd alias (base_url, publish_dir)
     :type alias: tuple(2)
     :param repo_id: A repository ID.
     :type repo_id: str
     """
     self.base_url = base_url
     self.alias = alias
     FilePublisher.__init__(self, alias[1], repo_id)
Esempio n. 2
0
 def link(self, units):
     # Add the URL to each unit.
     links = FilePublisher.link(self, units)
     for unit, relative_path in links:
         url = join(self.base_url, self.alias[0], relative_path)
         unit["_download"] = dict(url=url)
     return links