logfile = /var/log/pakfire.log
+# Pakfire can use a HTTP proxy for all downloads.
+# Authentication can be used like this:
+# http://foo:bar@192.168.180.1:800
+# If no proxy setting is configured, Pakfire will
+# use the environment settings.
+# http_proxy = http://192.168.180.1:800
+
# You can throttle the download bandwidth with this
# parameter. Unit: bytes per second.
# bandwidth_throttle = 10240
"""
Class to make some modifications on the urlgrabber configuration.
"""
- # XXX add proxy, throttle things here
-
def __init__(self, pakfire, *args, **kwargs):
kwargs.update({
"quote" : 0,
"user_agent" : "pakfire/%s" % PAKFIRE_VERSION,
})
- # Get Pakfire configuration
+ # Set throttle setting.
bandwidth_throttle = pakfire.config.get("bandwidth_throttle")
if bandwidth_throttle:
try:
kwargs.update({ "throttle" : bandwidth_throttle })
+ # Configure HTTP proxy.
+ http_proxy = pakfire.config.get("http_proxy")
+ if http_proxy:
+ kwargs.update({ "proxies" : { "http" : http_proxy }})
+
URLGrabber.__init__(self, *args, **kwargs)
# Get a package grabber and add mirror download capabilities to it.
grabber = downloader.PackageDownloader(
+ self.pakfire,
text=text + os.path.basename(filename),
)
grabber = self.mirrors.group(grabber)
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2011-08-03 23:16+0200\n"
+"POT-Creation-Date: 2011-08-03 23:34+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"