Skip to content

Commit

Permalink
Merge pull request #60 from gisce/fix_version_control_p5d
Browse files Browse the repository at this point in the history
Añadir control de versión incremental en la generación de ficheros P5D
  • Loading branch information
davidmunoznovoa authored Feb 13, 2024
2 parents 62050ca + 1318886 commit 8293aae
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mesures/p5d.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ def writer(self):
P5D contains an hourly raw curve
:return: file path
"""
existing_files = os.listdir('/tmp')
if existing_files:
versions = [int(f.split('.')[1]) for f in existing_files if self.filename.split('.')[0] in f]
if versions:
self.version = max(versions) + 1

file_path = os.path.join('/tmp', self.filename)
kwargs = {'sep': ';',
'header': False,
Expand Down

0 comments on commit 8293aae

Please sign in to comment.