diff options
author | René 'Necoro' Neumann <necoro@necoro.net> | 2009-08-14 17:30:43 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.net> | 2009-08-14 17:30:43 +0200 |
commit | d2afc4afe4d16b3ecd475d62c1baa86d385667a9 (patch) | |
tree | 63d129618f4f3b2b58e4b184852c4789a16fd8df /portato/eix | |
parent | 308766600eadee21d122091fbe24950e89417280 (diff) | |
download | portato-d2afc4afe4d16b3ecd475d62c1baa86d385667a9.tar.gz portato-d2afc4afe4d16b3ecd475d62c1baa86d385667a9.tar.bz2 portato-d2afc4afe4d16b3ecd475d62c1baa86d385667a9.zip |
Finish EixReader
Diffstat (limited to '')
-rw-r--r-- | portato/eix/__init__.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/portato/eix/__init__.py b/portato/eix/__init__.py index 6768ca7..977c9e2 100644 --- a/portato/eix/__init__.py +++ b/portato/eix/__init__.py @@ -13,7 +13,7 @@ from __future__ import absolute_import, with_statement from . import parser -from . import exceptions as ex +from .exceptions import UnsupportedVersionError from ..helper import debug @@ -25,21 +25,21 @@ class EixReader(object): self.file = open(filename, "r") try: - self.version = parser.number(self.file) + version = parser.number(self.file) - if self.version not in self.supported_versions: - raise ex.UnsupportedVersionError(self.version) + if version not in self.supported_versions: + raise UnsupportedVersionError(self.version) - debug("Started EixReader for version %s.", self.version) + debug("Started EixReader for version %s.", version) self.file.seek(0) + + self.header = parser.header(self.file) + self.categories = parser.vector(self.file, parser.category, nelems = self.header.ncats()) except: self.close() raise - def header (self): - return parser.header(self.file) - def close (self): self.file.close() debug("EixReader closed.") |