Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/PYMD/interface/translations/others/ABOUT_es_CO.trg
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ pre{line-height: 1 !important; font-size: 15px;}
<hr>
<div>
<pre class="center" style="line-height: 0.7 !important">PYMD V0.1.0 - Beta</pre>
<pre class="center"><a href="https://pymd.dev2forge.software">Sitio Web</a></pre>
<table style="margin-top: 10px" align="center" width="60%">
<tr>
<td><pre class="center"><a href="https://pymd.dev2forge.software">Sitio Web</a></pre></td>
<td><pre class="center"><a href="https://github.com/Dev2Forge/pymd/issues">Reportar Insidencias</a></pre></td>
</tr>
</table>
<pre class="center">Soporte <a href="mailto:pymd@dev2forge.software">pymd@dev2forge.software</a></pre>
</div>
</div>
7 changes: 0 additions & 7 deletions src/PYMD/utils/FilesManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,18 @@ def __init__(self, filename:str | None = None, output:str | None = None, encodin
self.__fn:Path = Path(filename) # Path to file + extension
self.__ot:Path = Path(output) # Path to file output + extension
self.__en:str = encoding # Encoding to write a file .md
p.inf(f'FILE => {self.file}\nDIRECTORIO => {self.dir_output}')
self.__validate()

def __validate(self) -> bool | None:
"""Validate an extension file, and output existing"""
__allowed:bool = self.__fn.suffix.lower() in self.extensions()
p.suc(self.__fn.absolute().suffix)
__exists:bool = self.__fn.is_file()
__exists_dir:bool = self.__ot.is_dir()
if not __allowed:
p.err(f'File extension ("{self.__fn.suffix.lower()}") not allowed')
raise TypeError(f'File extension ("{self.__fn.suffix.lower()}") not allowed')
if not __exists:
p.err(f'File "{self.__fn.name}" not found')
raise FileNotFoundError(f'File "{self.__fn.name}" not found')
if not __exists_dir:
p.err(f'"{self.__ot.absolute()}" not found')
raise NotADirectoryError(f'"{self.__ot.absolute()}" not found')
return True

Expand All @@ -40,15 +35,13 @@ def save_md(self, content:str) -> bool:
__file_md:str = f'{self.dir_output}/{self.__fn.stem}.md'
try:
if type(content) is not str:
p.err('Content must be a string')
raise TypeError('The content must be a string')
with open(__file_md, 'w', encoding=self.__en) as __file:
__file.write(content)
log.log(f'File "{__file_md}" saved successfully')
__return = True
except Exception as Error:
log.log_e(Error)
p.err('An error occurred while writing the file.')
return __return

@staticmethod
Expand Down