27 Commits

Author SHA1 Message Date
Khaled Hosny
232b2ccbc4 Move the rest of py23 module to textTools
Change all imports to use textTools module, except the test_py23.py test
which is kept until we decide to remove the module (if ever).
2021-08-20 01:29:45 +02:00
Just van Rossum
5fc65d7168
Misc py23 cleanups (#2243)
* Replaced all from ...py23 import * with explicit name imports, or removed completely when possible.
* Replaced tounicode() with tostr()
* Changed all BytesIO ans StringIO imports to from io import ..., replaced all UnicodeIO with StringIO.
* Replaced all unichr() with chr()
* Misc minor tweaks and fixes
2021-03-29 11:45:58 +02:00
Nikolaus Waxweiler
01328213c7 Remove __future__ imports 2019-08-09 12:20:13 +01:00
Cosimo Lupo
935aad1a25
DefaultTable: pass extra **kwargs in toXML (for glyf table class)
when ttx fails to decompile a buggy glyf table, the DefaultTable implementation is used,
but TTFont._tableToXML passes 'splitGlyphs' keyword argument to table.toXML when
the tag is 'glyf'.
Let's simply ignore it here.
2018-10-16 17:21:50 +01:00
Behdad Esfahbod
f82128f25d Kill progress argument
Fixes https://github.com/fonttools/fonttools/issues/1008

Doesn't touch xmlReader / xmlWriter modules.
2018-01-25 17:30:23 -08:00
Cosimo Lupo
d82a31dd57 return NotImplemented from __ne__ if __eq__ returns NotImplemented
otherwise `not NotImplemented` (always False) is returned from __ne__ when `type(self) != type(other)`, leading to illogic results like:

>>> from fontTools.ttLib.tables.DefaultTable import DefaultTable
>>> t = DefaultTable('test')
>>> t == 0
False
>>> t != 0
False

The latter of course should return True.
2016-03-11 15:10:50 +00:00
Behdad Esfahbod
b30e12ae00 More whitespace 2015-04-26 02:01:01 -04:00
Behdad Esfahbod
d0a31f5a43 Make tag parameter to table constructor optional
If not provided, extract from class name.
2014-03-28 14:04:01 -07:00
Behdad Esfahbod
1ae29591ef from __future__ import absolute_import
Such that our Python 2 is closer to Python 3.

Part of https://github.com/behdad/fonttools/issues/77
2014-01-14 15:07:50 +08:00
Behdad Esfahbod
273a90074a Return NotImplemented 2013-12-07 03:40:44 -05:00
Behdad Esfahbod
8ea6439d3b Implement __ne__ when __eq__ is defined 2013-12-06 22:25:48 -05:00
Behdad Esfahbod
81acddadbd Add optional progress to DefaultTable
Such that if dumping glyf/CFF failed and falling back to DefaultTable
implementation, toXML will match.
2013-12-01 04:05:40 -05:00
Behdad Esfahbod
e388db566b py23 Use new-style classes
Such that we get the same semantics in both Python 2 and 3.
2013-11-28 18:53:30 -05:00
Behdad Esfahbod
b7fd2e1913 py23 Remove uses of __cmp__ and cmp() 2013-11-28 17:32:42 -05:00
Behdad Esfahbod
960280bbd6 py23 Use more Tag() 2013-11-28 17:32:42 -05:00
Behdad Esfahbod
32c10eecff py23 from __future__ import division and adjust divisions 2013-11-28 17:32:42 -05:00
Behdad Esfahbod
30e691edd0 py23 from __future__ import print_function 2013-11-27 17:27:45 -05:00
Behdad Esfahbod
7ed91eca1e py23 import in all nontrivial source files and unused import cleanup 2013-11-27 15:25:00 -05:00
Behdad Esfahbod
14fb031125 Remove most uses of module string 2013-11-27 14:01:44 -05:00
Behdad Esfahbod
ac1b435946 2to3 --fix=idioms 2013-11-27 04:15:34 -05:00
Behdad Esfahbod
3a9fd30180 2to3 equivalent to --fix=tuple_params
I hope I got this all right...
2013-11-27 03:30:21 -05:00
Behdad Esfahbod
cd5aad92f2 2to3 --fix=raise 2013-11-27 02:42:28 -05:00
Behdad Esfahbod
180ace6a5f 2to3 --fix=ne 2013-11-27 02:40:30 -05:00
Behdad Esfahbod
0ba7aa7ab5 Make __cmp__() functions stable 2013-10-28 12:07:15 +01:00
Behdad Esfahbod
96b321c8ae Fix comparison to arbitrary objects 2013-08-19 14:17:11 -04:00
Just
f8fd4777d2 Added code to fall back to the DefaultTable (and therefore to hex XML dumps) when an exception occurs during decompilation.
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@44 4cde692c-a291-49d1-8350-778aa11640f8
2000-01-03 23:00:10 +00:00
Just
7842e56b97 Created a new library directory called "FreeLib". All OpenSource RFMKII components will reside there, fontTools being the flagship.
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@2 4cde692c-a291-49d1-8350-778aa11640f8
1999-12-16 21:34:53 +00:00