* [gentoo-commits] portage r14360 - in main/branches/prefix/pym: _emerge portage portage/cache portage/dbapi
@ 2009-09-21 19:26 Fabian Groffen (grobian)
0 siblings, 0 replies; only message in thread
From: Fabian Groffen (grobian) @ 2009-09-21 19:26 UTC (permalink / raw
To: gentoo-commits
Author: grobian
Date: 2009-09-21 19:26:47 +0000 (Mon, 21 Sep 2009)
New Revision: 14360
Modified:
main/branches/prefix/pym/_emerge/BlockerDB.py
main/branches/prefix/pym/_emerge/MetadataRegen.py
main/branches/prefix/pym/_emerge/depgraph.py
main/branches/prefix/pym/_emerge/unmerge.py
main/branches/prefix/pym/_emerge/userquery.py
main/branches/prefix/pym/portage/cache/mappings.py
main/branches/prefix/pym/portage/cache/sqlite.py
main/branches/prefix/pym/portage/dbapi/porttree.py
main/branches/prefix/pym/portage/dep.py
Log:
Merged from trunk -r14354:14358
| 14355 | Use next(iterator) instead of iterator.next() for |
| arfrever | compatibility with Python 3. (2to3-3.1 -f next -nw |
| | ${FILES}) |
| 14357 | Decode database name passed to |
| arfrever | portage.cache.sqlite.database._db_module.connect() for |
| | compatibility with Python 3. |
| 14358 | Use input() instead of raw_input() when Python 3 is used. |
| arfrever | |
Modified: main/branches/prefix/pym/_emerge/BlockerDB.py
===================================================================
--- main/branches/prefix/pym/_emerge/BlockerDB.py 2009-09-21 19:00:57 UTC (rev 14359)
+++ main/branches/prefix/pym/_emerge/BlockerDB.py 2009-09-21 19:26:47 UTC (rev 14360)
@@ -119,7 +119,7 @@
blocker_atoms = InternalPackageSet(initial_atoms=blocker_atoms)
for inst_pkg in installed_pkgs:
try:
- blocker_atoms.iterAtomsForPackage(inst_pkg).next()
+ next(blocker_atoms.iterAtomsForPackage(inst_pkg))
except (portage.exception.InvalidDependString, StopIteration):
continue
blocking_pkgs.add(inst_pkg)
Modified: main/branches/prefix/pym/_emerge/MetadataRegen.py
===================================================================
--- main/branches/prefix/pym/_emerge/MetadataRegen.py 2009-09-21 19:00:57 UTC (rev 14359)
+++ main/branches/prefix/pym/_emerge/MetadataRegen.py 2009-09-21 19:26:47 UTC (rev 14360)
@@ -135,7 +135,7 @@
"""
while self._can_add_job():
try:
- metadata_process = self._process_iter.next()
+ metadata_process = next(self._process_iter)
except StopIteration:
return False
Modified: main/branches/prefix/pym/_emerge/depgraph.py
===================================================================
--- main/branches/prefix/pym/_emerge/depgraph.py 2009-09-21 19:00:57 UTC (rev 14359)
+++ main/branches/prefix/pym/_emerge/depgraph.py 2009-09-21 19:26:47 UTC (rev 14360)
@@ -747,7 +747,7 @@
myarg = None
if dep.root == self._frozen_config.target_root:
try:
- myarg = self._iter_atoms_for_pkg(dep_pkg).next()
+ myarg = next(self._iter_atoms_for_pkg(dep_pkg))
except StopIteration:
pass
except portage.exception.InvalidDependString:
@@ -1463,7 +1463,7 @@
installed_cp_set = non_virtual_cps
if len(expanded_atoms) > 1 and len(installed_cp_set) == 1:
- installed_cp = iter(installed_cp_set).next()
+ installed_cp = next(iter(installed_cp_set))
expanded_atoms = [atom for atom in expanded_atoms \
if atom.cp == installed_cp]
@@ -2280,7 +2280,7 @@
myarg = None
if root == self._frozen_config.target_root:
try:
- myarg = self._iter_atoms_for_pkg(pkg).next()
+ myarg = next(self._iter_atoms_for_pkg(pkg))
except StopIteration:
pass
except portage.exception.InvalidDependString:
@@ -4925,7 +4925,7 @@
def _visible(self, pkg):
if pkg.installed and "selective" not in self._depgraph._dynamic_config.myparams:
try:
- arg = self._depgraph._iter_atoms_for_pkg(pkg).next()
+ arg = next(self._depgraph._iter_atoms_for_pkg(pkg))
except (StopIteration, portage.exception.InvalidDependString):
arg = None
if arg:
Modified: main/branches/prefix/pym/_emerge/unmerge.py
===================================================================
--- main/branches/prefix/pym/_emerge/unmerge.py 2009-09-21 19:00:57 UTC (rev 14359)
+++ main/branches/prefix/pym/_emerge/unmerge.py 2009-09-21 19:26:47 UTC (rev 14360)
@@ -404,7 +404,7 @@
selected = d["selected"]
if not selected:
continue
- cp = portage.cpv_getkey(iter(selected).next())
+ cp = portage.cpv_getkey(next(iter(selected)))
cp_dict = unordered.get(cp)
if cp_dict is None:
cp_dict = {}
@@ -423,7 +423,7 @@
if mytype == "selected":
continue
mylist.difference_update(all_selected)
- cp = portage.cpv_getkey(iter(selected).next())
+ cp = portage.cpv_getkey(next(iter(selected)))
for y in localtree.dep_match(cp):
if y not in pkgmap[x]["omitted"] and \
y not in pkgmap[x]["selected"] and \
Modified: main/branches/prefix/pym/_emerge/userquery.py
===================================================================
--- main/branches/prefix/pym/_emerge/userquery.py 2009-09-21 19:00:57 UTC (rev 14359)
+++ main/branches/prefix/pym/_emerge/userquery.py 2009-09-21 19:26:47 UTC (rev 14360)
@@ -38,7 +38,10 @@
print(bold(prompt), end=' ')
try:
while True:
- response=raw_input("["+"/".join([colours[i](responses[i]) for i in range(len(responses))])+"] ")
+ if sys.hexversion >= 0x3000000:
+ response=input("["+"/".join([colours[i](responses[i]) for i in range(len(responses))])+"] ")
+ else:
+ response=raw_input("["+"/".join([colours[i](responses[i]) for i in range(len(responses))])+"] ")
for key in responses:
# An empty response will match the first value in responses.
if response.upper()==key[:len(response)].upper():
Modified: main/branches/prefix/pym/portage/cache/mappings.py
===================================================================
--- main/branches/prefix/pym/portage/cache/mappings.py 2009-09-21 19:00:57 UTC (rev 14359)
+++ main/branches/prefix/pym/portage/cache/mappings.py 2009-09-21 19:26:47 UTC (rev 14360)
@@ -105,7 +105,7 @@
def popitem(self):
try:
- k, v = iter(self.items()).next()
+ k, v = next(iter(self.items()))
except StopIteration:
raise KeyError('container is empty')
del self[k]
@@ -442,7 +442,7 @@
def popitem(self):
try:
- k, v = iter(self.items()).next()
+ k, v = next(iter(self.items()))
except StopIteration:
raise KeyError('container is empty')
del self[k]
Modified: main/branches/prefix/pym/portage/cache/sqlite.py
===================================================================
--- main/branches/prefix/pym/portage/cache/sqlite.py 2009-09-21 19:00:57 UTC (rev 14359)
+++ main/branches/prefix/pym/portage/cache/sqlite.py 2009-09-21 19:26:47 UTC (rev 14360)
@@ -6,7 +6,7 @@
from portage.cache import fs_template
from portage.cache import cache_errors
from portage import os
-from portage import _unicode_encode
+from portage import _unicode_decode
from portage.cache.template import reconstruct_eclasses
from portage.util import writemsg
from portage.localization import _
@@ -67,7 +67,7 @@
try:
self._ensure_dirs()
self._db_connection = self._db_module.connect(
- database=_unicode_encode(self._dbpath), **connection_kwargs)
+ database=_unicode_decode(self._dbpath), **connection_kwargs)
self._db_cursor = self._db_connection.cursor()
self._db_cursor.execute("PRAGMA encoding = %s" % self._db_escape_string("UTF-8"))
if not self._ensure_access(self._dbpath):
Modified: main/branches/prefix/pym/portage/dbapi/porttree.py
===================================================================
--- main/branches/prefix/pym/portage/dbapi/porttree.py 2009-09-21 19:00:57 UTC (rev 14359)
+++ main/branches/prefix/pym/portage/dbapi/porttree.py 2009-09-21 19:26:47 UTC (rev 14360)
@@ -970,7 +970,7 @@
if mydep != mykey:
cpv_iter = self._iter_match(mydep, cpv_iter)
try:
- myval = cpv_iter.next()
+ myval = next(cpv_iter)
except StopIteration:
myval = ""
Modified: main/branches/prefix/pym/portage/dep.py
===================================================================
--- main/branches/prefix/pym/portage/dep.py 2009-09-21 19:00:57 UTC (rev 14359)
+++ main/branches/prefix/pym/portage/dep.py 2009-09-21 19:26:47 UTC (rev 14360)
@@ -153,7 +153,7 @@
for x in i:
if isinstance(x, basestring):
if x == '||':
- x = self._zap_parens(i.next(), [], disjunction=True)
+ x = self._zap_parens(next(i), [], disjunction=True)
if len(x) == 1:
dest.append(x[0])
else:
@@ -161,7 +161,7 @@
dest.append(x)
elif x.endswith("?"):
dest.append(x)
- dest.append(self._zap_parens(i.next(), []))
+ dest.append(self._zap_parens(next(i), []))
else:
dest.append(x)
else:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-09-21 19:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-21 19:26 [gentoo-commits] portage r14360 - in main/branches/prefix/pym: _emerge portage portage/cache portage/dbapi Fabian Groffen (grobian)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox