Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/cygwin-apps/calm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2020-06-11 18:06:46 +0300
committerJon Turney <jon.turney@dronecode.org.uk>2020-06-11 18:11:42 +0300
commit971a99a1ea11874f0cb4e30dc2c24c1d664aaf5a (patch)
tree78dae65b368a6f21a5f0b6cc1d8f40d36502b159
parent00aa2d297c2c10942fb7b7aded4927a733350b8b (diff)
Avoid shadowing 'dir' builtin
A001 "dir" is a python builtin and is being shadowed, consider renaming the variable
-rwxr-xr-xcalm/pkg2html.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/calm/pkg2html.py b/calm/pkg2html.py
index 3750e81..4840734 100755
--- a/calm/pkg2html.py
+++ b/calm/pkg2html.py
@@ -408,14 +408,14 @@ def write_arch_listing(args, packages, arch):
for p in packages:
- dir = os.path.join(base, p)
- ensure_dir_exists(args, dir)
+ dirpath = os.path.join(base, p)
+ ensure_dir_exists(args, dirpath)
#
# write .htaccess if needed
#
- htaccess = os.path.join(dir, '.htaccess')
+ htaccess = os.path.join(dirpath, '.htaccess')
if not os.path.exists(htaccess):
if not args.dryrun or args.force:
with utils.open_amifc(htaccess) as f:
@@ -437,15 +437,15 @@ def write_arch_listing(args, packages, arch):
#
# for each tarfile, write tarfile listing
#
- if os.path.exists(dir):
- listings = os.listdir(dir)
+ if os.path.exists(dirpath):
+ listings = os.listdir(dirpath)
listings.remove('.htaccess')
else:
listings = []
for tn, to in itertools.chain.from_iterable([packages[p].tars[vr].items() for vr in packages[p].tars]):
fver = re.sub(r'\.tar.*$', '', tn)
- listing = os.path.join(dir, fver)
+ listing = os.path.join(dirpath, fver)
# ... if it doesn't already exist, or --force --force
if not os.path.exists(listing) or (args.force > 1):