diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2010-11-29 20:07:51 -0200 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2010-11-29 20:07:51 -0200 |
commit | d014e7088833e3013e0eb87ce2d2042b1cc461c3 (patch) | |
tree | ce42c13a280ce2fac7f865c531750806d1d6572a /g_octave | |
parent | added g_octave.checksum module, with tests (diff) | |
download | g-octave-d014e7088833e3013e0eb87ce2d2042b1cc461c3.tar.gz g-octave-d014e7088833e3013e0eb87ce2d2042b1cc461c3.tar.bz2 g-octave-d014e7088833e3013e0eb87ce2d2042b1cc461c3.zip |
added checksum support to g_octave.description module, with test
Diffstat (limited to 'g_octave')
-rw-r--r-- | g_octave/description.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/g_octave/description.py b/g_octave/description.py index df0c23e..c0a3fe7 100644 --- a/g_octave/description.py +++ b/g_octave/description.py @@ -33,6 +33,7 @@ from contextlib import closing from .config import Config from .exception import ConfigException, DescriptionException from .compat import py3k +from .checksum import sha1_compute if py3k: import urllib.request as urllib @@ -62,6 +63,8 @@ class Description(object): log.error('File not found: %s' % file) raise DescriptionException('File not found: %s' % file) + self._file = file + # dictionary with the parsed content of the DESCRIPTION file self._desc = dict() @@ -259,6 +262,10 @@ class Description(object): return depends_list + def sha1sum(self): + return sha1_compute(self._file) + + def __getattr__(self, name): """method that overloads the object atributes, returning the needed atribute based on the dict with the previously parsed content. |