diff options
| author | Sebastian Heinlein <sebastian.heinlein@web.de> | 2006-02-07 14:40:48 +0100 |
|---|---|---|
| committer | Sebastian Heinlein <sebastian.heinlein@web.de> | 2006-02-07 14:40:48 +0100 |
| commit | b8161e6b173f9f336295bbb5d5ff776ccb0dfea4 (patch) | |
| tree | 7d99412df519ec57f9ec4bea15353f25cec11620 /SoftwareProperties/SoftwareProperties.py | |
| parent | 5073b91679242238428c1c6b5c967ae67ff4643b (diff) | |
| download | python-apt-b8161e6b173f9f336295bbb5d5ff776ccb0dfea4.tar.gz | |
* Add an option for unattended security installs
Diffstat (limited to 'SoftwareProperties/SoftwareProperties.py')
| -rw-r--r-- | SoftwareProperties/SoftwareProperties.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index b1d557d4..4254a3ee 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -48,6 +48,7 @@ CONF_MAP = { "autoupdate" : "APT::Periodic::Update-Package-Lists", "autodownload" : "APT::Periodic::Download-Upgradeable-Packages", "autoclean" : "APT::Periodic::AutocleanInterval", + "unattended" : "APT::Periodic::Unattended-Upgrade", "max_size" : "APT::Archives::MaxSize", "max_age" : "APT::Archives::MaxAge" } @@ -151,6 +152,21 @@ class SoftwareProperties(SimpleGladeApp): else: self.checkbutton_auto_download.set_active(False) + # Unattended updates + if os.path.exists("/usr/bin/unattended-upgrade"): + # FIXME: we should always show the option. if unattended-upgrades is + # not installed a dialog should popup and allow the user to install + # unattended-upgrade + #self.checkbutton_unattended.set_sensitive(True) + self.checkbutton_unattended.show() + else: + #self.checkbutton_unattended.set_sensitive(False) + self.checkbutton_unattended.hide() + if apt_pkg.Config.FindI(CONF_MAP["unattended"]) == 1: + self.checkbutton_unattended.set_active(True) + else: + self.checkbutton_unattended.set_active(False) + # apt-key stuff self.apt_key = apt_key() self.init_keyslist() @@ -228,6 +244,16 @@ class SoftwareProperties(SimpleGladeApp): # FIXME: Write config options, apt_pkg should be able to do this. self.write_config() + def on_opt_unattended_toggled(self, widget): + if self.checkbutton_unattended.get_active(): + self.checkbutton_unattended.set_active(True) + apt_pkg.Config.Set(CONF_MAP["unattended"], str(1)) + else: + self.checkbutton_unattended.set_active(False) + apt_pkg.Config.Set(CONF_MAP["unattended"], str(0)) + # FIXME: Write config options, apt_pkg should be able to do this. + self.write_config() + def on_opt_autodownload_toggled(self, widget): if self.checkbutton_auto_download.get_active(): self.checkbutton_auto_download.set_active(True) |
