Merge lp:~dstansby-deactivatedaccount/language-selector/bugfix-lp-598619 into lp:language-selector

Proposed by David Stansby
Status: Rejected
Rejected by: Sebastien Bacher
Proposed branch: lp:~dstansby-deactivatedaccount/language-selector/bugfix-lp-598619
Merge into: lp:language-selector
Diff against target: 443 lines (+104/-104)
3 files modified
LanguageSelector/CheckLanguageSupport.py (+27/-27)
LanguageSelector/LangCache.py (+39/-39)
LanguageSelector/LanguageSelector.py (+38/-38)
To merge this branch: bzr merge lp:~dstansby-deactivatedaccount/language-selector/bugfix-lp-598619
Reviewer Review Type Date Requested Status
Ubuntu Core Development Team Pending
Review via email: mp+28585@code.launchpad.net

Description of the change

Fixed some deprecated variables

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

Similar changes have landed in 0.6.1 so closing this merge request

Unmerged revisions

371. By David Stansby

Fixed deprecated variables

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'LanguageSelector/CheckLanguageSupport.py'
2--- LanguageSelector/CheckLanguageSupport.py 2010-05-26 14:40:53 +0000
3+++ LanguageSelector/CheckLanguageSupport.py 2010-06-27 09:34:31 +0000
4@@ -33,7 +33,7 @@
5 for x in scanlist:
6 pkg = '%s-%s' % (x, pkgcode)
7 if pkg in self._cache:
8- if not self._cache[pkg].isInstalled and \
9+ if not self._cache[pkg].is_installed and \
10 not self._cache[pkg].markedInstall:
11 self.missing.add(pkg)
12 else:
13@@ -45,23 +45,23 @@
14 if pkg in packages and \
15 pkg in self._cache and \
16 translation in self._cache:
17- if ((not self._cache[translation].isInstalled and \
18+ if ((not self._cache[translation].is_installed and \
19 not self._cache[translation].markedInstall and \
20- not self._cache[translation].markedUpgrade) or \
21- self._cache[translation].markedDelete):
22+ not self._cache[translation].marked_marked_upgrade) or \
23+ self._cache[translation].marked_delete):
24 self.missing.add(translation)
25 else:
26 self.installed.add(translation)
27 else:
28 if pkg in self._cache and \
29- (self._cache[pkg].isInstalled or \
30+ (self._cache[pkg].is_installed or \
31 self._cache[pkg].markedInstall or \
32- self._cache[pkg].markedUpgrade) and \
33+ self._cache[pkg].marked_marked_upgrade) and \
34 translation in self._cache:
35- if ((not self._cache[translation].isInstalled and \
36+ if ((not self._cache[translation].is_installed and \
37 not self._cache[translation].markedInstall and \
38- not self._cache[translation].markedUpgrade) or \
39- self._cache[translation].markedDelete):
40+ not self._cache[translation].marked_marked_upgrade) or \
41+ self._cache[translation].marked_delete):
42 self.missing.add(translation)
43 else:
44 self.installed.add(translation)
45@@ -69,7 +69,7 @@
46 if pkgcode in self.pkg_writing and \
47 (pkgcode == self.system_pkgcode or \
48 ('language-support-writing-%s' % pkgcode in self._cache and \
49- self._cache['language-support-writing-%s' % pkgcode].isInstalled) or \
50+ self._cache['language-support-writing-%s' % pkgcode].is_installed) or \
51 ('language-support-writing-%s' % pkgcode in self._cache and \
52 self._cache['language-support-writing-%s' % pkgcode].markInstall) or \
53 ('language-support-writing-%s' % pkgcode in self._cache and \
54@@ -82,24 +82,24 @@
55 if p in packages and \
56 p in self._cache and \
57 pull_pkg in self._cache:
58- if ((not self._cache[pull_pkg].isInstalled and \
59+ if ((not self._cache[pull_pkg].is_installed and \
60 not self._cache[pull_pkg].markedInstall and \
61- not self._cache[pull_pkg].markedUpgrade) or \
62- self._cache[pull_pkg].markedDelete):
63+ not self._cache[pull_pkg].marked_marked_upgrade) or \
64+ self._cache[pull_pkg].marked_delete):
65 self.missing.add(pull_pkg)
66 else:
67 self.installed.add(pull_pkg)
68 break
69 else:
70 if p in self._cache and \
71- (self._cache[p].isInstalled or \
72+ (self._cache[p].is_installed or \
73 self._cache[p].markedInstall or \
74- self._cache[p].markedUpgrade) and \
75+ self._cache[p].marked_marked_upgrade) and \
76 pull_pkg in self._cache:
77- if ((not self._cache[pull_pkg].isInstalled and \
78+ if ((not self._cache[pull_pkg].is_installed and \
79 not self._cache[pull_pkg].markedInstall and \
80- not self._cache[pull_pkg].markedUpgrade) or \
81- self._cache[pull_pkg].markedDelete):
82+ not self._cache[pull_pkg].marked_marked_upgrade) or \
83+ self._cache[pull_pkg].marked_delete):
84 self.missing.add(pull_pkg)
85 else:
86 self.installed.add(pull_pkg)
87@@ -109,23 +109,23 @@
88 if pkg in packages and \
89 pkg in self._cache and \
90 pull_pkg in self._cache:
91- if ((not self._cache[pull_pkg].isInstalled and \
92+ if ((not self._cache[pull_pkg].is_installed and \
93 not self._cache[pull_pkg].markedInstall and \
94- not self._cache[pull_pkg].markedUpgrade) or \
95- self._cache[pull_pkg].markedDelete):
96+ not self._cache[pull_pkg].marked_marked_upgrade) or \
97+ self._cache[pull_pkg].marked_delete):
98 self.missing.add(pull_pkg)
99 else:
100 self.installed.add(pull_pkg)
101 else:
102 if pkg in self._cache and \
103- (self._cache[pkg].isInstalled or \
104+ (self._cache[pkg].is_installed or \
105 self._cache[pkg].markedInstall or \
106- self._cache[pkg].markedUpgrade) and \
107+ self._cache[pkg].marked_marked_upgrade) and \
108 pull_pkg in self._cache:
109- if ((not self._cache[pull_pkg].isInstalled and \
110+ if ((not self._cache[pull_pkg].is_installed and \
111 not self._cache[pull_pkg].markedInstall and \
112- not self._cache[pull_pkg].markedUpgrade) or \
113- self._cache[pull_pkg].markedDelete):
114+ not self._cache[pull_pkg].marked_marked_upgrade) or \
115+ self._cache[pull_pkg].marked_delete):
116 self.missing.add(pull_pkg)
117 else:
118 self.installed.add(pull_pkg)
119@@ -295,7 +295,7 @@
120 not item.startswith('language-pack-gnome') and \
121 not item.startswith('language-pack-kde') and \
122 not item.endswith('-base') and \
123- (self._cache[item].isInstalled or \
124+ (self._cache[item].is_installed or \
125 self._cache[item].markedInstall):
126 pkgcode = item.replace('language-pack-', '')
127 pkgcodes.append(pkgcode)
128
129=== modified file 'LanguageSelector/LangCache.py'
130--- LanguageSelector/LangCache.py 2010-05-28 10:42:08 +0000
131+++ LanguageSelector/LangCache.py 2010-06-27 09:34:31 +0000
132@@ -39,7 +39,7 @@
133 pkgname = langpkg_status.pkgname_template % languageCode
134 langpkg_status.available = pkgname in cache
135 if langpkg_status.available:
136- langpkg_status.installed = cache[pkgname].isInstalled
137+ langpkg_status.installed = cache[pkgname].is_installed
138
139 @property
140 def inconsistent(self):
141@@ -81,7 +81,7 @@
142
143 def __init__(self, localeinfo, progress):
144 apt.Cache.__init__(self, progress)
145- if self._depcache.BrokenCount > 0:
146+ if self._depcache.broken_count > 0:
147 raise ExceptionPkgCacheBroken()
148 self._localeinfo = localeinfo
149 # keep the lists
150@@ -190,15 +190,15 @@
151 @property
152 def havePackageLists(self):
153 " verify that a network package lists exists "
154- for metaindex in self._list.List:
155- for indexfile in metaindex.IndexFiles:
156- if indexfile.ArchiveURI("").startswith("cdrom:"):
157- continue
158- if indexfile.ArchiveURI("").startswith("http://security.ubuntu.com"):
159- continue
160- if indexfile.Label != "Debian Package Index":
161- continue
162- if indexfile.Exists and indexfile.HasPackages:
163+ for metaindex in self._list.list:
164+ for indexfile in metaindex.index_files:
165+ if indexfile.archive_uri("").startswith("cdrom:"):
166+ continue
167+ if indexfile.archive_uri("").startswith("http://security.ubuntu.com"):
168+ continue
169+ if indexfile.label != "Debian Package Index":
170+ continue
171+ if indexfile.exists and indexfile.has_packageiss:
172 return True
173 return False
174
175@@ -218,9 +218,9 @@
176 to_inst = []
177 to_rm = []
178 for pkg in self.getChanges():
179- if pkg.markedInstall or pkg.markedUpgrade:
180+ if pkg.markedInstall or pkg.marked_marked_upgrade:
181 to_inst.append(pkg.name)
182- if pkg.markedDelete:
183+ if pkg.marked_delete:
184 to_rm.append(pkg.name)
185 return (to_inst,to_rm)
186
187@@ -233,7 +233,7 @@
188 "language-pack-%s"%languageCode]
189 # see what additional pkgs are needed
190 #for (pkg, translation) in self.pkg_translations[languageCode]:
191- # if pkg in self and self[pkg].isInstalled:
192+ # if pkg in self and self[pkg].is_installed:
193 # pkg_list.append(translation)
194 return pkg_list
195
196@@ -266,22 +266,22 @@
197 if lang_pack_status.available and not lang_pack_status.installed:
198 for (pkg, translation) in self.pkg_translations[lang_pack_status.languageCode]:
199 if pkg in self and \
200- (self[pkg].isInstalled or \
201+ (self[pkg].is_installed or \
202 self[pkg].markedInstall or \
203- self[pkg].markedUpgrade) and \
204+ self[pkg].marked_marked_upgrade) and \
205 translation in self and \
206- ((not self[translation].isInstalled and \
207+ ((not self[translation].is_installed and \
208 not self[translation].markedInstall and \
209- not self[translation].markedUpgrade) or \
210- self[translation].markedDelete):
211+ not self[translation].marked_marked_upgrade) or \
212+ self[translation].marked_delete):
213 self[translation].markInstall()
214 #print ("Will pull: %s" % translation)
215 elif lang_pack_status.installed:
216 for (pkg, translation) in self.pkg_translations[lang_pack_status.languageCode]:
217 if translation in self and \
218- (self[translation].isInstalled or \
219+ (self[translation].is_installed or \
220 self[translation].markedInstall or \
221- self[translation].markedUpgrade):
222+ self[translation].marked_marked_upgrade):
223 self[translation].markDelete()
224 #print ("Will remove: %s" % translation)
225
226@@ -296,24 +296,24 @@
227 # multiple dependencies, if one of them is installed, pull the pull_pkg
228 for p in pkg.split('|'):
229 if p in self and \
230- (self[p].isInstalled or \
231+ (self[p].is_installed or \
232 self[p].markedInstall or \
233- self[p].markedUpgrade) and \
234- ((not self[pull_pkg].isInstalled and \
235+ self[p].marked_marked_upgrade) and \
236+ ((not self[pull_pkg].is_installed and \
237 not self[pull_pkg].markedInstall and \
238- not self[pull_pkg].markedUpgrade) or \
239- self[pull_pkg].markedDelete):
240+ not self[pull_pkg].marked_marked_upgrade) or \
241+ self[pull_pkg].marked_delete):
242 self[pull_pkg].markInstall()
243 #print ("Will pull: %s" % pull_pkg)
244 else:
245 if pkg in self and \
246- (self[pkg].isInstalled or \
247+ (self[pkg].is_installed or \
248 self[pkg].markedInstall or \
249- self[pkg].markedUpgrade) and \
250- ((not self[pull_pkg].isInstalled and \
251+ self[pkg].marked_marked_upgrade) and \
252+ ((not self[pull_pkg].is_installed and \
253 not self[pull_pkg].markedInstall and \
254- not self[pull_pkg].markedUpgrade) or \
255- self[pull_pkg].markedDelete):
256+ not self[pull_pkg].marked_marked_upgrade) or \
257+ self[pull_pkg].marked_delete):
258 self[pull_pkg].markInstall()
259 #print ("Will pull: %s" % pull_pkg)
260 elif writing_aid_status.installed and writing_aid_status.doChange:
261@@ -328,25 +328,25 @@
262 for l in self.multilang[pull_pkg]:
263 p = "language-support-writing-%s" % l
264 if p in self and \
265- (self[p].isInstalled or \
266+ (self[p].is_installed or \
267 self[p].markedInstall or \
268- self[p].markedUpgrade) and \
269- not self[p].markedDelete:
270+ self[p].marked_marked_upgrade) and \
271+ not self[p].marked_delete:
272 lcount = lcount+1
273 if '|' in pkg:
274 # multiple dependencies, if at least one of them is installed, keep the pull_pkg
275 # only remove pull_pkg if none of the dependencies are installed anymore
276 for p in pkg.split('|'):
277 if p in self and \
278- (self[p].isInstalled or \
279+ (self[p].is_installed or \
280 self[p].markedInstall or \
281- self[p].markedUpgrade) and \
282- not self[p].markedDelete:
283+ self[p].marked_marked_upgrade) and \
284+ not self[p].marked_delete:
285 pcount = pcount+1
286 if pcount == 0 and lcount == 0 and \
287- (self[pull_pkg].isInstalled or \
288+ (self[pull_pkg].is_installed or \
289 self[pull_pkg].markedInstall or \
290- self[pull_pkg].markedUpgrade):
291+ self[pull_pkg].marked_marked_upgrade):
292 self[pull_pkg].markDelete()
293 #print ("Will remove: %s" % pull_pkg)
294
295
296=== modified file 'LanguageSelector/LanguageSelector.py'
297--- LanguageSelector/LanguageSelector.py 2010-05-27 08:12:43 +0000
298+++ LanguageSelector/LanguageSelector.py 2010-06-27 09:34:31 +0000
299@@ -52,32 +52,32 @@
300 trans_package = "language-pack-%s" % langInfo.languageCode
301 # we have a langpack installed, see if we have all of them
302 if (trans_package in self._cache and \
303- (self._cache[trans_package].isInstalled or \
304+ (self._cache[trans_package].is_installed or \
305 self._cache[trans_package].markedInstall or \
306- self._cache[trans_package].markedUpgrade) and \
307- not self._cache[trans_package].markedDelete):
308+ self._cache[trans_package].marked_marked_upgrade) and \
309+ not self._cache[trans_package].marked_delete):
310 #print "IsInstalled: %s " % trans_package
311 #print self._cache.pkg_translations[langInfo.languageCode]
312 if langInfo.languageCode in self._cache.pkg_translations:
313 for (pkg, translation) in self._cache.pkg_translations[langInfo.languageCode]:
314 if (pkg in self._cache and \
315- (self._cache[pkg].isInstalled or \
316+ (self._cache[pkg].is_installed or \
317 self._cache[pkg].markedInstall or \
318- self._cache[pkg].markedUpgrade) and \
319- not self._cache[pkg].markedDelete and \
320+ self._cache[pkg].marked_marked_upgrade) and \
321+ not self._cache[pkg].marked_delete and \
322 translation in self._cache and \
323- ((not self._cache[translation].isInstalled and \
324+ ((not self._cache[translation].is_installed and \
325 not self._cache[translation].markedInstall and \
326- not self._cache[translation].markedUpgrade) or \
327- self._cache[translation].markedDelete) and \
328+ not self._cache[translation].marked_marked_upgrade) or \
329+ self._cache[translation].marked_delete) and \
330 not translation in missing):
331 missing.append(translation)
332 trans_package = "language-support-writing-%s" % langInfo.languageCode
333 # we have a langsupport-writing installed, see if we have all of them
334 if (trans_package in self._cache and
335- (self._cache[trans_package].isInstalled or \
336+ (self._cache[trans_package].is_installed or \
337 self._cache[trans_package].markedInstall or \
338- self._cache[trans_package].markedUpgrade)):
339+ self._cache[trans_package].marked_marked_upgrade)):
340 #print "IsInstalled: %s " % trans_package
341 #print self._cache.pkg_writing[langInfo.languageCode]
342 if langInfo.languageCode in self._cache.pkg_writing:
343@@ -86,28 +86,28 @@
344 # multiple dependencies, if one of them is installed, pull the pull_pkg
345 for p in pkg.split('|'):
346 if self._cache[p] and \
347- (self._cache[p].isInstalled or \
348+ (self._cache[p].is_installed or \
349 self._cache[p].markedInstall or \
350- self._cache[p].markedUpgrade) and \
351- not self._cache[p].markedDelete and \
352+ self._cache[p].marked_marked_upgrade) and \
353+ not self._cache[p].marked_delete and \
354 pull_pkg in self._cache and \
355- ((not self._cache[pull_pkg].isInstalled and \
356+ ((not self._cache[pull_pkg].is_installed and \
357 not self._cache[pull_pkg].markedInstall and \
358- not self._cache[pull_pkg].markedUpgrade) or \
359- self._cache[pull_pkg].markedDelete) and \
360+ not self._cache[pull_pkg].marked_marked_upgrade) or \
361+ self._cache[pull_pkg].marked_delete) and \
362 not pull_pkg in missing:
363 missing.append(pull_pkg)
364 else:
365 if pkg in self._cache and \
366- (self._cache[pkg].isInstalled or \
367+ (self._cache[pkg].is_installed or \
368 self._cache[pkg].markedInstall or \
369- self._cache[pkg].markedUpgrade) and \
370- not self._cache[pkg].markedDelete and \
371+ self._cache[pkg].marked_marked_upgrade) and \
372+ not self._cache[pkg].marked_delete and \
373 pull_pkg in self._cache and \
374- ((not self._cache[pull_pkg].isInstalled and \
375+ ((not self._cache[pull_pkg].is_installed and \
376 not self._cache[pull_pkg].markedInstall and \
377- not self._cache[pull_pkg].markedUpgrade) or \
378- self._cache[pull_pkg].markedDelete) and \
379+ not self._cache[pull_pkg].marked_marked_upgrade) or \
380+ self._cache[pull_pkg].marked_delete) and \
381 not pull_pkg in missing:
382 missing.append(pull_pkg)
383
384@@ -125,16 +125,16 @@
385 # pkgcode = self._cache.langpack_locales[default_lang]
386 trans_package = "language-pack-%s" % pkgcode
387 if (trans_package in self._cache and
388- not self._cache[trans_package].isInstalled):
389+ not self._cache[trans_package].is_installed):
390 missing += [trans_package]
391 if pkgcode in self._cache.pkg_translations:
392 for (pkg, translation) in self._cache.pkg_translations[pkgcode]:
393- if (self._cache[pkg].isInstalled and not self._cache[translation].isInstalled):
394+ if (self._cache[pkg].is_installed and not self._cache[translation].is_installed):
395 missing.append(translation)
396 support_packages = LanguageSelectorPkgCache._getPkgList(self._cache, pkgcode)
397 for support_package in support_packages:
398 if (support_package in self._cache and
399- not self._cache[support_package].isInstalled):
400+ not self._cache[support_package].is_installed):
401 missing.append(support_package)
402
403 if pkgcode in self._cache.pkg_writing:
404@@ -143,28 +143,28 @@
405 # multiple dependencies, if one of them is installed, pull the pull_pkg
406 for p in pkg.split('|'):
407 if self._cache[p] and \
408- (self._cache[p].isInstalled or \
409+ (self._cache[p].is_installed or \
410 self._cache[p].markedInstall or \
411- self._cache[p].markedUpgrade) and \
412- not self._cache[p].markedDelete and \
413+ self._cache[p].marked_marked_upgrade) and \
414+ not self._cache[p].marked_delete and \
415 pull_pkg in self._cache and \
416- ((not self._cache[pull_pkg].isInstalled and \
417+ ((not self._cache[pull_pkg].is_installed and \
418 not self._cache[pull_pkg].markedInstall and \
419- not self._cache[pull_pkg].markedUpgrade) or \
420- self._cache[pull_pkg].markedDelete) and \
421+ not self._cache[pull_pkg].marked_marked_upgrade) or \
422+ self._cache[pull_pkg].marked_delete) and \
423 not pull_pkg in missing:
424 missing.append(pull_pkg)
425 else:
426 if pkg in self._cache and \
427- (self._cache[pkg].isInstalled or \
428+ (self._cache[pkg].is_installed or \
429 self._cache[pkg].markedInstall or \
430- self._cache[pkg].markedUpgrade) and \
431- not self._cache[pkg].markedDelete and \
432+ self._cache[pkg].marked_marked_upgrade) and \
433+ not self._cache[pkg].marked_delete and \
434 pull_pkg in self._cache and \
435- ((not self._cache[pull_pkg].isInstalled and \
436+ ((not self._cache[pull_pkg].is_installed and \
437 not self._cache[pull_pkg].markedInstall and \
438- not self._cache[pull_pkg].markedUpgrade) or \
439- self._cache[pull_pkg].markedDelete) and \
440+ not self._cache[pull_pkg].marked_marked_upgrade) or \
441+ self._cache[pull_pkg].marked_delete) and \
442 not pull_pkg in missing:
443 missing.append(pull_pkg)
444

Subscribers

People subscribed via source and target branches

to all changes: