Skip to content

Commit

Permalink
Move main to function
Browse files Browse the repository at this point in the history
  • Loading branch information
janw committed Feb 22, 2019
1 parent d3ff7fb commit fddba38
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion piholeinflux.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ def send_msg(influxdb, resp, name):
influxdb.write_points(json_body)


if __name__ == "__main__":
def main():
"""Main application daemon."""
config = ConfigParser()
config.read(path.join(HERE, "config.ini"))

Expand Down Expand Up @@ -83,3 +84,7 @@ def send_msg(influxdb, resp, name):
sys.exit(1)

sleep(reporting_interval)


if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
test=pytest

[flake8]
ignore = E203, E266, E501, W503, D100, D107
ignore = E203, E266, E501, W503, D100, D107, D401
max-line-length = 88
max-complexity = 18

Expand Down

0 comments on commit fddba38

Please sign in to comment.