diff --git a/mesures/p5d.py b/mesures/p5d.py index a1b8f1e..79b24ab 100644 --- a/mesures/p5d.py +++ b/mesures/p5d.py @@ -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,