Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Francesco Witz
Changelog Generator
Commits
a102091e
Commit
a102091e
authored
Feb 13, 2022
by
Francesco Witz
Browse files
fix: wrong path attribute access
parent
8deffd3f
Changes
1
Hide whitespace changes
Inline
Side-by-side
file_generator.py
View file @
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
]):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment