Skip to content

Commit

Permalink
Flake8 clean pymodbus. (#871)
Browse files Browse the repository at this point in the history
  • Loading branch information
janiversen authored May 3, 2022
1 parent e861d72 commit 18aa463
Show file tree
Hide file tree
Showing 163 changed files with 6,232 additions and 5,893 deletions.
5 changes: 5 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# flake8 configuration.
[flake8]
exclude = .tox,.git,__pycache__
ignore = D211,D400,E251,E731,W503
max-line-length = 120
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ jobs:
# continue_on_error: true
- name: flake8
tox: flake8
continue_on_error: true
# continue_on_error: true
- name: Docs
tox: docs
os:
Expand Down
18 changes: 11 additions & 7 deletions doc/api/doxygen/build.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
#!/usr/bin/env python3
""" Doxygen API Builder
---------------------
"""
"""Doxygen API Builder."""
import os
import shutil


def is_exe(path):
""" Returns if the program is executable
"""Return if the program is executable.
:param path: The path to the file
:return: True if it is, False otherwise
"""
return os.path.exists(path) and os.access(path, os.X_OK)


def which(program):
""" Check to see if an executable exists
"""Check to see if an executable exists.
:param program: The program to check for
:return: The full path of the executable or None if not found
"""
Expand All @@ -28,9 +30,11 @@ def which(program):
return exe_file
return None


if which('doxygen') is not None:
print("Building Doxygen API Documentation")
os.system("doxygen .doxygen") #nosec
os.system("doxygen .doxygen") # nosec
if os.path.exists('../../../build'):
shutil.move("html", "../../../build/doxygen")
else: print("Doxygen not available...not building")
else:
print("Doxygen not available...not building")
11 changes: 5 additions & 6 deletions doc/api/epydoc/build.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python3
""" Epydoc API Runner
------------------
"""Epydoc API Runner.
Using pkg_resources, we attempt to see if epydoc is installed,
if so, we use its cli program to compile the documents
Expand All @@ -14,7 +13,7 @@
try:
pkg_resources.require("epydoc")

from epydoc.cli import cli # pylint: disable=import-error
from epydoc.cli import cli # pylint: disable=import-error
sys.argv = """epydoc.py pymodbus
--html --simple-term --quiet
--include-log
Expand All @@ -25,7 +24,7 @@
--exclude=tests
--output=html/
""".split()
#bugs in trunk for --docformat=restructuredtext
# bugs in trunk for --docformat=restructuredtext

if not os.path.exists("./html"):
os.mkdir("./html")
Expand All @@ -35,6 +34,6 @@

if os.path.exists('../../../build'):
shutil.move("html", "../../../build/epydoc")
except Exception: # pylint: disable=broad-except
except Exception: # pylint: disable=broad-except
traceback.print_exc(file=sys.stdout)
print( "Epydoc not available...not building")
print("Epydoc not available...not building")
Loading

0 comments on commit 18aa463

Please sign in to comment.