If we want to use MDError in utils.py, we need to define it outside of __init__ to...
authorLuke Macken <lmacken@redhat.com>
Tue, 12 Feb 2008 21:28:15 +0000 (16:28 -0500)
committerLuke Macken <lmacken@redhat.com>
Tue, 12 Feb 2008 21:28:15 +0000 (16:28 -0500)
createrepo/__init__.py
createrepo/utils.py

index 388e9cc9fc659e487d5fa6664542a2cc39f4360e..9ae92723865792ab08a32c237646fa50a70e7622 100644 (file)
@@ -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
index 1b8c147fb418756e3fef0509888a596d20f6defb..6ba3855e0fe9598f6a267b05b675476c7dfa912b 100644 (file)
@@ -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