Merge lp:~azendale/software-properties/main into lp:software-properties

Proposed by Erik B. Andersen
Status: Merged
Approved by: Michael Vogt
Approved revision: 608
Merge reported by: Michael Vogt
Merged at revision: not available
Proposed branch: lp:~azendale/software-properties/main
Merge into: lp:software-properties
Diff against target: 81 lines (+14/-14)
2 files modified
softwareproperties/SoftwareProperties.py (+13/-13)
softwareproperties/ppa.py (+1/-1)
To merge this branch: bzr merge lp:~azendale/software-properties/main
Reviewer Review Type Date Requested Status
Michael Vogt (community) Approve
Review via email: mp+27464@code.launchpad.net

Description of the change

Fixed depreciation warnings in softwareproperties/ppa.py and softwareproperties/SoftwareProperties.py.
Should fix the warnings that running 'add-apt-repository' gives when adding a repository.

To test: run 'add-apt-repository ppa:whatever/ppa'
The old version will give you depreciation warnings about line 114 in SoftwareProperties.py and line 43 in ppa.py.
The new version won't give you any depreciation warnings.

software-properties-gtk test:
Run 'sudo software-properties-gtk'. With the old version multiple depreciation warnings are given. With the new version there should be none.

To post a comment you must log in.
608. By Erik B. Andersen

softwareproperties/SoftwareProperties.py changed to use find_i instead of FindI; fixes depreciation warnings while running software-properties-gtk

Revision history for this message
Michael Vogt (mvo) wrote :

Many thanks, patch looks good!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'softwareproperties/SoftwareProperties.py'
2--- softwareproperties/SoftwareProperties.py 2010-03-26 13:18:23 +0000
3+++ softwareproperties/SoftwareProperties.py 2010-06-14 02:24:26 +0000
4@@ -111,7 +111,7 @@
5 """Backup all apt configuration options"""
6 self.apt_conf_backup = {}
7 for option in softwareproperties.CONF_MAP.keys():
8- value = apt_pkg.Config.FindI(softwareproperties.CONF_MAP[option])
9+ value = apt_pkg.Config.find_i(softwareproperties.CONF_MAP[option])
10 self.apt_conf_backup[option] = value
11
12 def restore_apt_conf(self):
13@@ -125,21 +125,21 @@
14 """ Parse the apt cron configuration. Try to fit a predefined use case
15 and return it. Special case: if the user made a custom
16 configurtation, that we cannot represent it will return None """
17- if apt_pkg.Config.FindI(softwareproperties.CONF_MAP["autoupdate"]) > 0:
18+ if apt_pkg.Config.find_i(softwareproperties.CONF_MAP["autoupdate"]) > 0:
19 # Autodownload
20- if apt_pkg.Config.FindI(softwareproperties.CONF_MAP["unattended"]) == 1\
21- and apt_pkg.Config.FindI(softwareproperties.CONF_MAP["autodownload"]) == 1 :
22+ if apt_pkg.Config.find_i(softwareproperties.CONF_MAP["unattended"]) == 1\
23+ and apt_pkg.Config.find_i(softwareproperties.CONF_MAP["autodownload"]) == 1 :
24 return softwareproperties.UPDATE_INST_SEC
25- elif apt_pkg.Config.FindI(softwareproperties.CONF_MAP["autodownload"]) == 1 and \
26- apt_pkg.Config.FindI(softwareproperties.CONF_MAP["unattended"]) == 0:
27+ elif apt_pkg.Config.find_i(softwareproperties.CONF_MAP["autodownload"]) == 1 and \
28+ apt_pkg.Config.find_i(softwareproperties.CONF_MAP["unattended"]) == 0:
29 return softwareproperties.UPDATE_DOWNLOAD
30- elif apt_pkg.Config.FindI(softwareproperties.CONF_MAP["unattended"]) == 0 and \
31- apt_pkg.Config.FindI(softwareproperties.CONF_MAP["autodownload"]) == 0:
32+ elif apt_pkg.Config.find_i(softwareproperties.CONF_MAP["unattended"]) == 0 and \
33+ apt_pkg.Config.find_i(softwareproperties.CONF_MAP["autodownload"]) == 0:
34 return softwareproperties.UPDATE_NOTIFY
35 else:
36 return None
37- elif apt_pkg.Config.FindI(softwareproperties.CONF_MAP["unattended"]) == 0 and \
38- apt_pkg.Config.FindI(softwareproperties.CONF_MAP["autodownload"]) == 0:
39+ elif apt_pkg.Config.find_i(softwareproperties.CONF_MAP["unattended"]) == 0 and \
40+ apt_pkg.Config.find_i(softwareproperties.CONF_MAP["autodownload"]) == 0:
41 return softwareproperties.UPDATE_MANUAL
42 else:
43 return None
44@@ -167,13 +167,13 @@
45 def set_update_interval(self, days):
46 """Set the interval in which we check for available updates"""
47 # Only write the key if it has changed
48- if not days == apt_pkg.Config.FindI(softwareproperties.CONF_MAP["autoupdate"]):
49+ if not days == apt_pkg.Config.find_i(softwareproperties.CONF_MAP["autoupdate"]):
50 apt_pkg.Config.Set(softwareproperties.CONF_MAP["autoupdate"], str(days))
51 self.set_modified_config()
52
53 def get_update_interval(self):
54 """ Returns the interval of the apt periodic cron job """
55- return apt_pkg.Config.FindI(softwareproperties.CONF_MAP["autoupdate"])
56+ return apt_pkg.Config.find_i(softwareproperties.CONF_MAP["autoupdate"])
57
58 def get_release_upgrades_policy(self):
59 """
60@@ -579,7 +579,7 @@
61
62 # and append the updated keys
63 for i in cnf.List():
64- f.write("APT::Periodic::%s \"%s\";\n" % (i, cnf.FindI(i)))
65+ f.write("APT::Periodic::%s \"%s\";\n" % (i, cnf.find_i(i)))
66 f.close()
67
68 def save_sourceslist(self):
69
70=== modified file 'softwareproperties/ppa.py'
71--- softwareproperties/ppa.py 2010-04-14 07:04:11 +0000
72+++ softwareproperties/ppa.py 2010-06-14 02:24:26 +0000
73@@ -40,7 +40,7 @@
74 ppa_name = abrev.split("/")[1]
75 except IndexError, e:
76 ppa_name = "ppa"
77- sourceslistd = apt_pkg.Config.FindDir("Dir::Etc::sourceparts")
78+ sourceslistd = apt_pkg.Config.find_dir("Dir::Etc::sourceparts")
79 line = "deb http://ppa.launchpad.net/%s/%s/ubuntu %s main" % (
80 ppa_owner, ppa_name, distro_codename)
81 file = "%s/%s-%s-%s.list" % (

Subscribers

People subscribed via source and target branches

to status/vote changes: