Allow overriding config file location with LEDGER_PYREPORT_CONFIG environment variable

This commit is contained in:
RunasSudo 2020-03-31 02:10:46 +11:00
parent 4159032674
commit 8c8c0c626f
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A

View File

@ -14,7 +14,8 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
import os
import yaml
with open('config.yml', 'r') as f:
with open(os.getenv('LEDGER_PYREPORT_CONFIG', 'config.yml'), 'r') as f:
config = yaml.safe_load(f)