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 31AF21381F3 for ; Mon, 12 Aug 2013 18:39:08 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C217BE0944; Mon, 12 Aug 2013 18:39:07 +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 517F4E0944 for ; Mon, 12 Aug 2013 18:39:07 +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 4C91433EC11 for ; Mon, 12 Aug 2013 18:39:06 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id D1017E545D for ; Mon, 12 Aug 2013 18:38:59 +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: <1376332677.5db4a26f73b50f8ef398709dc605b20191dacb5e.jauhien@gentoo> Subject: [gentoo-commits] proj/g-sorcery:pypi commit in: gs_pypi/ X-VCS-Repository: proj/g-sorcery X-VCS-Files: gs_pypi/pypi_db.py X-VCS-Directories: gs_pypi/ X-VCS-Committer: jauhien X-VCS-Committer-Name: Jauhien Piatlicki X-VCS-Revision: 5db4a26f73b50f8ef398709dc605b20191dacb5e X-VCS-Branch: pypi Date: Mon, 12 Aug 2013 18:38:59 +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: 926e41de-2dac-4c07-9ec9-ec9fc549a108 X-Archives-Hash: 55e3b9052fa8bbeab07f6a73094d73f6 Message-ID: <20130812183859.WfEsIEg85h60jYzhlKX-gd4C2YIpF2SFLdbbvFMCQ0g@z> commit: 5db4a26f73b50f8ef398709dc605b20191dacb5e Author: Jauhien Piatlicki (jauhien) gmail com> AuthorDate: Mon Aug 12 18:37:57 2013 +0000 Commit: Jauhien Piatlicki gmail com> CommitDate: Mon Aug 12 18:37:57 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/g-sorcery.git;a=commit;h=5db4a26f gs_pypi/pypi_db: fix parsing and store info in database --- gs_pypi/pypi_db.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gs_pypi/pypi_db.py b/gs_pypi/pypi_db.py index 52e83e3..ee5c2d5 100644 --- a/gs_pypi/pypi_db.py +++ b/gs_pypi/pypi_db.py @@ -63,7 +63,10 @@ class PypiDBGenerator(DBGenerator): data = {} data["files"] = [] data["info"] = {} - for table in soup("table")[-1:]: + for table in soup("table", class_ = "list")[-1:]: + if not "File" in table("th")[0].string: + continue + for entry in table("tr")[1:-1]: fields = entry("td") @@ -151,10 +154,12 @@ class PypiDBGenerator(DBGenerator): continue files_src_uri = "" + md5 = "" if pkg_data["files"]: for file_entry in pkg_data["files"]: if file_entry["type"] == "\n Source\n ": files_src_uri = file_entry["url"] + md5 = file_entry["md5"] break download_url = "" @@ -205,5 +210,8 @@ class PypiDBGenerator(DBGenerator): ebuild_data["homepage"] = homepage ebuild_data["license"] = license ebuild_data["source_uri"] = source_uri + ebuild_data["md5"] = md5 + + ebuild_data["info"] = info pkg_db.add_package(Package(category, filtered_package, filtered_version), ebuild_data)