diff --git a/README.md b/README.md index f7cc9e2..e01b075 100644 --- a/README.md +++ b/README.md @@ -38,4 +38,4 @@ See the available configuration options, which should be specified in config.py. - **hostMonitorEndTime** - the end time which the host monitor should shut down. This does not stop the script itself and this monitor will restart at the start time. - **urlMonitorStartTime** - the start time which the url monitor should start at the earliest. - **urlMonitorEndTime** - the end time which the url monitor would shut down. This does not stop the script itself and this monitor will restart at the start time. - +- **usePip** - whether or not to use pip to install dependencies. Set to false if your environment is externally managed diff --git a/config.py.sample b/config.py.sample index 312f5a7..b1455d4 100644 --- a/config.py.sample +++ b/config.py.sample @@ -25,3 +25,4 @@ hostMonitorStartTime = "00:00:00" hostMonitorEndTime = "23:59:59" urlMonitorStartTime = "00:00:00" urlMonitorEndTime = "23:59:59" +usePip = True diff --git a/main.py b/main.py index 75a8208..13e44fb 100755 --- a/main.py +++ b/main.py @@ -34,6 +34,9 @@ def get_pip_command(): def install_dependencies(): + if not config.usePip: + return + pip_command = get_pip_command() with open('requirements.txt', 'r') as req_file: @@ -250,12 +253,12 @@ if __name__ == "__main__": import sys import subprocess + import config install_dependencies() - import config - import psutil import os + import psutil import time import log import requests