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

Path manipulation doesn't work when Logic is running on different OS than the Python module #62

Open
mitbrooks opened this issue Jul 9, 2020 · 1 comment

Comments

@mitbrooks
Copy link

Logic analyser running on a windows machine,
From a linux machine:

import saleae
la = saleae.Saleae("hostname")
la.save_to_file('c:/test_file.logicdata')
la.load_from_file('c:/test_file.logicdata')

doesn't work.
The same does work on a windows machine.
I believe this is because in linux,
os.path.abspath('c:/test_file.logicdata')
returns
/current/linux/working/directory/C:/test_file.logicdata

Would using os.path.normpath() work better here?

@ppannuto
Copy link
Owner

Not quite like that unfortunately. normpath alone is insufficient, it would need to be basically what's suggested in the python docs of normpath(join(os.getcwd(), path)).

The deeper problem here is that Logic doesn't support relative paths, so we have to convert to an absolute path. The rules for path manipulation will come from the os module where the Python script is running. If Logic is running on a different operating system, this module would have to be told that somehow (I don't believe there is a is an absolute path on any operating system function we can call).

@ppannuto ppannuto changed the title can't save_to_file and load_from_file from linux when logic analyser is running on windows Path manipulation doesn't work when Logic is running on different OS than the Python module Jul 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants