chore: fix python lint warnings (#14638)

* chore: fix lint warnings

* chore: another try at python import errors

Looks like the problem is that dbus_mock.py is running as
a script but living in the `lib/` directory where it's part of a
module. Moving it up into the `script/` directory seems to
solve the issue.
This commit is contained in:
Charles Kerr 2018-09-16 12:24:07 -05:00 committed by GitHub
parent 6d01952e66
commit a45ded5508
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 111 additions and 74 deletions

View file

@ -57,29 +57,28 @@ def getBrokenLinks(filepath):
for link in links:
sections = link.split('#')
if len(sections) > 1:
if str(link).startswith('#'):
if not checkSections(sections, lines):
brokenLinks.append(link)
else:
tempFile = os.path.join(currentDir, sections[0])
if os.path.isfile(tempFile):
try:
newFile = open(tempFile, 'r')
newLines = newFile.readlines()
except KeyboardInterrupt:
print('Keyboard interruption whle parsing. Please try again.')
finally:
newFile.close()
if not checkSections(sections, newLines):
brokenLinks.append(link)
else:
brokenLinks.append(link)
else:
if len(sections) < 2:
if not os.path.isfile(os.path.join(currentDir, link)):
brokenLinks.append(link)
elif str(link).startswith('#'):
if not checkSections(sections, lines):
brokenLinks.append(link)
else:
tempFile = os.path.join(currentDir, sections[0])
if os.path.isfile(tempFile):
try:
newFile = open(tempFile, 'r')
newLines = newFile.readlines()
except KeyboardInterrupt:
print('Keyboard interruption whle parsing. Please try again.')
finally:
newFile.close()
if not checkSections(sections, newLines):
brokenLinks.append(link)
else:
brokenLinks.append(link)
print_errors(filepath, brokenLinks)
return len(brokenLinks)