Add line in error message

This commit is contained in:
Jose De Freitas 2021-02-26 10:06:16 -05:00
parent 5cd98691da
commit 91e7f28ac1
3 changed files with 7 additions and 7 deletions

View File

@ -42,7 +42,7 @@ class ContentAbout():
with open(file_readme, 'w') as write_readme: with open(file_readme, 'w') as write_readme:
write_readme.writelines(content) write_readme.writelines(content)
self.result = "🔴 -1: backslash.\nFixed." self.result = f"🔴 {line}: backslash.\nFixed."
return self.result return self.result

View File

@ -46,7 +46,7 @@ class FeaturedPlaylists():
with open(file_readme, 'w') as write_readme: with open(file_readme, 'w') as write_readme:
write_readme.writelines(content) write_readme.writelines(content)
self.result = "🔴 -1: backslash | line break.\nFixed." self.result = f"🔴 {line}: backslash | line break.\nFixed."
elif last != "\\" and "<br>" in content[line+1]: elif last != "\\" and "<br>" in content[line+1]:
if last == " ": if last == " ":
content[line] = f"{value[:-1]}\\\n" content[line] = f"{value[:-1]}\\\n"
@ -56,14 +56,14 @@ class FeaturedPlaylists():
with open(file_readme, 'w') as write_readme: with open(file_readme, 'w') as write_readme:
write_readme.writelines(content) write_readme.writelines(content)
self.result = "🔴 -1: backslash.\nFixed." self.result = f"🔴 {line}: backslash.\nFixed."
elif last == "\\" and "<br>" not in content[line+1]: elif last == "\\" and "<br>" not in content[line+1]:
content[line+1] = "<br>\n\n" content[line+1] = "<br>\n\n"
with open(file_readme, 'w') as write_readme: with open(file_readme, 'w') as write_readme:
write_readme.writelines(content) write_readme.writelines(content)
self.result = "🔴 -1: line break.\nFixed." self.result = f"🔴 {line}: line break.\nFixed."
return self.result return self.result

View File

@ -43,7 +43,7 @@ class YoutubersNames():
with open(file_readme, 'w') as write_readme: with open(file_readme, 'w') as write_readme:
write_readme.writelines(content) write_readme.writelines(content)
self.result = "🔴 -1: backslash.\nFixed." self.result = f"🔴 {line}: backslash.\nFixed."
return self.result return self.result
@ -56,10 +56,10 @@ class YoutubersNames():
for line, value in enumerate(content): for line, value in enumerate(content):
if self.checker in value: if self.checker in value:
if link not in value: if link not in value:
self.result = "🔴 -1: YouTube link." self.result = f"🔴 {line}: YouTube link."
return self.result return self.result
youtubers_names = YoutubersNames() youtubers_names = YoutubersNames()
print(youtubers_names) print(youtubers_names.trailing_slash())