-
Notifications
You must be signed in to change notification settings - Fork 84
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
Un-bloat and speed-up (FYI, not for merge) #145
base: master
Are you sure you want to change the base?
Conversation
* Added a Makefile for installing/uninstalling * Made it center one-line texts within speech bubbles * Made it importable * Added a funny test script * Added proper *think support * Fixed chrysalis' quotes file * Fixed a bug wrongly cropping the output
Which branch did you start your work from? |
This is based on master. |
@jristz I had a look on the changes in develop. As far as I can tell I really do not think something as simple as a slightly more advanced cowsay clone (sry ;) needs to take up 4000 lines of code1. Short, concise code is more maintainable, hackable and reliable than what you currently have. |
the metadata is fo give proper credits, searching and onther stuff |
I added a Makefile for installation/uninstallation and bash/zsh-completion. The zsh completion is even tested! ;) |
Complete for bash, zsh and fish is generated, using the content in the completion directory. |
I just wrote a script converting .pony files back to pngs that includes the metadata in the png metadata (132 lines), and I fixed my png->terminal renderer to print the png metadata in the comment field (now 98 lines). I also converted my repo so it only includes the source pngs so they can be rendered by the makefile. That way conversion is possible in both ways, all the while preserving metadata. If you wanted to use my code (which I very much advise you to do) you could probably emulate that whole group stuff with a bunch of symlinks and like three lines of code. This fork now has everything I expect of it (which excludes the ttyponies, fancy metadata handling and 1337-page pdf) in less than 5% of the code. btw, the zsh/bash completion is just like 30 lines each, so I do not think that warrants using an automated tool. |
I will look in to what you have done as soon as I can. There is a problem with using PNG in the source, the .pony-files include more features than you might except, Auto-complete automation is nice, because we something is added it can applied to all shells. And if a shell is not |
pixelterm supports arbitrary-minimum-width balloons, you just draw a 50% transparent red, two pixel high bar as wide as the minimum width of the balloon. I just had a look at the balloon rendering in the new Minimum balloon height support would be easy to add (especially in the png format), but currently I do not see the merit of that.
Perhaps everything is a bit too much ;) The problem of .pony files vs. PNGs is imo that .pngs support the full color space while .pony files of course are limited to xTerm's 256-color subset. Since the .pony->png conversion is lossless you can of course work in either format, only I think PNG is somehow more user-friendly (almost everybody has a drawing program and I personally do not like manually messing around with color escape sequences except when I'm trying to make ponies blink). I agree that auto-auto-completion is nice, but it's really just 30 lines (less than this comment) anyway and there are not that many shells on this planet ;) |
The justification is how the balloon is justificed in the space it can be draw in, "Perhaps everything is a bit too much ;)", naturally, but why not, you can make really nice ponies. Actually, the TTY pony files supports full colour, except translucent colours, and you can make We could store new PNG files, but not just convert the .pony files to .png, to store the ponies |
By the way, you can find a full description of the .pony format, on page 34(29 on the paper) (§§12.1, 12.2). argb(100, 255, 0, 0) = $$ |
On 04/06/2013 10:21 PM, Mattias Andrée wrote:
Also, I am not a big fan of using stego on pngs as a user interface. I think it is a feature that these pngs are editable with any drawing program except for mspaint (that does not handle transparency).
|
Hopefully nopony will go through the trouble of installing mspaint to draw images with transparency for a non-Windows program (but it does run on cygwin, as virtually everything except valgrind does). Whoops, something happend in the middle of that sentence. I understand that you did not use my code, but the alpha=99 parts was to long to write and is not too important as it is inferior in all but really special cases. |
Hi,
I really like your idea (thanks for your awesome work!), but I think that 2458 lines of code is a tad on the enterprise side of things and I could not stand the slowness of everything. I rewrote the whole thing, re-implementing everything (or so I hope) except for the tty pony stuff and cleaned up the repo a bit for my personal use.
I changed the command line options towards a more standard usage and added a "--center" option horizontally centering the pony on the terminal.
The new script is 117 lines long and about 50-85% faster (now limited by the startup time of the python interpreter). Especially -q (random pony with quote) is now usable for me for login shells etc.
Missing stuff:
You may want to consider using my code, though you would have to fix these things (and probably some more which I forgot).