# Make the URL
return urllib.parse.urljoin(baseurl, url)
- def path_to_url(self, path):
+ def path_to_url(self, path, mirrored=False):
"""
Takes a path to a file on the file system and converts it into a URL
"""
- # Path to package
- path = os.path.join(
- "files", os.path.relpath(path, self.basepath),
- )
+ # Make the path relative
+ path = self.relpath(path)
+
+ # Send to the downloads load balancer
+ if mirrored:
+ return self.url_to("downloads", path)
- return self.url_to(path)
+ # Send them to the local file store
+ return self.url_to("files", path)
def pakfire(self, *args, **kwargs):
"""