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_pypi/
Date: Tue, 23 Jul 2013 23:13:48 +0000 (UTC)	[thread overview]
Message-ID: <1374616998.3e4df382f7391e344a9658fbbef84569c25eb4a8.jauhien@gentoo> (raw)

commit:     3e4df382f7391e344a9658fbbef84569c25eb4a8
Author:     Jauhien Piatlicki (jauhien) <piatlicki <AT> gmail <DOT> com>
AuthorDate: Tue Jul 23 22:03:18 2013 +0000
Commit:     Jauhien Piatlicki <piatlicki <AT> gmail <DOT> com>
CommitDate: Tue Jul 23 22:03:18 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/g-sorcery.git;a=commit;h=3e4df382

PyPI backend: initial commit

---
 gs-pypi.json        |  8 ++++++++
 gs_pypi/__init__.py |  2 ++
 gs_pypi/backend.py  | 32 ++++++++++++++++++++++++++++++
 gs_pypi/ebuild.py   | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 gs_pypi/pypi_db.py  | 17 ++++++++++++++++
 5 files changed, 116 insertions(+)

diff --git a/gs-pypi.json b/gs-pypi.json
new file mode 100644
index 0000000..eb26221
--- /dev/null
+++ b/gs-pypi.json
@@ -0,0 +1,8 @@
+{
+  "package": "gs_pypi", 
+  "repositories": {
+    "pypi": {
+      "repo_uri": "https://pypi.python.org/pypi"
+    }
+  }
+}

diff --git a/gs_pypi/__init__.py b/gs_pypi/__init__.py
new file mode 100644
index 0000000..cf529d7
--- /dev/null
+++ b/gs_pypi/__init__.py
@@ -0,0 +1,2 @@
+#!/usr/bin/env python
+

diff --git a/gs_pypi/backend.py b/gs_pypi/backend.py
new file mode 100644
index 0000000..9fd6547
--- /dev/null
+++ b/gs_pypi/backend.py
@@ -0,0 +1,32 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+"""
+    backend.py
+    ~~~~~~~~~~
+    
+    PyPI backend
+    
+    :copyright: (c) 2013 by Jauhien Piatlicki
+    :license: GPL-2, see LICENSE for more details.
+"""
+
+import os
+
+from g_sorcery.backend import Backend
+from g_sorcery.metadata import MetadataGenerator
+from g_sorcery.eclass import EclassGenerator
+from g_sorcery.fileutils import get_pkgpath
+
+from .pypi_db import PypiDBGenerator
+from .ebuild import PypiEbuildWithoutDigestGenerator, PypiEbuildWithDigestGenerator
+
+
+class PypiEclassGenerator(EclassGenerator):
+    def __init__(self):
+        super(PypiEclassGenerator, self).__init__(os.path.join(get_pkgpath(__file__), 'data'))
+        
+
+instance = Backend(PypiDBGenerator,
+                   PypiEbuildWithDigestGenerator, PypiEbuildWithoutDigestGenerator,
+                   PypiEclassGenerator, MetadataGenerator)

diff --git a/gs_pypi/ebuild.py b/gs_pypi/ebuild.py
new file mode 100644
index 0000000..bbc0357
--- /dev/null
+++ b/gs_pypi/ebuild.py
@@ -0,0 +1,57 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+"""
+    ebuild.py
+    ~~~~~~~~~
+    
+    ebuild generation
+    
+    :copyright: (c) 2013 by Jauhien Piatlicki
+    :license: GPL-2, see LICENSE for more details.
+"""
+
+import collections
+import os
+
+from g_sorcery.ebuild import DefaultEbuildGenerator
+
+Layout = collections.namedtuple("Layout",
+    ["vars_before_inherit", "inherit", "vars_after_description", "vars_after_keywords"])
+  
+
+class PypiEbuildWithoutDigestGenerator(DefaultEbuildGenerator):
+    def __init__(self, package_db):
+
+        vars_before_inherit = \
+          []
+
+        inherit = ["gs-pypi"]
+        
+        vars_after_description = \
+          []
+
+        vars_after_keywords = \
+          []
+
+        layout = Layout(vars_before_inherit, inherit, vars_after_description, vars_after_keywords)
+
+        super(PypiEbuildWithoutDigestGenerator, self).__init__(package_db, layout)
+
+class PypiEbuildWithDigestGenerator(DefaultEbuildGenerator):
+    def __init__(self, package_db):
+
+        vars_before_inherit = \
+          []
+
+        inherit = ["gs-pypi"]
+        
+        vars_after_description = \
+          []
+
+        vars_after_keywords = \
+          []
+
+        layout = Layout(vars_before_inherit, inherit, vars_after_description, vars_after_keywords)
+
+        super(PypiEbuildWithDigestGenerator, self).__init__(package_db, layout)

diff --git a/gs_pypi/pypi_db.py b/gs_pypi/pypi_db.py
new file mode 100644
index 0000000..938f79c
--- /dev/null
+++ b/gs_pypi/pypi_db.py
@@ -0,0 +1,17 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+"""
+    pypi_db.py
+    ~~~~~~~~~~
+    
+    PyPI package database
+    
+    :copyright: (c) 2013 by Jauhien Piatlicki
+    :license: GPL-2, see LICENSE for more details.
+"""
+
+from g_sorcery.package_db import DBGenerator
+
+class PypiDBGenerator(DBGenerator):
+    pass


             reply	other threads:[~2013-07-23 23:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-23 23:13 Jauhien Piatlicki [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-07-23 23:13 [gentoo-commits] proj/g-sorcery:master commit in: /, gs_pypi/ Jauhien Piatlicki
2013-07-24 23:32 Jauhien Piatlicki
2013-08-30 16:58 Jauhien Piatlicki
2013-09-05 17:09 Jauhien Piatlicki
2013-09-05 17:21 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=1374616998.3e4df382f7391e344a9658fbbef84569c25eb4a8.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