Commit 6de42923 authored by SVN-Git Migration's avatar SVN-Git Migration

Imported Upstream version 0.7.1+dfsg

parent f7233e6f
*.pyc
*~
.*.swp
/build/
/dist/
/pyfiglet.egg-info/
language: python
python:
- "2.6"
- "2.7"
- "3.2"
- "3.3"
- "3.4"
- "pypy"
before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq toilet figlet
script: PYTHONPATH=. python pyfiglet/test.py
include pyfiglet/fonts/*.flf
recursive-include doc *
......@@ -2,14 +2,14 @@ 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>.
_|_| _| _| _|
_|_|_| _| _| _| _|_|_| _| _|_| _|_|_|_|
_| _| _| _| _|_|_|_| _| _| _| _| _|_|_|_| _|
_| _| _| _| _| _| _| _| _| _| _|
_|_|_| _|_|_| _| _| _|_|_| _| _|_|_| _|_|
_| _| _|
_| _|_| _|_|
_|_| _| _| _|
_|_|_| _| _| _| _|_|_| _| _|_| _|_|_|_|
_| _| _| _| _|_|_|_| _| _| _| _| _|_|_|_| _|
_| _| _| _| _| _| _| _| _| _| _|
_|_|_| _|_|_| _| _| _|_|_| _| _|_|_| _|_|
_| _| _|
_| _|_| _|_|
SYNOPSIS
......@@ -51,12 +51,12 @@ USAGE
Run with --help to see a full list of tweaks. Mostly you will only
use -f to change the font. It defaults to standard.flf.
./pyfiglet 'text to render'
tools/pyfiglet 'text to render'
Pyfiglet is also a library that can be used in python code:
from pyfiglet import Figlet
f = Figlet(font='slant', dir='/usr/local/share/figlet') # or zipfile=PATH
f = Figlet(font='slant')
print f.renderText('text to render')
......
This diff is collapsed.
import sys
from pyfiglet import main
if __name__ == '__main__':
sys.exit(main())
#!/usr/bin/env python
from __future__ import print_function
import os.path
import sys
from optparse import OptionParser
from pyfiglet import Figlet
from subprocess import Popen, STDOUT, PIPE
from subprocess import Popen, PIPE
__version__ = '0.1'
def dump(text):
for line in text.split('\n'):
print repr(line)
print(repr(line))
def main():
parser = OptionParser(version=__version__)
......@@ -26,10 +29,11 @@ def main():
ok = 0
fail = 0
failed = []
skip = ['runic'] # known bug..
skip = ['runic'] # known bug..
for font in f.getFonts():
if font in skip: continue
if font in skip:
continue
f.setFont(font=font)
......@@ -41,31 +45,39 @@ def main():
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]
raise Exception('Missing font file: '+fontpath)
p = Popen(cmd, bufsize=1, stdout=PIPE)
outputFiglet = p.communicate()[0].decode('UTF-8')
# Our TLF rendering isn't perfect, yet
strict = os.path.isfile(fontpath + '.flf')
if not strict:
outputPyfiglet = outputPyfiglet.strip('\n')
outputFiglet = outputFiglet.strip('\n')
if outputPyfiglet == outputFiglet:
print '[OK] %s' % font
print('[OK] %s' % font)
ok += 1
continue
print '[FAIL] %s' % font
print('[FAIL] %s' % font)
fail += 1
failed.append(font)
if opts.show is True:
print '[PYTHON] *** %s\n\n' % font
print('[PYTHON] *** %s\n\n' % font)
dump(outputPyfiglet)
print '[FIGLET] *** %s\n\n' % font
print('[FIGLET] *** %s\n\n' % font)
dump(outputFiglet)
raw_input()
print 'OK = %d, FAIL = %d' % (ok, fail)
print('OK = %d, FAIL = %d' % (ok, fail))
if len(failed) > 0:
print 'FAILED = %s' % repr(failed)
print('FAILED = %s' % repr(failed))
return 0
if __name__ == '__main__': sys.exit(main())
if __name__ == '__main__':
sys.exit(main())
__version__ = '0.7.1'
#!/usr/bin/env python
from setuptools import setup
import sys
setup(name='pyfiglet',
version='0.6.1',
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' : ['*.flf']},
)
def get_version():
sys.path.insert(0, 'pyfiglet')
from version import __version__
sys.path.pop(0)
return __version__
setup(
name='pyfiglet',
version=get_version(),
description='Pure-python FIGlet implementation',
license='GPLv2+',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU General Public License v2 or later '
'(GPLv2+)',
'Natural Language :: English',
# For Katakana
'Natural Language :: Japanese',
# For Cyrillic
'Natural Language :: Bulgarian',
'Natural Language :: Bosnian',
'Natural Language :: Macedonian',
'Natural Language :: Russian',
'Natural Language :: Serbian',
'Natural Language :: Ukranian',
'Operating System :: Unix',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Topic :: Text Processing',
'Topic :: Text Processing :: Fonts',
],
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': ['*.flf']},
entry_points={
'console_scripts': [
'pyfiglet = pyfiglet:main',
],
}
)
#!/bin/sh
cd "$(dirname "$0")"/..
export PYTHONPATH=$(pwd)
exec python -m pyfiglet "$@"
#!/bin/sh
PYFIGLET='./pyfiglet'
OUTPUT='/tmp/pyfiglet_example.log'
TEXT='pyfiglet'
LOG=0
cd "$(dirname "$0")"
if [ ! -f "$PYFIGLET" ]; then
echo "Error ! can't find $PYFIGLET!"
fi
print_samples() {
if [ "$LOG" -eq 1 ]; then
output="$OUTPUT"
rm "$output" 2>/dev/null
else
output='/dev/null'
fi
#. strip \' \, \[ \] from font lists of pyfiglet.
fonts="$("$PYFIGLET" -l | sed -e "s/[',]//g" -e 's/^\[//g' -e 's/\]$//g')"
for font in $fonts; do
echo "$font" | tee -a "$output"
"$PYFIGLET" "$TEXT" -f "$font" | tee -a "$output"
done
}
useage() {
echo "Useage: $0 [options] [text ...]\n"
echo "Options:"
echo "-l\t\t\tcreate log file."
echo "-o [path_to_file]\tspecify the path of log file,\n\t\t\tdefault is $OUTPUT."
echo "-h\t\t\tshow help messages."
exit 0
}
#. parse apts & args
while getopts ":lo:h" opt; do
case "$opt" in
l)
LOG=1
;;
o)
if [ -n $OPTARG ]; then
OUTPUT="$OPTARG"
fi
;;
h|\?)
useage
;;
esac
done
shift `expr $OPTIND - 1`
if [ ! -z "$1" ]; then
TEXT="$@"
fi
#. main
print_samples
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