From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Qh5hs-0000uW-4c for garchives@archives.gentoo.org; Wed, 13 Jul 2011 20:06:52 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 249BF21C1F5; Wed, 13 Jul 2011 20:06:45 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id DB24521C1F5 for ; Wed, 13 Jul 2011 20:06:44 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 230E92AC277 for ; Wed, 13 Jul 2011 20:06:44 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 405578003D for ; Wed, 13 Jul 2011 20:06:43 +0000 (UTC) From: "Paul Varner" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Paul Varner" Message-ID: <0f177509d8384c822240f62d4416afa1ea56d540.fuzzyray@gentoo> Subject: [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/revdep_rebuild/ X-VCS-Repository: proj/gentoolkit X-VCS-Files: pym/gentoolkit/revdep_rebuild/analyse.py pym/gentoolkit/revdep_rebuild/cache.py pym/gentoolkit/revdep_rebuild/collect.py pym/gentoolkit/revdep_rebuild/rebuild.py pym/gentoolkit/revdep_rebuild/stuff.py X-VCS-Directories: pym/gentoolkit/revdep_rebuild/ X-VCS-Committer: fuzzyray X-VCS-Committer-Name: Paul Varner X-VCS-Revision: 0f177509d8384c822240f62d4416afa1ea56d540 Date: Wed, 13 Jul 2011 20:06:43 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 8cb0fc52a49bcfd305541eeed1820023 commit: 0f177509d8384c822240f62d4416afa1ea56d540 Author: Paul Varner gentoo org> AuthorDate: Wed Jul 13 20:06:13 2011 +0000 Commit: Paul Varner gentoo org> CommitDate: Wed Jul 13 20:06:13 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gentoolkit.gi= t;a=3Dcommit;h=3D0f177509 Fix python 3 incompatible code --- pym/gentoolkit/revdep_rebuild/analyse.py | 8 ++++---- pym/gentoolkit/revdep_rebuild/cache.py | 8 ++++---- pym/gentoolkit/revdep_rebuild/collect.py | 2 +- pym/gentoolkit/revdep_rebuild/rebuild.py | 12 ++++++------ pym/gentoolkit/revdep_rebuild/stuff.py | 4 ++-- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/pym/gentoolkit/revdep_rebuild/analyse.py b/pym/gentoolkit/re= vdep_rebuild/analyse.py index f0ef323..700c966 100644 --- a/pym/gentoolkit/revdep_rebuild/analyse.py +++ b/pym/gentoolkit/revdep_rebuild/analyse.py @@ -9,10 +9,10 @@ import glob =20 from portage.output import bold, red, blue, yellow, green, nocolor =20 -from stuff import scan -from collect import prepare_search_dirs, parse_revdep_config, collect_li= braries_from_dir, collect_binaries_from_dir -from assign import assign_packages -from cache import save_cache +from .stuff import scan +from .collect import prepare_search_dirs, parse_revdep_config, collect_l= ibraries_from_dir, collect_binaries_from_dir +from .assign import assign_packages +from .cache import save_cache =20 =20 def prepare_checks(files_to_check, libraries, bits, cmd_max_args): diff --git a/pym/gentoolkit/revdep_rebuild/cache.py b/pym/gentoolkit/revd= ep_rebuild/cache.py index a1cb1ec..ca2ab1b 100644 --- a/pym/gentoolkit/revdep_rebuild/cache.py +++ b/pym/gentoolkit/revdep_rebuild/cache.py @@ -5,7 +5,7 @@ import os import time =20 from portage.output import red -from settings import DEFAULTS +from .settings import DEFAULTS =20 =20 def read_cache(temp_path=3DDEFAULTS['DEFAULT_TMP_DIR']): @@ -18,7 +18,7 @@ def read_cache(temp_path=3DDEFAULTS['DEFAULT_TMP_DIR'])= : =20 ret =3D {'libraries':[], 'la_libraries':[], 'libraries_links':[], 'bina= ries':[]} try: - for key,val in ret.iteritems(): + for key,val in list(ret.items()): f =3D open(os.path.join(temp_path, key)) for line in f.readlines(): val.append(line.strip()) @@ -44,7 +44,7 @@ def save_cache(logger, to_save=3D{}, temp_path=3DDEFAUL= TS['DEFAULT_TMP_DIR']): f.write(str(int(time.time()))) f.close() =20 - for key,val in to_save.iteritems(): + for key,val in list(to_save.items()): f =3D open(os.path.join(temp_path, key), 'w') for line in val: f.write(line + '\n') @@ -87,7 +87,7 @@ def check_temp_files(temp_path=3DDEFAULTS['DEFAULT_TMP_= DIR'], max_delay=3D3600): if __name__ =3D=3D '__main__': print('Preparing cache ... ') =20 - from collect import * + from .collect import * import logging =20 bin_dirs, lib_dirs =3D prepare_search_dirs() diff --git a/pym/gentoolkit/revdep_rebuild/collect.py b/pym/gentoolkit/re= vdep_rebuild/collect.py index b9e9c0d..3f05161 100644 --- a/pym/gentoolkit/revdep_rebuild/collect.py +++ b/pym/gentoolkit/revdep_rebuild/collect.py @@ -18,7 +18,7 @@ def parse_conf(conf_file, visited=3DNone, logger=3DNone= ): lib_dirs =3D set() to_parse =3D set() =20 - if isinstance(conf_file, basestring): + if isinstance(conf_file, str): conf_file =3D [conf_file] =20 for conf in conf_file: diff --git a/pym/gentoolkit/revdep_rebuild/rebuild.py b/pym/gentoolkit/re= vdep_rebuild/rebuild.py index d26e186..aa802bb 100644 --- a/pym/gentoolkit/revdep_rebuild/rebuild.py +++ b/pym/gentoolkit/revdep_rebuild/rebuild.py @@ -25,12 +25,12 @@ import logging from portage import portdb from portage.output import bold, red, blue, yellow, green, nocolor =20 -from analyse import analyse -from stuff import exithandler, get_masking_status -from cache import check_temp_files, read_cache -from assign import get_slotted_cps -from settings import DEFAULTS -from gentoolkit.revdep_rebuild import __version__ +from .analyse import analyse +from .stuff import exithandler, get_masking_status +from .cache import check_temp_files, read_cache +from .assign import get_slotted_cps +from .settings import DEFAULTS +from . import __version__ =20 =20 APP_NAME =3D sys.argv[0] diff --git a/pym/gentoolkit/revdep_rebuild/stuff.py b/pym/gentoolkit/revd= ep_rebuild/stuff.py index 66f5769..64b9601 100644 --- a/pym/gentoolkit/revdep_rebuild/stuff.py +++ b/pym/gentoolkit/revdep_rebuild/stuff.py @@ -8,11 +8,11 @@ import portage =20 # util. functions def call_program(args): - ''' Calls program with specified parameters and returns stdout ''' + ''' Calls program with specified parameters and returns stdout as a str= object ''' subp =3D subprocess.Popen(args, stdout=3Dsubprocess.PIPE, \ stderr=3Dsubprocess.PIPE) stdout, stderr =3D subp.communicate() - return stdout + return str(stdout) =20 =20 def scan(params, files, max_args):