pylint: fixed Redefining built-in
authorTim Lauridsen <timlau@fedoraproject.org>
Tue, 21 Apr 2009 07:21:20 +0000 (09:21 +0200)
committerTim Lauridsen <timlau@fedoraproject.org>
Tue, 21 Apr 2009 07:21:20 +0000 (09:21 +0200)
createrepo/__init__.py
createrepo/utils.py

index 756662818c28fe4a8dd5668d99292261982ab681..25d3b0cd771eea0b75fa9d6ee796f4c7ede4f697 100644 (file)
@@ -297,14 +297,14 @@ class MetaDataGenerator:
 
     def trimRpms(self, files):
         badrpms = []
-        for file in files:
+        for rpm_file in files:
             for glob in self.conf.excludes:
-                if fnmatch.fnmatch(file, glob):
-                    if file not in badrpms:
-                        badrpms.append(file)
-        for file in badrpms:
-            if file in files:
-                files.remove(file)
+                if fnmatch.fnmatch(rpm_file, glob):
+                    if rpm_file not in badrpms:
+                        badrpms.append(rpm_file)
+        for rpm_file in badrpms:
+            if rpm_file in files:
+                files.remove(rpm_file)
         return files
 
     def _setup_old_metadata_lookup(self):
@@ -785,8 +785,8 @@ class MetaDataGenerator:
                 dbversion = '9'
             rp = sqlitecachec.RepodataParserSqlite(repopath, repoid, None)
 
-        for (file, ftype) in workfiles:
-            complete_path = os.path.join(repopath, file)
+        for (rpm_file, ftype) in workfiles:
+            complete_path = os.path.join(repopath, rpm_file)
             
             zfo = _gzipOpen(complete_path)
             uncsum = misc.checksum(sumtype, zfo)
@@ -873,16 +873,16 @@ class MetaDataGenerator:
                 location.newProp('xml:base', self.conf.baseurl)
             if self.conf.unique_md_filenames:
                 res_file = '%s-%s.xml.gz' % (csum, ftype)
-                orig_file = os.path.join(repopath, file)
+                orig_file = os.path.join(repopath, rpm_file)
                 dest_file = os.path.join(repopath, res_file)
                 os.rename(orig_file, dest_file)
                 
             else:
-                res_file = file
+                res_file = rpm_file
 
-            file = res_file 
+            rpm_file = res_file 
             
-            location.newProp('href', os.path.join(self.conf.finaldir, file))
+            location.newProp('href', os.path.join(self.conf.finaldir, rpm_file))
 
 
         if not self.conf.quiet and self.conf.database: self.callback.log('Sqlite DBs complete')        
index 894594c427660adb350a5b1a0637c5667cdf319d..fb239644cd1f2631546d2464474fb3a4a4476c8c 100644 (file)
@@ -76,25 +76,25 @@ def returnFD(filename):
         raise MDError, "Error opening file"
     return fdno
 
-def checkAndMakeDir(dir):
+def checkAndMakeDir(directory):
     """
-     check out the dir and make it, if possible, return 1 if done, else return 0
+     check out the directory and make it, if possible, return 1 if done, else return 0
     """
-    if os.path.exists(dir):
-        if not os.path.isdir(dir):
-            #errorprint(_('%s is not a dir') % dir)
+    if os.path.exists(directory):
+        if not os.path.isdir(directory):
+            #errorprint(_('%s is not a dir') % directory)
             result = False
         else:
-            if not os.access(dir, os.W_OK):
-                #errorprint(_('%s is not writable') % dir)
+            if not os.access(directory, os.W_OK):
+                #errorprint(_('%s is not writable') % directory)
                 result = False
             else:
                 result = True
     else:
         try:
-            os.mkdir(dir)
+            os.mkdir(directory)
         except OSError, e:
-            #errorprint(_('Error creating dir %s: %s') % (dir, e))
+            #errorprint(_('Error creating dir %s: %s') % (directory, e))
             result = False
         else:
             result = True