Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export functions should accept pathlib.Path as a parameter #16

Open
Yinameah opened this issue Jan 13, 2023 · 1 comment
Open

export functions should accept pathlib.Path as a parameter #16

Yinameah opened this issue Jan 13, 2023 · 1 comment

Comments

@Yinameah
Copy link

Hello,

First, congrats for this new automation library, I've been looking at it for quite some times, and now I'have had the opportunity to play a bit with, and it's really cool.

I have a minor issue (more of an inconvenience, really).

I think capture.save_capture(), capture.export_.....() functions should accept pathlib.Path object as parameter, since it is part of the standard library.

my_path = pathlib.Path(os.getcwd()).parent.absolute() # handy
capture = manager.start_capture( ..... )
capture.wait()
capture.save_capture(my_path)

This gives a TypeError: bad argument type for built-in operation (which by the way is not the most clear error ever. . .)

Obviously, the fix could be straightforward :

    def save_capture(self, filepath: str|pathlib.Path):
        """
        Saves the capture to a .sal file, which can be loaded later either through the UI or with the load_capture() function.

        :param filepath: path to the .sal file. Can be absolute, or relative to the Logic 2 software current working directory.
        """
        request = saleae_pb2.SaveCaptureRequest(
            capture_id=self.capture_id, filepath=str(filepath)
        )

Best regards.

@timreyes
Copy link

Thanks for the feedback and for providing a snippet of the fix! We'll have this reviewed by the software team here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants