Skip to content

Comments

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

Merged
17o2 merged 6 commits intowireviz:devfrom
slightlynybbled:master
Jul 4, 2020
Merged

Adding ability to export PNG data directly to other programs.#55
17o2 merged 6 commits intowireviz:devfrom
slightlynybbled:master

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.

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

17o2 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!

@17o2
Copy link
Collaborator

17o2 commented Jul 6, 2020

@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!

@17o2 17o2 added this to the v0.2 milestone Jul 19, 2020
lxander42 pushed a commit to lxander42/PipeViz that referenced this pull request Sep 20, 2025
lxander42 pushed a commit to lxander42/PipeViz that referenced this pull request Sep 20, 2025
lxander42 pushed a commit to lxander42/PipeViz that referenced this pull request Sep 20, 2025
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