Skip to content

Commit

Permalink
target: Align Target.tempfile() with Target.make_temp()
Browse files Browse the repository at this point in the history
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 "_"
  • Loading branch information
douglas-raillard-arm committed Nov 20, 2024
1 parent 8d03e87 commit c137b5b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions devlib/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -1315,8 +1315,10 @@ def get_workpath(self, name):
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 ''
sufix = f'-{suffix}' if suffix else ''
name = '{prefix}{uuid}{suffix}'.format(
prefix=prefix,
uuid=uuid.uuid4().hex,
suffix=suffix,
Expand Down

0 comments on commit c137b5b

Please sign in to comment.