-
Notifications
You must be signed in to change notification settings - Fork 140
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
Tidy up fonts and provide a font installation option #61
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good in general. Nice clear comments. Couple of things need to be addressed?
Well that's an interesting one @pwaller... I only test as far back as 2.7 and don't have python 2.6 installed anywhere. I guess I can nest the with statements or drop python 2.6 support. Let me know which works for you. |
The rationale I would take is "Let's not drop support for a version just for a want of a single extra statement and a bit of extra nesting". It would be frustrating to "almost have support", I think, given that the level of pain to have the support is minimal. |
If 2.6 was still supported, I'd totally agree. However, it went EOL years ago (https://www.python.org/download/releases/2.6.9/), so I thought this might be a good time to remove support. No worries - I'll push an update shortly. |
Thanks for working with me on this. I'm afraid it only has a tiny portion of my focus because it is a spare time project, so there may yet be a bit more slogging. I hope we can complete this within the next week or so. Please keep pinging me if I go silent, and you have my apologies in advance. I still need to test this. If anyone else wants to chime in that they're able to test it and it WorksForThem™, then that will help with completing this. On that front, it occurs to me that I can't find any instructions which tell someone (or me) how to use this new flag. Could you please update the PR body so that it is self standing and also contemplate adding details to the README? Ideally it should cover at least:
|
Thanks for that - do we want to include some links as to where you can find fonts? |
OK - I've updated the README. As for testing? I've run this code on:
Good to go? |
I guess you might have missed my above comment, between your commit and your comment? |
Yup - that just appeared in my notifications... Now done. |
I tried installing the jave fonts from http://www.jave.de/figlet/figletfonts40.zip, and doing
Do you have the same behaviour? $ pyfiglet -f wow a quick brown fox
Traceback (most recent call last):
File "/home/pwaller/.local/src/github.com/pwaller/pyfiglet/pyfiglet/__init__.py", line 230, in loadFont
raise FontError('%s is not a valid figlet font' % self.font)
pyfiglet.FontError: wow is not a valid figlet font
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pwaller/.local/bin/pyfiglet", line 11, in <module>
load_entry_point('pyfiglet', 'console_scripts', 'pyfiglet')()
File "/home/pwaller/.local/src/github.com/pwaller/pyfiglet/pyfiglet/__init__.py", line 922, in main
justify=opts.justify, width=opts.width,
File "/home/pwaller/.local/src/github.com/pwaller/pyfiglet/pyfiglet/__init__.py", line 787, in __init__
self.setFont()
File "/home/pwaller/.local/src/github.com/pwaller/pyfiglet/pyfiglet/__init__.py", line 794, in setFont
self.Font = FigletFont(font=self.font)
File "/home/pwaller/.local/src/github.com/pwaller/pyfiglet/pyfiglet/__init__.py", line 120, in __init__
self.loadFont()
File "/home/pwaller/.local/src/github.com/pwaller/pyfiglet/pyfiglet/__init__.py", line 313, in loadFont
raise FontError('problem parsing %s font: %s' % (self.font, e))
pyfiglet.FontError: problem parsing wow font: wow is not a valid figlet font |
Hmm... I didn't use that zip file for my testing. Looks like all the figlet fonts are actually also zip files and need decoding to plain text, despite their file extensions. |
Hmm. That is surprising! Maybe the solution to that is to have pyfiglet understand compressed fonts. I've filed that separately. |
Hopefully this is the PR to resolve #59