Commit 3ce8c8cf authored by Stefano Rivera's avatar Stefano Rivera

Imported Debian patch 0.7.1+dfsg-1

*.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')
......
pyfiglet (0.7.1+dfsg-1) unstable; urgency=medium
* New upstream release.
* Refresh patches.
* Bump copyright years.
* Replace source tarball repacking logic with uscan's Files-Excluded
support.
* Port to pybuild.
- Build-Depend on dh-python.
- Remove SOURCES.txt cleanup.
- Build for Python 3. The Python 3 package has taken over the pyfiglet
command line tool.
* Run upstream test suite. Build-Depends on toilet.
* Add upstream test suite as an ADT test.
* Bump Standards-Version to 3.9.5, no changes needed.
* Add DEP-12 upstream metadata.
-- Stefano Rivera <stefanor@debian.org> Sun, 27 Jul 2014 21:12:10 +0200
pyfiglet (0.6.1+dfsg-1) unstable; urgency=low
[ Stefano Rivera ]
......
......@@ -5,11 +5,16 @@ Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.
Uploaders: Stefano Rivera <stefanor@debian.org>
Build-Depends:
debhelper (>= 8.1),
python-all (>= 2.6.5-13~),
python-setuptools
X-Python-Version: >= 2.5
dh-python,
python-all (>= 2.6),
python-setuptools,
python3-all,
python3-setuptools,
toilet
X-Python-Version: >= 2.6
X-Python3-Version: >= 3.1
XS-Testsuite: autopkgtest
Standards-Version: 3.9.4
Standards-Version: 3.9.5
Homepage: https://github.com/pwaller/pyfiglet
Vcs-Svn: svn://anonscm.debian.org/python-modules/packages/pyfiglet/trunk/
Vcs-Browser: http://anonscm.debian.org/viewvc/python-modules/packages/pyfiglet/trunk/
......@@ -25,3 +30,17 @@ Description: Python port of the FIGlet specification
.
This is a Python port of the original C figlet. It can be used on the
commandline or as an Object Oriented driver library in your own programs.
Package: python3-pyfiglet
Architecture: all
Depends: ${misc:Depends}, ${python3:Depends}
Recommends: toilet-fonts
Suggests: figlet
Breaks: python-pyfiglet (<< 0.7.1)
Replaces: python-pyfiglet (<< 0.7.1)
Description: Python 3 port of the FIGlet specification
FIGLet is a program that creates large characters out of ordinary screen
characters. It takes ASCII text and renders it in ASCII art fonts.
.
This is a Python 3 port of the original C figlet. It can be used on the
commandline or as an Object Oriented driver library in your own programs.
......@@ -2,6 +2,9 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: pyfiglet
Upstream-Contact: Peter Waller <peter.waller@gmail.com>
Source: https://github.com/pwaller/pyfiglet
Files-Excluded:
pyfiglet/fonts
doc/figfont.txt
Comment:
The upstream for this package includes non-distributable items is the release
tarball:
......@@ -16,12 +19,12 @@ Comment:
Files: *
Copyright: 2007, Christopher Jones <cjones@gmail.com>,
2011-2013, Peter Waller <peter.waller@gmail.com>,
2011-2013, Stefano Rivera <stefanor@debian.org>
2011-2014, Peter Waller <peter.waller@gmail.com>,
2011-2014, Stefano Rivera <stefanor@debian.org>
License: GPL-2+
Files: debian/*
Copyright: 2010-2013, Stefano Rivera <stefanor@debian.org>
Copyright: 2010-2014, Stefano Rivera <stefanor@debian.org>
License: GPL-2+
License: GPL-2+
......
......@@ -6,12 +6,12 @@ Last-Update: 2011-05-29
--- a/pyfiglet/__init__.py
+++ b/pyfiglet/__init__.py
@@ -32,7 +32,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -34,7 +34,7 @@
"""
-DEFAULT_FONT='standard'
+DEFAULT_FONT='future'
-DEFAULT_FONT = 'standard'
+DEFAULT_FONT = 'future'
def figlet_format(text, font=DEFAULT_FONT, **kwargs):
......@@ -2,52 +2,73 @@ Description: Use Debian's figlet fonts.
Look in /usr/share/figlet rather than using pkg_resources to find fonts.
Author: Stefano Rivera <stefanor@debian.org>
Forwarded: not-needed
Last-Update: 2011-05-29
Last-Update: 2014-07-26
--- a/pyfiglet/__init__.py
+++ b/pyfiglet/__init__.py
@@ -5,7 +5,7 @@
"""
import os
from __future__ import print_function
-import pkg_resources
+import os.path
import re
import sys
from optparse import OptionParser
@@ -82,8 +82,8 @@
@@ -91,8 +91,8 @@
"""
for extension in ('tlf', 'flf'):
fn = '%s.%s' % (font, extension)
- if pkg_resources.resource_exists('pyfiglet.fonts', fn):
- self.data = pkg_resources.resource_string('pyfiglet.fonts', fn)
- data = pkg_resources.resource_string('pyfiglet.fonts', fn)
+ if os.path.isfile(os.path.join('/usr/share/figlet', fn)):
+ self.data = open(os.path.join('/usr/share/figlet', fn)).read()
break
+ data = open(os.path.join('/usr/share/figlet', fn), 'rb').read()
data = data.decode('UTF-8', 'replace')
return data
else:
raise FontNotFound(font)
@@ -93,10 +93,10 @@
@@ -102,14 +102,14 @@
def isValidFont(cls, font):
if not font.endswith(('.flf', '.tlf')):
return False
- f = pkg_resources.resource_stream('pyfiglet.fonts', font)
+ f = open(os.path.join('/usr/share/figlet', font), 'rb')
header = f.readline().decode('UTF-8', 'replace')
return cls.reMagicNumber.search(header)
@classmethod
def getFonts(self):
def getFonts(cls):
return [font.rsplit('.', 2)[0] for font
- in pkg_resources.resource_listdir('pyfiglet', 'fonts')
+ in os.listdir('/usr/share/figlet')
if font.endswith(('.flf', '.tlf'))
- and self.reMagicNumber.search(pkg_resources.resource_stream(
- 'pyfiglet.fonts', font).readline())]
+ and self.reMagicNumber.search(open(os.path.join(
+ '/usr/share/figlet', font)).readline())]
if cls.isValidFont(font)]
def loadFont(self):
"""
@classmethod
--- a/setup.py
+++ b/setup.py
@@ -8,7 +8,6 @@
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']},
+ packages=['pyfiglet'],
)
@@ -46,8 +46,7 @@
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']},
+ packages=['pyfiglet'],
entry_points={
'console_scripts': [
'pyfiglet = pyfiglet:main',
--- a/pyfiglet/test.py
+++ b/pyfiglet/test.py
@@ -39,11 +39,11 @@
outputPyfiglet = f.renderText('foo')
- fontpath = os.path.join('pyfiglet', 'fonts', font)
+ fontpath = os.path.join('/usr/share/figlet', font)
if os.path.isfile(fontpath + '.flf'):
- cmd = ('figlet', '-d', 'pyfiglet/fonts', '-f', font, 'foo')
+ cmd = ('figlet', '-d', '/usr/share/figlet', '-f', font, 'foo')
elif os.path.isfile(fontpath + '.tlf'):
- cmd = ('toilet', '-d', 'pyfiglet/fonts', '-f', font, 'foo')
+ cmd = ('toilet', '-d', '/usr/share/figlet', '-f', font, 'foo')
else:
raise Exception('Missing font file: '+fontpath)
Description: Don't install setuptools entry point scripts.
We have our own command line wrapper.
Author: Stefano Rivera <stefanor@debian.org>
Forwarded: not-needed
Last-Update: 2014-07-27
--- a/setup.py
+++ b/setup.py
@@ -47,9 +47,4 @@
author_email='peter.waller@gmail.com',
url='https://github.com/pwaller/pyfiglet',
packages=['pyfiglet'],
- entry_points={
- 'console_scripts': [
- 'pyfiglet = pyfiglet:main',
- ],
- }
)
debian-defaults.diff
font-location.diff
no-entry-points.diff
#!/usr/bin/python
#!/usr/bin/python3
from sys import stderr, exit
......
#!/usr/bin/make -f
export PYBUILD_NAME=pyfiglet
%:
dh $@ --with python2
dh $@ --with python2,python3 --buildsystem pybuild
override_dh_auto_install:
dh_auto_install
find debian/python-pyfiglet -name SOURCES.txt -delete
override_dh_auto_test:
PYBUILD_SYSTEM=custom \
PYBUILD_TEST_ARGS="{interpreter} -m pyfiglet.test" dh_auto_test
get-packaged-orig-source:
set -ex; \
VER=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^+]+).*,\1,p'); \
uscan --noconf --download-current-version --destdir=. --rename; \
mkdir pyfiglet-$$VER+dfsg.orig; \
tar -x --exclude=pyfiglet/fonts --exclude=doc/figfont.txt --exclude=.gitignore \
--strip-component=1 -C pyfiglet-$$VER+dfsg.orig -f pyfiglet_$$VER.orig.tar.gz; \
rm pyfiglet_$$VER.orig.tar.gz; \
GZIP=--best tar -cz --owner root --group root --mode a+rX \
-f "pyfiglet_$$VER+dfsg.orig.tar.gz" "pyfiglet-$$VER+dfsg.orig"; \
rm -rf "pyfiglet-$$VER+dfsg.orig"
uscan --noconf --download-current-version --destdir=. --rename --repack
Tests: smoketest
Depends: @, toilet-fonts
Depends: python-pyfiglet, toilet-fonts
Tests: smoketest3
Depends: python3-pyfiglet, toilet-fonts
Tests: suite
Depends: python-all, python-pyfiglet, toilet
Tests: suite3
Depends: python3-all, python3-pyfiglet, toilet
......@@ -3,6 +3,6 @@ set -efu
cd "$ADTTMP"
pyfiglet --help
pyfiglet hello there
pyfiglet -f letter haai
python -m pyfiglet --help
python -m pyfiglet hello there
python -m pyfiglet -f letter haai
#!/bin/sh
set -efu
cd "$ADTTMP"
pyfiglet --help
pyfiglet hello there
pyfiglet -f letter haai
#!/bin/sh
set -efu
cd "$ADTTMP"
for py in $(pyversions --supported); do
$py -m pyfiglet.test
done
#!/bin/sh
set -efu
cd "$ADTTMP"
for py in $(py3versions --supported); do
$py -m pyfiglet.test
done
Archive: PyPI
Bug-Database: https://github.com/pwaller/pyfiglet/issues
Bug-Submit: https://github.com/pwaller/pyfiglet/issues/new
Homepage: https://github.com/pwaller/pyfiglet/
Name: pyfiglet
Repository-Browse: https://github.com/pwaller/pyfiglet/
Repository: https://github.com/pwaller/pyfiglet/
version=3
opts=dversionmangle=s/\+dfsg// \
http://githubredir.debian.net/github/pwaller/pyfiglet/(.*).tar.gz \
debian
opts=uversionmangle=s/$/\+dfsg/ \
http://githubredir.debian.net/github/pwaller/pyfiglet/(.*).tar.gz
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