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

Add a button that saves detected cart info to file #109

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

selenologist
Copy link

I kept having to open a text editor to save the cart info copied to clipboard, so I just whipped up a save to file button.

Let me know if it needs any improvement. The error checking on the actual file saving part seems to work but it's a little hamfisted.

Haven't tested on any platforms other than Linux but we should be good, there's no directory characters in the path editing in this commit. I'm not sure whether the emitted file has Windows-friendly CRLF newlines, though.

@selenologist
Copy link
Author

re CRLF line endings

https://docs.python.org/3/tutorial/inputoutput.html#reading-and-writing-files

In text mode, the default when reading is to convert platform-specific line endings (\n on Unix, \r\n on Windows) to just \n. When writing in text mode, the default is to convert occurrences of \n back to platform-specific line endings. This behind-the-scenes modification to file data is fine for text files, but will corrupt binary data like that in JPEG or EXE files.

So they should be CRLF when FlashGBX is run on Windows. Cool. Would be great if someone could test it though.

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

Successfully merging this pull request may close these issues.

1 participant