Commit 5f8ebb30 authored by SVN-Git Migration's avatar SVN-Git Migration

Imported Upstream version 0.6+dfsg

parent e37507b4
All of the documentation and the majority of the work done was by
Christopher Jones (cjones@insub.org).
Packaged by Peter Waller <peter.waller@gmail.com>,
various enhancements by Stefano Rivera <stefano@rivera.za.net>.
_|_| _| _| _|
_|_|_| _| _| _| _|_|_| _| _|_| _|_|_|_|
......
This diff is collapsed.
This diff is collapsed.
#!/usr/bin/env python
import os.path
import sys
from optparse import OptionParser
from pyfiglet import Figlet
from subprocess import Popen, STDOUT, PIPE
__version__ = '0.1'
def dump(text):
for line in text.split('\n'):
print repr(line)
def main():
parser = OptionParser(version=__version__)
parser.add_option('-s', '--show', action='store_true', default=False,
help='pause at each failure and compare output '
'(default: %default)')
opts, args = parser.parse_args()
f = Figlet()
ok = 0
fail = 0
failed = []
skip = ['runic'] # known bug..
for font in f.getFonts():
if font in skip: continue
f.setFont(font=font)
outputPyfiglet = f.renderText('foo')
fontpath = os.path.join('pyfiglet', 'fonts', font)
if os.path.isfile(fontpath + '.flf'):
cmd = ('figlet', '-d', 'pyfiglet/fonts', '-f', font, 'foo')
elif os.path.isfile(fontpath + '.tlf'):
cmd = ('toilet', '-d', 'pyfiglet/fonts', '-f', font, 'foo')
else:
raise Exception('Missing font file')
p = Popen(cmd, bufsize=1,stdout=PIPE)
outputFiglet = p.communicate()[0]
if outputPyfiglet == outputFiglet:
print '[OK] %s' % font
ok += 1
continue
print '[FAIL] %s' % font
fail += 1
failed.append(font)
if opts.show is True:
print '[PYTHON] *** %s\n\n' % font
dump(outputPyfiglet)
print '[FIGLET] *** %s\n\n' % font
dump(outputFiglet)
raw_input()
print 'OK = %d, FAIL = %d' % (ok, fail)
if len(failed) > 0:
print 'FAILED = %s' % repr(failed)
return 0
if __name__ == '__main__': sys.exit(main())
#!/usr/bin/env python
from setuptools import setup
setup(name='pyfiglet',
version='0.6',
description='Pure-python FIGlet implementation',
author='Peter Waller (Thanks to Christopher Jones and Stefano Rivera)',
author_email='peter.waller@gmail.com',
url='https://github.com/pwaller/pyfiglet',
packages=['pyfiglet', 'pyfiglet.fonts'],
package_data={'pyfiglet.fonts' : ['pyfiglet/fonts/*.flf']},
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment