Handles cases where pip may not be wanted
This commit is contained in:
parent
f2249c4f6c
commit
7e2900ad78
3 changed files with 7 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -25,3 +25,4 @@ hostMonitorStartTime = "00:00:00"
|
|||
hostMonitorEndTime = "23:59:59"
|
||||
urlMonitorStartTime = "00:00:00"
|
||||
urlMonitorEndTime = "23:59:59"
|
||||
usePip = True
|
||||
|
|
7
main.py
7
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
|
||||
|
|
Loading…
Reference in a new issue