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

Adding ability to export PNG data directly to other programs. #55

Merged
merged 6 commits into from
Jul 4, 2020
Merged

Adding ability to export PNG data directly to other programs. #55

merged 6 commits into from
Jul 4, 2020

Conversation

slightlynybbled
Copy link
Contributor

I would like to build on your tool with a GUI. This pull request puts the beginnings of the API into the project.

Example Usage

from wireviz.wireviz import parse

# taking the string from a text entry frame (tkinter style)
f_in = StringIO(self._text_entry_frame.get())

# put the png data directly into the `data` variable for use later
data = parse(f_in, return_types='png')

# can use the image data for whatever I want now... in this case, I'll just save it
# but I could put it on a canvas and preview if I like
with open('data.png', 'wb') as f:
    f.write(data)

Future Work

At this time, I only added support for png, but I left room in there to potentially add more types and even multiple types. Also put the beginnings of a docstring in there to explain my changes, but didn't fill it out fully just in case you wanted to put your own words in there.

@formatc1702 formatc1702 changed the base branch from master to dev July 4, 2020 12:13
@formatc1702 formatc1702 merged commit ebf1e5a into wireviz:dev Jul 4, 2020
formatc1702 added a commit that referenced this pull request Jul 4, 2020
@formatc1702
Copy link
Collaborator

formatc1702 commented Jul 4, 2020

Thanks, I like the idea a lot. I merged it and took the liberty to rewrite the addition to the parse() function (144c99e), let me know what you think.

Returning the BOM as a 2D list (just like the TSV output), or as a dict, could also be a nice addition, but that's a story for another PR.

@slightlynybbled
Copy link
Contributor Author

Thanks for accepting the merge.

The GUI code that uses your repo: wireviz-gui

Installation is a bit complicated at the moment, but that will be simplified as the code bases become more stable. Look forward to seeing what the future brings!

@formatc1702
Copy link
Collaborator

@slightlynybbled, here's a little recommendation for future commit messages, both here and in your own repos, regarding the use of imperative mood. I noticed the messages in your wireviz-gui repo might benefit from this :)

@slightlynybbled
Copy link
Contributor Author

slightlynybbled commented Jul 7, 2020 via email

@slightlynybbled
Copy link
Contributor Author

Just wanted to let you know that I created a bundled executable based on your current dev branch.

https://github.com/slightlynybbled/wireviz-gui

https://github.com/slightlynybbled/wireviz-gui/releases

Your repository is credited and linked in the About menu.

Not feature-rich yet, but a better workflow for those unhappy with the command line...

Thank you for this package! As it becomes more mature, I will continue to add features!

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.

2 participants