Skip to content

Commit

Permalink
move cwd addition to __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
furlongm committed Dec 21, 2024
1 parent c788b21 commit 2d2db23
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
6 changes: 6 additions & 0 deletions openvpn_monitor/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import os
import sys

cwd = os.path.dirname(__file__)
os.chdir(cwd)
sys.path.append(cwd)
14 changes: 5 additions & 9 deletions openvpn_monitor/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,11 @@
from flask_wtf import CSRFProtect
from humanize import naturalsize
from pprint import pformat

cwd = os.path.dirname(__file__)
os.chdir(cwd)
sys.path.append(cwd)
from config.loader import ConfigLoader # noqa
from vpns.openvpn.data_collector import VPNDataCollector # noqa
from vpns.openvpn.disconnector import VPNDisconnector # noqa
from location_data.maxmind.geoip import GeoipDBLoader # noqa
from util import is_truthy # noqa
from config.loader import ConfigLoader
from vpns.openvpn.data_collector import VPNDataCollector
from vpns.openvpn.disconnector import VPNDisconnector
from location_data.maxmind.geoip import GeoipDBLoader
from util import is_truthy

logging.basicConfig(stream=sys.stderr, format='[%(asctime)s] [%(process)d] [%(levelname)s] %(message)s')
logging.getLogger().setLevel(logging.INFO)
Expand Down

0 comments on commit 2d2db23

Please sign in to comment.