Commit 22a7b412 authored by Francesco Witz's avatar Francesco Witz
Browse files

Merge branch 'fix' into 'main'

fix: wrong path attribute access

See merge request !8
parents 2d57f390 a102091e
......@@ -12,8 +12,8 @@ class File():
def get_where_to_write(self) -> int:
""" Method that retrieve the position of the last changelog section """
if os.path.exists(self.path):
with open(self.path, 'r') as file:
if os.path.exists(self.__path):
with open(self.__path, 'r') as file:
lines: list[str] = file.readlines()
# Creating regex to find section title
version_pattern = re.compile("[0-9]+.[0-9]+.[0-9]+")
......@@ -26,15 +26,15 @@ class File():
def read_chlog(self) -> list[str]:
""" Method that opens and read the chlog file lines """
if os.path.exists(self.path):
with open(self.path, 'r') as file:
if os.path.exists(self.__path):
with open(self.__path, 'r') as file:
return file.readlines()
def write_chlog(self, newlines: list[str]):
""" Method that writes the new lines in the chlog file"""
if os.path.exists(self.path):
with open(self.path, 'w') as file:
if os.path.exists(self.__path):
with open(self.__path, 'w') as file:
file.writelines(newlines)
def write_changes(project_path: str, file: File, commits: list[Commit]):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment