diff options
-rw-r--r-- | README.rst | 4 | ||||
-rw-r--r-- | ebuilds/g-octave-9999.ebuild | 17 | ||||
-rw-r--r-- | g_octave/config.py | 6 | ||||
-rw-r--r-- | g_octave/fetch.py | 12 | ||||
-rwxr-xr-x | setup.py | 2 |
5 files changed, 15 insertions, 26 deletions
@@ -2,8 +2,6 @@ .. _`Octave-Forge`: http://octave.sf.net/ .. _`g-octave`: http://bitbucket.org/rafaelmartins/g-octave/ .. _Python: http://python.org/ -.. _simplejson: http://pypi.python.org/pypi/simplejson/ -.. _pycolors: http://pypi.python.org/pypi/pycolors/ .. _Portage: http://www.gentoo.org/proj/en/portage/ .. _Paludis: http://paludis.pioto.org/ .. _pkgcore: http://www.pkgcore.org/ @@ -57,7 +55,6 @@ Dependencies * Python_ 2 * Portage_ -* simplejson_ `g-octave`_ also depends on some files, distributed by the maintainer, like the package database (a tarball with the DESCRIPTION file of all @@ -128,6 +125,7 @@ To-Do We have other goals besides implementing the remaining features: * Remove the unneeded dependency: pycolors **(done)** +* Remove the unneeded dependency: simplejson **(done)** * Port to Python_ >= 3.0 * Improve the code comments * Improve the error handling diff --git a/ebuilds/g-octave-9999.ebuild b/ebuilds/g-octave-9999.ebuild index 2a31e17..b6a60bf 100644 --- a/ebuilds/g-octave-9999.ebuild +++ b/ebuilds/g-octave-9999.ebuild @@ -4,6 +4,8 @@ EAPI="2" +NEED_PYTHON="2.6" + inherit distutils mercurial DESCRIPTION="A tool that generates and installs ebuilds for Octave-Forge" @@ -13,19 +15,8 @@ EHG_REPO_URI="https://bitbucket.org/rafaelmartins/g-octave/" LICENSE="GPL-2" SLOT="0" KEYWORDS="" -IUSE="colors" +IUSE="" -DEPEND="<dev-lang/python-3" -RDEPEND="${DEPEND} - sys-apps/portage - dev-python/simplejson - colors? ( dev-python/pycolors )" +RDEPEND="sys-apps/portage" S="${WORKDIR}/${PN}" - -src_prepare() { - if ! use colors; then - sed -i -e 's/from colors .*/raise/' scripts/g-octave \ - || die 'sed failed.' - fi -} diff --git a/g_octave/config.py b/g_octave/config.py index 20c0151..2a31524 100644 --- a/g_octave/config.py +++ b/g_octave/config.py @@ -4,7 +4,7 @@ __all__ = ['Config'] import ConfigParser -import simplejson +import json import os from exception import ConfigException @@ -45,13 +45,13 @@ class Config(object): # Cache (JSON) cache_file = os.path.join(self.__getattr__('db'), 'cache.json') fp = open(cache_file) - self.__cache = simplejson.load(fp) + self.__cache = json.load(fp) fp.close() # JSON json_file = os.path.join(self.__getattr__('db'), self.__cache['files']['info.json']) fp = open(json_file) - self.__info = simplejson.load(fp) + self.__info = json.load(fp) fp.close() diff --git a/g_octave/fetch.py b/g_octave/fetch.py index 3bc8b96..9093996 100644 --- a/g_octave/fetch.py +++ b/g_octave/fetch.py @@ -14,7 +14,7 @@ from exception import FetchException import urllib2 import os -import simplejson +import json import subprocess import re import shutil @@ -49,7 +49,7 @@ def check_updates(): def download_files(): fp = open(conf.db+'/update.json') - files = simplejson.load(fp) + files = json.load(fp) fp.close() for _file in files['files']: @@ -81,7 +81,7 @@ def add_file_to_db_cache(_file): try: fp = open(conf.db+'/cache.json') - files = simplejson.load(fp) + files = json.load(fp) fp.close() except: files = {'files': {}} @@ -91,7 +91,7 @@ def add_file_to_db_cache(_file): files['files'][f] = _file fp = open(conf.db+'/cache.json', 'w', 0644) - simplejson.dump(files, fp) + json.dump(files, fp) fp.close() @@ -99,13 +99,13 @@ def check_db_cache(): try: fp = open(conf.db+'/cache.json') - cache = simplejson.load(fp) + cache = json.load(fp) fp.close() except: cache = {'files': []} fp = open(conf.db+'/update.json') - update = simplejson.load(fp) + update = json.load(fp) fp.close() for _file in update['files']: @@ -18,5 +18,5 @@ setup( packages = ['g_octave'], scripts = ['scripts/g-octave'], data_files = [('/etc', ['etc/g-octave.cfg'])], - requires = ['simplejson', 'portage'] + requires = ['portage'] ) |