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 F17991381F3 for ; Thu, 18 Jul 2013 00:12:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E58F7E0933; Thu, 18 Jul 2013 00:12:11 +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 5DAF1E0933 for ; Thu, 18 Jul 2013 00:12:11 +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 5899933E61B for ; Thu, 18 Jul 2013 00:12:10 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 07D2EE545F for ; Thu, 18 Jul 2013 00:12:09 +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: <1374106334.72e80df4afd6561b240f076471790bfdeda6df62.jauhien@gentoo> Subject: [gentoo-commits] proj/g-sorcery:master commit in: gs_ctan/ X-VCS-Repository: proj/g-sorcery X-VCS-Files: gs_ctan/ctan_db.py X-VCS-Directories: gs_ctan/ X-VCS-Committer: jauhien X-VCS-Committer-Name: Jauhien Piatlicki X-VCS-Revision: 72e80df4afd6561b240f076471790bfdeda6df62 X-VCS-Branch: master Date: Thu, 18 Jul 2013 00:12:09 +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: 54742ccb-a46a-47cc-ac73-147f1f4893c1 X-Archives-Hash: d3e92edbeb6ef507c90b34d81517efea commit: 72e80df4afd6561b240f076471790bfdeda6df62 Author: Jauhien Piatlicki (jauhien) gmail com> AuthorDate: Thu Jul 18 00:12:14 2013 +0000 Commit: Jauhien Piatlicki gmail com> CommitDate: Thu Jul 18 00:12:14 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/g-sorcery.git;a=commit;h=72e80df4 gs_ctan/ctan_db: process_data, some progress ;-) --- gs_ctan/ctan_db.py | 51 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/gs_ctan/ctan_db.py b/gs_ctan/ctan_db.py index 47d7160..a85488e 100644 --- a/gs_ctan/ctan_db.py +++ b/gs_ctan/ctan_db.py @@ -76,7 +76,54 @@ class CtanDB(PackageDB): return result def process_data(self, data): + + self.add_category('dev-tex') + for entry in data["texlive.tlpdb"]: - for key, value in entry.items(): - print(key + ": " + str(value)) + + realname = entry["name"] + + #todo: work on common data vars processing: external deps, filtering etc. + #at the moment just copy necessary code from elpa_db.py + allowed_ords = set(range(ord('a'), ord('z'))) | set(range(ord('A'), ord('Z'))) | \ + set(range(ord('0'), ord('9'))) | set(list(map(ord, + ['+', '_', '-', ' ', '.', '(', ')', '[', ']', '{', '}', ',']))) + + if "shortdesc" in entry: + description = entry["shortdesc"] + else: + description = entry["name"] + description = "".join([x for x in description if ord(x) in allowed_ords]) + + if "longdesc" in entry: + longdescription = entry["longdesc"] + longdescription = "".join([x for x in longdescription if ord(x) in allowed_ords]) + else: + longdescription = description + + if "catalogue-version" in entry: + version = entry["catalogue-version"] + else: + version = entry["revision"] + + #todo: convert to gentoo licenses + if "catalogue-license" in entry: + license = entry["catalogue-license"] + else: + license = "unknown" + + if "catalogue-ctan" in entry: + source_type = "zip" + base_src_uri = "http://www.ctan.org/tex-archive" + catalogue = entry["catalogue-ctan"] + else: + source_type = "tar.xz" + base_src_uri = "http://mirror.ctan.org/systems/texlive/tlnet/archive" + catalogue = "" + + print("dev-tex/" + realname + "-" + version) + print(" license: " + license) + print(" " + description) + print + print(" " + longdescription) print