DPDK patches and discussions
 help / color / mirror / Atom feed
From: Patrick Robb <probb@iol.unh.edu>
To: Luca Vizzarro <luca.vizzarro@arm.com>
Cc: dev@dpdk.org, Paul Szczepanek <paul.szczepanek@arm.com>
Subject: Re: [PATCH 4/6] dts: add artifact module
Date: Mon, 11 Aug 2025 21:25:29 -0400	[thread overview]
Message-ID: <CAJvnSUAvo4NimU9xVVGY10uGhGDcsQQ-gBbW0QfHS3pANf64pQ@mail.gmail.com> (raw)
In-Reply-To: <20250725151503.87374-5-luca.vizzarro@arm.com>

[-- Attachment #1: Type: text/plain, Size: 1996 bytes --]

On Fri, Jul 25, 2025 at 11:15 AM Luca Vizzarro <luca.vizzarro@arm.com>
wrote:

>
> +
> +@overload
> +def make_file_path(node: Node, file_name: str, custom_path: PurePath |
> None = None) -> PurePath: ...
> +
> +
> +@overload
> +def make_file_path(node: None, file_name: str, custom_path: PurePath |
> None = None) -> Path: ...
> +
> +
> +def make_file_path(
> +    node: Node | None, file_name: str, custom_path: PurePath | None = None
>

Maybe it makes sense to set a default value of None for node? That way
people don't have to pass in None every time they want to make a path on
the DTS engine system.


>
> +    def open(
> +        self, file_mode: BinaryMode | TextMode = "rb", buffering: int = -1
> +    ) -> Union["ArtifactFile", TextIOWrapper]:
> +        """Open the artifact file.
> +
> +        Args:
> +            file_mode: The mode of file opening.
> +            buffering: The size of the buffer to use. If -1, the default
> buffer size is used.
> +
> +        Returns:
> +            An instance of :class:`ArtifactFile` or
> :class:`TextIOWrapper`.
> +        """
> +        if self._fd is not None and not self._fd.closed:
> +            self._logger.warning(
> +                f"Artifact {self.path} is already open. Closing the
> previous file descriptor."
> +            )
> +            self._fd.close()
> +        elif not self._directories_created:
> +            self.mkdir()
> +
> +        # SFTPFile does not support text mode, therefore everything needs
> to be handled as binary.
> +        if "t" in file_mode:
> +            actual_mode = cast(BinaryMode, cast(str,
> file_mode).replace("t", "") + "b")
>

Is it worth logging this event to prevent confusion? (where we change the
requested mode to binary mode)

+        elif "b" not in file_mode:
> +            actual_mode = cast(BinaryMode, file_mode + "b")
>

same


>
> --
> 2.43.0
>
>
Reviewed-by: Patrick Robb <probb@iol.unh.edu>

[-- Attachment #2: Type: text/html, Size: 3200 bytes --]

  reply	other threads:[~2025-08-12  1:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-25 15:11 [PATCH 0/6] dts: add file management Luca Vizzarro
2025-07-25 15:11 ` [PATCH 1/6] dts: merge RemoteSession class Luca Vizzarro
2025-08-08  1:15   ` Patrick Robb
2025-07-25 15:11 ` [PATCH 2/6] dts: add node retriever by identifier Luca Vizzarro
2025-08-08 18:10   ` Patrick Robb
2025-07-25 15:11 ` [PATCH 3/6] dts: add current test suite and cases to context Luca Vizzarro
2025-08-08 18:19   ` Patrick Robb
2025-07-25 15:11 ` [PATCH 4/6] dts: add artifact module Luca Vizzarro
2025-08-12  1:25   ` Patrick Robb [this message]
2025-08-12  8:31     ` Luca Vizzarro
2025-08-12 13:50       ` Patrick Robb
2025-08-12  3:26   ` Patrick Robb
2025-08-12  8:21     ` Luca Vizzarro
2025-07-25 15:11 ` [PATCH 5/6] dts: make log files into artifacts Luca Vizzarro
2025-08-12  3:10   ` Patrick Robb
2025-07-25 15:11 ` [PATCH 6/6] dts: use artifacts in packet capture and softnic Luca Vizzarro
2025-08-12  3:29   ` Patrick Robb

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJvnSUAvo4NimU9xVVGY10uGhGDcsQQ-gBbW0QfHS3pANf64pQ@mail.gmail.com \
    --to=probb@iol.unh.edu \
    --cc=dev@dpdk.org \
    --cc=luca.vizzarro@arm.com \
    --cc=paul.szczepanek@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).