From: Luke Macken Date: Tue, 12 Feb 2008 21:28:15 +0000 (-0500) Subject: If we want to use MDError in utils.py, we need to define it outside of __init__ to... X-Git-Tag: upstream/0.9.9~131 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bb6479685325d4f365937947a8bad9c2d5374c4b;p=tools%2Fcreaterepo.git If we want to use MDError in utils.py, we need to define it outside of __init__ to avoid circular deps --- diff --git a/createrepo/__init__.py b/createrepo/__init__.py index 388e9cc..9ae9272 100644 --- a/createrepo/__init__.py +++ b/createrepo/__init__.py @@ -13,7 +13,6 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Copyright 2007 Red Hat, Inc - written by seth vidal skvidal at fedoraproject.org -import exceptions import os import sys import libxml2 @@ -25,7 +24,7 @@ import shutil from yum import misc, Errors import rpmUtils.transaction -from utils import _, errorprint +from utils import _, errorprint, MDError import readMetadata try: @@ -33,22 +32,11 @@ try: except ImportError: pass - from utils import _gzipOpen, bzipFile, checkAndMakeDir, GzipFile, checksum_and_rename - __version__ = '0.9.4' - -class MDError(exceptions.Exception): - def __init__(self, value=None): - exceptions.Exception.__init__(self) - self.value = value - - def __str__(self): - return self.value - class MetaDataConfig(object): def __init__(self): self.quiet = False diff --git a/createrepo/utils.py b/createrepo/utils.py index 1b8c147..6ba3855 100644 --- a/createrepo/utils.py +++ b/createrepo/utils.py @@ -134,6 +134,12 @@ def checksum_and_rename(fn_path): csum_path = os.path.join(fndir, csum_fn) os.rename(fn_path, csum_path) return (csum, csum_path) - - + +class MDError(Exception): + def __init__(self, value=None): + Exception.__init__(self) + self.value = value + + def __str__(self): + return self.value