Skip to content

Commit

Permalink
Code linting.
Browse files Browse the repository at this point in the history
  • Loading branch information
nomike committed Sep 18, 2024
1 parent 43ef423 commit 3a2743a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions templatehelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ def listdir(path):
"""
ignorelist = ['index', 'index.md', '*.scmsfasicon', '*.scmstarget']
if os.path.exists(os.path.join(pathprefix, path, '.scmsignore')):
with open(os.path.join(pathprefix, path, '.scmsignore'), encoding=locale.getencoding()) as scsmignore:
with open(
os.path.join(pathprefix, path, '.scmsignore'),
encoding=locale.getencoding()) as scsmignore:
ignorelist.extend([line.strip('\n') for line in scsmignore.readlines()])
dirlist = [
os.path.basename(f)
Expand Down Expand Up @@ -113,15 +115,19 @@ def listchildren(path):
"""
ignorelist = ['index', 'index.md', '*.scmsfasicon', '*.scmstarget']
if os.path.exists(os.path.join(pathprefix, path, '.scmsignore')):
with open(os.path.join(pathprefix, path, '.scmsignore'), encoding=locale.getencoding()) as scmsignore:
with open(
os.path.join(pathprefix, path, '.scmsignore'),
encoding=locale.getencoding()) as scmsignore:
ignorelist.extend([line.strip('\n') for line in scmsignore.readlines()])
dirlist = [
[os.path.basename(f), os.path.basename(f)]
for f in os.listdir(os.path.join(pathprefix, path))
if regex.match('^(?!\\.).*(?<!~)$', f) and not f in ignorelist
]
if os.path.exists(os.path.join(pathprefix, path, '.scmslinks')):
with open(os.path.join(pathprefix, path, '.scmslinks'), encoding=locale.getencoding()) as scmslinks:
with open(
os.path.join(pathprefix, path, '.scmslinks'),
encoding=locale.getencoding()) as scmslinks:
additional_links = json.load(scmslinks)
dirlist.extend(additional_links)
removeitems = []
Expand Down

0 comments on commit 3a2743a

Please sign in to comment.