8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-22 11:23:10 +00:00

refactor: 🎨 Replace os.path by pathlib

This commit is contained in:
Yoann Pétri 2020-11-30 14:12:01 +01:00
parent 68bab01fa2
commit bca20e28f6
Signed by: nanoy
GPG key ID: DC24C5787C943389

View file

@ -40,7 +40,7 @@ from configparser import ConfigParser
from re2oapi import Re2oAPIClient from re2oapi import Re2oAPIClient
import sys import sys
import os from pathlib import Path
import subprocess import subprocess
import logging import logging
import traceback import traceback
@ -114,10 +114,10 @@ def instantiate(*_):
""" """
logger.info("Instantiation") logger.info("Instantiation")
path = (os.path.dirname(os.path.abspath(__file__))) path = Path(__file__).resolve(strict=True).parent
config = ConfigParser() config = ConfigParser()
config.read(path+'/config.ini') config.read(path / 'config.ini')
api_hostname = config.get('Re2o', 'hostname') api_hostname = config.get('Re2o', 'hostname')
api_password = config.get('Re2o', 'password') api_password = config.get('Re2o', 'password')