diff --git a/bazel/labgrid/runner/runner.py b/bazel/labgrid/runner/runner.py index d42c658b1dd2ddb91519c435f99125f8b60d0c95..0a15d9fd2f33646cd62f52f7b236f317c866e673 100644 --- a/bazel/labgrid/runner/runner.py +++ b/bazel/labgrid/runner/runner.py @@ -30,9 +30,11 @@ class FileTransfer: # FIXME: Decide whether or not to transfer runfiles implicitly instead of using a flag include_runfiles: bool - def __init__(self, remote: str, local: str, optional=False, include_runfiles=False): + def __init__( + self, remote: str, local: str = "", optional=False, include_runfiles=False + ): object.__setattr__(self, "remote", PurePath(remote)) - object.__setattr__(self, "local", Path(local)) + object.__setattr__(self, "local", Path(local if local else remote)) object.__setattr__(self, "optional", optional) object.__setattr__(self, "include_runfiles", include_runfiles) diff --git a/examples/custom-runners/archive-transfer/run.py b/examples/custom-runners/archive-transfer/run.py index 57db6575437716f3058bfc9618bd232207971d01..552256db60e85120cf092cc978abda57353c5b7a 100644 --- a/examples/custom-runners/archive-transfer/run.py +++ b/examples/custom-runners/archive-transfer/run.py @@ -21,7 +21,7 @@ def main(): runfiles = Runfiles.Create() unzip = FileTransfer("unzip", runfiles.Rlocation("ape/ape/assimilate/unzip/unzip")) - archive = FileTransfer("archive.zip", "archive.zip") + archive = FileTransfer("archive.zip") with ZipFile(archive.local, "w") as zipfile: zipfile.write(args.program, arcname=args.program.name)