public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Jauhien Piatlicki" <piatlicki@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/g-sorcery:master commit in: gs_ctan/
Date: Thu,  1 Aug 2013 15:58:21 +0000 (UTC)	[thread overview]
Message-ID: <1375372685.d12a62bf86564cda836c25546ff8059335fbe7c7.jauhien@gentoo> (raw)

commit:     d12a62bf86564cda836c25546ff8059335fbe7c7
Author:     Jauhien Piatlicki (jauhien) <piatlicki <AT> gmail <DOT> com>
AuthorDate: Thu Aug  1 15:58:05 2013 +0000
Commit:     Jauhien Piatlicki <piatlicki <AT> gmail <DOT> com>
CommitDate: Thu Aug  1 15:58:05 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/g-sorcery.git;a=commit;h=d12a62bf

CTAN backend: Docstrings and different fixes

---
 gs_ctan/backend.py |  4 ++++
 gs_ctan/ctan_db.py | 25 ++++++++++++++++++++++---
 gs_ctan/ebuild.py  |  6 ++++++
 3 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/gs_ctan/backend.py b/gs_ctan/backend.py
index 42a4a83..92245e6 100644
--- a/gs_ctan/backend.py
+++ b/gs_ctan/backend.py
@@ -23,10 +23,14 @@ from .ebuild import CtanEbuildWithoutDigestGenerator, CtanEbuildWithDigestGenera
 
 
 class CtanEclassGenerator(EclassGenerator):
+    """
+    Implementation of eclass generator. Only specifies a data directory.
+    """
     def __init__(self):
         super(CtanEclassGenerator, self).__init__(os.path.join(get_pkgpath(__file__), 'data'))
         
 
+#Backend instance to be loaded by g_sorcery
 instance = Backend(CtanDBGenerator,
                    CtanEbuildWithDigestGenerator, CtanEbuildWithoutDigestGenerator,
                    CtanEclassGenerator, MetadataGenerator)

diff --git a/gs_ctan/ctan_db.py b/gs_ctan/ctan_db.py
index 39195e8..0f7d939 100644
--- a/gs_ctan/ctan_db.py
+++ b/gs_ctan/ctan_db.py
@@ -12,17 +12,18 @@
 """
 
 import itertools
-import os
 import re
 
 import portage
 
 from g_sorcery.g_collections import Dependency, Package, serializable_elist
 from g_sorcery.package_db import DBGenerator
-from g_sorcery.exceptions import SyncError
 from g_sorcery.logger import Logger
 
 class CtanDBGenerator(DBGenerator):
+    """
+    Implementation of database generator for CTAN LaTeX backend.
+    """
     def __init__(self, package_db_class):
         super(CtanDBGenerator, self).__init__(package_db_class)
         
@@ -38,10 +39,25 @@ class CtanDBGenerator(DBGenerator):
 
 
     def get_download_uries(self, common_config, config):
+        """
+        Get download URI.
+        """
         tlpdb_uri = config["repo_uri"] + "/tlpkg/texlive.tlpdb.xz"
         return [tlpdb_uri]
         
     def parse_data(self, data_f):
+        """
+        Parse downloaded data.
+
+        Parsed data is a list of dictionaries.
+        Each dictionary corresponds to one package.
+
+        Args:
+            data_f: Open file wit data.
+
+        Returns:
+            Parsed data.
+        """
         data = data_f.read()
         
         data = data.split("\n")
@@ -98,7 +114,10 @@ class CtanDBGenerator(DBGenerator):
         return result
 
     def process_data(self, pkg_db, data, common_config, config):
-        
+        """
+        Process parsed data and fill database.
+        """
+
         category = "dev-tex"
         
         pkg_db.add_category(category)

diff --git a/gs_ctan/ebuild.py b/gs_ctan/ebuild.py
index a800cbd..d8b4f65 100644
--- a/gs_ctan/ebuild.py
+++ b/gs_ctan/ebuild.py
@@ -21,6 +21,9 @@ Layout = collections.namedtuple("Layout",
   
 
 class CtanEbuildWithoutDigestGenerator(DefaultEbuildGenerator):
+    """
+    Implementation of ebuild generator without sources digesting.
+    """
     def __init__(self, package_db):
 
         vars_before_inherit = \
@@ -39,6 +42,9 @@ class CtanEbuildWithoutDigestGenerator(DefaultEbuildGenerator):
         super(CtanEbuildWithoutDigestGenerator, self).__init__(package_db, layout)
 
 class CtanEbuildWithDigestGenerator(DefaultEbuildGenerator):
+    """
+    Implementation of ebuild generator with sources digesting.
+    """
     def __init__(self, package_db):
 
         vars_before_inherit = \


             reply	other threads:[~2013-08-01 15:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-01 15:58 Jauhien Piatlicki [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-07-31 23:29 [gentoo-commits] proj/g-sorcery:master commit in: gs_ctan/ Jauhien Piatlicki
2013-07-22 16:57 Jauhien Piatlicki
2013-07-19 16:56 Jauhien Piatlicki
2013-07-19 11:23 Jauhien Piatlicki
2013-07-19 11:10 Jauhien Piatlicki
2013-07-19  8:36 Jauhien Piatlicki
2013-07-18 22:29 Jauhien Piatlicki
2013-07-18  0:12 Jauhien Piatlicki
2013-07-18  0:12 Jauhien Piatlicki
2013-07-17 23:19 Jauhien Piatlicki
2013-07-17 17:05 Jauhien Piatlicki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1375372685.d12a62bf86564cda836c25546ff8059335fbe7c7.jauhien@gentoo \
    --to=piatlicki@gmail.com \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox