1
=== modified file 'aptdaemon/client.py'
2
--- aptdaemon/client.py 2009-10-04 11:51:44 +0000
3
+++ aptdaemon/client.py 2009-10-09 08:13:12 +0000
5
self._iface.Cancel(reply_handler=reply_handler,
6
error_handler=error_handler)
8
+ def set_http_proxy(self, proxy,
9
+ reply_handler=None, error_handler=None):
10
+ """Set the http_proxy property"""
11
+ self._proxy.Set("org.debian.apt.transaction",
13
+ dbus_interface=dbus.PROPERTIES_IFACE,
14
+ reply_handler=reply_handler,
15
+ error_handler=error_handler)
17
def set_allow_unauthenticated(self, allow_unauthenticated,
18
reply_handler=None, error_handler=None):
19
"""Set the allow_unauthenticated property"""
21
=== modified file 'aptdaemon/core.py'
22
--- aptdaemon/core.py 2009-10-06 07:09:22 +0000
23
+++ aptdaemon/core.py 2009-10-09 08:13:12 +0000
27
self.allow_unauthenticated = False
28
+ self.http_proxy = ""
34
self.locale = "%s.%s" % (lang, encoding)
36
+ def _set_http_proxy(self, proxy):
37
+ """Set a http network proxy
40
+ host - the proxy server
41
+ port - the proxy port
44
+ if (not proxy.startswith("http://") or
46
+ raise errors.InvalidProxyError(proxy)
47
+ logging.debug("http proxy set to '%s'" % proxy)
48
+ self.http_proxy = proxy
49
+ apt_pkg.Config.Set("Acquire::http::Proxy", self.http_proxy)
51
def _set_allow_unauthenticated(self, allow_unauthenticated):
52
"""Set the handling of unauthenticated packages
55
deferred.add_callback(lambda x: self._set_locale(value))
56
elif property == "AllowUnauthenticated":
57
deferred.add_callback(lambda x: self._set_allow_unauthenticated(value))
58
+ elif property == "HttpProxy":
59
+ deferred.add_callback(lambda x: self._set_http_proxy(value))
61
raise dbus.exceptions.DBusException("Unknown or read only "
62
"property: %s" % property)
64
"DebconfSocket": self.debconf,
65
"Paused": self.paused,
66
"AllowUnauthenticated": self.allow_unauthenticated,
67
+ "HttpProxy": self.http_proxy,
72
=== modified file 'aptdaemon/errors.py'
73
--- aptdaemon/errors.py 2009-10-04 12:17:51 +0000
74
+++ aptdaemon/errors.py 2009-10-09 08:13:12 +0000
79
+class InvalidProxyError(APTDError):
80
+ """Invalid proxy given"""
81
+ _dbus_error_name = "org.debian.apt.InvalidProxy"
82
+ def __init__(self, proxy):
83
+ APTDError.__init__(self, "InvalidProxyError: %s" % proxy)
85
class TransactionCancelled(APTDError):
86
"""Internal error if a transaction was cancelled."""
87
_dbus_error_name = "org.debian.apt.TransactionCancelled"
89
=== modified file 'aptdaemon/gtkwidgets.py'
90
--- aptdaemon/gtkwidgets.py 2009-10-04 09:27:44 +0000
91
+++ aptdaemon/gtkwidgets.py 2009-10-09 08:13:12 +0000
94
self.label_role.set_markup("<big><b>%s</b></big>" % role)
96
+ def _setup_http_proxy(self, transaction):
101
+ client = gconf.client_get_default()
102
+ if client.get_bool("/system/http_proxy/use_http_proxy"):
103
+ host = client.get_string("/system/http_proxy/host")
104
+ port = client.get_int("/system/http_proxy/port")
105
+ transaction.set_http_proxy("http://%s:%s/" % (host, port))
107
def set_transaction(self, transaction):
108
"""Connect the dialog to the given aptdaemon transaction"""
109
for sig in self._signals:
111
self._transaction = transaction
113
self._transaction.set_debconf_frontend("gnome")
114
+ self._setup_http_proxy(transaction)
116
def _on_medium_required(self, transaction, medium, drive):
117
dialog = AptMediumRequiredDialog(medium, drive, self)
119
=== modified file 'data/org.debian.apt.policy.in'
120
--- data/org.debian.apt.policy.in 2009-08-27 09:26:26 +0000
121
+++ data/org.debian.apt.policy.in 2009-10-09 08:13:12 +0000
124
<allow_any>auth_admin</allow_any>
125
<allow_inactive>auth_admin</allow_inactive>
126
- <allow_active>yes</allow_active>
127
+ <allow_active>auth_admin_keep</allow_active>