diff options
author | 2010-07-31 22:50:49 -0300 | |
---|---|---|
committer | 2010-07-31 22:50:49 -0300 | |
commit | 15597ff4fc8ca1ee11a3dd8272afbed569d386d5 (patch) | |
tree | 268ccbc5b1e86cdc314b6eb7e2264ca6a296f1c0 /g_octave | |
parent | changed MANIFEST.in to exclude the previously removed files (diff) | |
download | g-octave-15597ff4fc8ca1ee11a3dd8272afbed569d386d5.tar.gz g-octave-15597ff4fc8ca1ee11a3dd8272afbed569d386d5.tar.bz2 g-octave-15597ff4fc8ca1ee11a3dd8272afbed569d386d5.zip |
removed unused module
Diffstat (limited to 'g_octave')
-rw-r--r-- | g_octave/installed.py | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/g_octave/installed.py b/g_octave/installed.py deleted file mode 100644 index e749178..0000000 --- a/g_octave/installed.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- - -""" - installed.py - ~~~~~~~~~~~~ - - This module implements a Python object with the register of g-octave - installed packages, something like the portage's world file. - - :copyright: (c) 2010 by Rafael Goncalves Martins - :license: GPL-2, see LICENSE for more details. -""" - -import json - -class Installed(object): - - # this will not be changed by the config file, because the user will - # lost track of the installed packages if he touch in the location - # of this file without move it. - _file = '/var/cache/g-octave.json' - - def _load_json(self): - content = {} - try: - with open(self._file) as fp: - content = json.load(fp) - except: - return {} - return content - - def _dump_json(self, content): - try: - with open(self._file, 'w') as fp: - json.dump(content, fp) - except: - return False - return True - - def do_install(self, package, version): - packages = self._load_json() - packages[package] = version - if not self._dump_json(packages): - raise RuntimeError('Failed to save JSON file.') - - def is_installed(self, package): - packages = self._load_json() - return package in packages - - def get_version(self, package): - packages = self._load_json() - return packages.get(package, None) |