From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id F37BA1381F3 for ; Thu, 1 Aug 2013 12:55:58 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8E860E0804; Thu, 1 Aug 2013 12:55:58 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 17CF3E0804 for ; Thu, 1 Aug 2013 12:55:57 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BC05C33DACB for ; Thu, 1 Aug 2013 12:55:56 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 44C0BE468F for ; Thu, 1 Aug 2013 12:55:55 +0000 (UTC) From: "Jauhien Piatlicki" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Jauhien Piatlicki" Message-ID: <1375361739.792c17dd38a38430ca75aa95f81e9f27fdcd989b.jauhien@gentoo> Subject: [gentoo-commits] proj/g-sorcery:master commit in: g_sorcery/ X-VCS-Repository: proj/g-sorcery X-VCS-Files: g_sorcery/fileutils.py X-VCS-Directories: g_sorcery/ X-VCS-Committer: jauhien X-VCS-Committer-Name: Jauhien Piatlicki X-VCS-Revision: 792c17dd38a38430ca75aa95f81e9f27fdcd989b X-VCS-Branch: master Date: Thu, 1 Aug 2013 12:55:55 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: a7c21952-866c-40c6-9e09-868a12a31684 X-Archives-Hash: af39aab8fdcdecb27050a9feb661dbc7 commit: 792c17dd38a38430ca75aa95f81e9f27fdcd989b Author: Jauhien Piatlicki (jauhien) gmail com> AuthorDate: Thu Aug 1 12:55:39 2013 +0000 Commit: Jauhien Piatlicki gmail com> CommitDate: Thu Aug 1 12:55:39 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/g-sorcery.git;a=commit;h=792c17dd g_sorcery/fileutils: different fixes --- g_sorcery/fileutils.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/g_sorcery/fileutils.py b/g_sorcery/fileutils.py index ab42ff2..c7a5257 100644 --- a/g_sorcery/fileutils.py +++ b/g_sorcery/fileutils.py @@ -50,7 +50,8 @@ class FileJSON(object): for key in self.mandatories: content[key] = "" with open(self.path, 'w') as f: - json.dump(content, f, indent=2, sort_keys=True, cls=JSONSerializer) + json.dump(content, f, indent=2, + sort_keys=True, cls=JSONSerializer) else: with open(self.path, 'r') as f: content = json.load(f, object_hook=deserializeHook) @@ -120,7 +121,8 @@ def wget(uri, directory, output=""): Nonzero in case of a failure. """ if output: - ret = os.system('wget ' + uri + ' -O ' + os.path.join(directory, output)) + ret = os.system('wget ' + uri + + ' -O ' + os.path.join(directory, output)) else: ret = os.system('wget -P ' + directory + ' ' + uri) return ret @@ -142,6 +144,10 @@ class ManifestEntry: """ A manifest entry for a file. """ + + __slots__ = ('directory', 'name', 'ftype', 'digest', + 'size', 'sha256', 'sha512', 'whirlpool') + def __init__(self, directory, name, ftype): self.directory = directory self.name = name @@ -179,9 +185,11 @@ def fast_manifest(directory): metadata = os.path.join(directory, "metadata.xml") for aux in glob.glob(os.path.join(directory, "files/*")): - manifest.append(ManifestEntry(os.path.dirname(aux), os.path.basename(aux), "AUX")) + manifest.append(ManifestEntry(os.path.dirname(aux), + os.path.basename(aux), "AUX")) for ebuild in glob.glob(os.path.join(directory, "*.ebuild")): - manifest.append(ManifestEntry(directory, os.path.basename(ebuild), "EBUILD")) + manifest.append(ManifestEntry(directory, + os.path.basename(ebuild), "EBUILD")) if (os.path.isfile(metadata)): manifest.append(ManifestEntry(directory, "metadata.xml", "MISC")) @@ -249,7 +257,8 @@ def load_remote_file(uri, parser, open_file = True, open_mode='r', output=""): name, extention = os.path.splitext(f_name) if extention in [".xz", ".lzma"]: if (os.system("xz -d " + f_name)): - raise DownloadingError("xz failed: " + f_name + " from " + uri) + raise DownloadingError("xz failed: " + + f_name + " from " + uri) f_name = name loaded_data.update(_call_parser(f_name, parser, open_file=open_file, open_mode=open_mode))