Updated to self method

Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
Dimitris Zlatanidis 2020-01-15 23:47:06 +01:00
parent 95b53cc51c
commit 3a7f53c00b
2 changed files with 3 additions and 3 deletions

View file

@ -690,7 +690,8 @@ class Initialization:
for f in infiles:
if os.path.isfile(f"{path}{f}"):
# checking the encoding before read the file
code = Utils.check_encoding(path, f)
utils = Utils()
code = utils.check_encoding(path, f)
with open(path + f, "r", encoding=code) as in_f:
for line in in_f:
out_f.write(line)

View file

@ -102,8 +102,7 @@ class Utils:
else:
return file_name
@staticmethod
def check_encoding(path, f):
def check_encoding(self, path, f):
"""Checking the file encoding default is utf-8
"""
try: