1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-03-04 09:17:51 +00:00

target: Align Target.tempfile() with Target.make_temp()

Align the parameters between the 2 methods:
* Use "None" as default value
* Do not add suffix or prefix if not asked for.
* Separate components with "-" instead of "_"
This commit is contained in:
Douglas Raillard 2024-11-20 12:57:04 +00:00 committed by Marc Bonnici
parent 3e1c928db3
commit 1da260b897

View File

@ -1334,8 +1334,10 @@ fi
return self.path.join(self.working_directory, name)
@asyn.asyncf
async def tempfile(self, prefix='', suffix=''):
name = '{prefix}_{uuid}_{suffix}'.format(
async def tempfile(self, prefix=None, suffix=None):
prefix = f'{prefix}-' if prefix else ''
suffix = f'-{suffix}' if suffix else ''
name = '{prefix}{uuid}{suffix}'.format(
prefix=prefix,
uuid=uuid.uuid4().hex,
suffix=suffix,