From 6033baed12651147c6c7d35b2e1e4b27d0a41248 Mon Sep 17 00:00:00 2001 From: Tim Lauridsen Date: Tue, 21 Apr 2009 09:21:20 +0200 Subject: [PATCH] pylint: fixed Redefining built-in --- createrepo/__init__.py | 26 +++++++++++++------------- createrepo/utils.py | 18 +++++++++--------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/createrepo/__init__.py b/createrepo/__init__.py index 7566628..25d3b0c 100644 --- a/createrepo/__init__.py +++ b/createrepo/__init__.py @@ -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') diff --git a/createrepo/utils.py b/createrepo/utils.py index 894594c..fb23964 100644 --- a/createrepo/utils.py +++ b/createrepo/utils.py @@ -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 -- 2.34.1