309 Commits

Author SHA1 Message Date
Cosimo Lupo
2bef40c30d [ufoLib] use self.fileSystem.joinPath instead of reader.joinPath 2017-07-21 14:11:13 +01:00
Cosimo Lupo
e3d89cee7f [ufoLib] fix listing images dir; pass a file object to pngValidator 2017-07-21 14:08:41 +01:00
Cosimo Lupo
c06c38cadb [ufoLib] UFOReader.getFileModificationTime is used by defcon 2017-07-21 14:05:59 +01:00
Cosimo Lupo
22a6f917e4 [filesystem] implement 'create' argument for _NOFS.movedir
in pyfilesystem2, movedir copies the content from one directory to
antoher, optionally creating the destination if create=True.

When the destination is exists and is a directory, shutil.move moves
the source directory inside the destinatinn directory.

shutil.copytree also fails if the destination already exists; so here
we resort to distutils.dir_util.copy_tree (it's part of python std lib)
2017-07-21 14:04:10 +01:00
Cosimo Lupo
3c0d41bac9 [filesystem] use the current ZipFS API; create "contents" dir
The 'mode' and 'allow_zip_64' arguments are no longer there in
pyfileststem2's zipfs module; allow_zip_64 is the default now,
and the 'mode' is replaced by a 'write' boolean argument

The "contents" root dir must be created manually.
2017-07-21 13:53:49 +01:00
Cosimo Lupo
46f32d4cd4 [filesystem] print exception in readPlist 2017-07-21 13:43:33 +01:00
Cosimo Lupo
337a68715e [filesystem] getinfo now returns a namespace, not a dict
We bumped the minimum required fonttools to 3.10, so
we can use the backported SimpleNamespace as the return
value of _NOFS.getinfo method.
2017-07-21 13:41:14 +01:00
Cosimo Lupo
1de6eb1eb5 [filesystem] pass create=True to movedir
otherwise it raises `ResourceNotFound`
2017-07-21 13:33:15 +01:00
Cosimo Lupo
590d00ba11 [filesystem] use unicode strings for path names
as pyfilesystem2 works internally with unicode strings, some methods
(e.g. self._fs.exists()) fail with TypeError if passed bytes strings
(on python 2 bytes == str).

We decode bytes path strings using the system's default filesystem
encoding.
2017-07-21 13:29:33 +01:00
Cosimo Lupo
62cc1c5805 [filesystem] allow to init FileSystem class from another instance 2017-07-21 13:23:04 +01:00
Cosimo Lupo
07ba88f55a [filesystem] fs.zipfs module no longer exports ZipOperError
it's unused anyway
2017-07-21 13:13:15 +01:00
Cosimo Lupo
758307d8bb [filesystem] use os.path if not haveFS 2017-07-21 12:59:56 +01:00
Cosimo Lupo
af8b0e3224 [filesystem] use removetree as removedir was removed from pyfilesystem2
https://github.com/PyFilesystem/pyfilesystem2/issues/32
2017-07-21 10:14:58 +01:00
Cosimo Lupo
50f381dec6 test_UFOConversion: remove test1To2 as support for UFO1 is deprecated 2017-07-21 10:14:16 +01:00
Cosimo Lupo
055e52f932 Merge branch 'master' into ufo4 2017-07-21 10:07:37 +01:00
Cosimo Lupo
ab9985ee3a
Bump version: 2.1.0 → 2.1.1.dev0 2017-05-24 18:39:50 +01:00
Cosimo Lupo
1c5f70c873
Release 2.1.0 2017-05-24 18:38:10 +01:00
Cosimo Lupo
16abd8130c
Add bump_version and release commands to setup.py 2017-05-24 18:37:52 +01:00
Cosimo Lupo
e883885c3a
[pointPen] add ReverseContourPointPen from defcon
https://github.com/typesupply/defcon/issues/106
2017-04-25 10:50:21 +01:00
Cosimo Lupo
d952f9a74f
[pointPen] make PointToSegmentPen.addComponent accept/ignore **kwargs
The beginPath and addPoint methods of PointToSegmentPen already take
extra **kwargs (via BasePointToSegmentPen); only the addComponent method
does not.
This makes it raise TypeError when an unknown keyword argument is passed
(e.g. 'identifier' for UFO3 objects).
For the PointToSegmentPen, which translates between the PointPen and
the SegmentPen API, it is ok if we only use the arguments that have
an equivalent in the SegmentPen API, and silently discard the **kwargs.
2017-04-25 10:23:38 +01:00
Denis Moyogo Jacquerye
6ca25ce193 Merge pull request #64 from benkiel/master
Remove duplicate variable assignment
2017-03-06 13:39:29 +00:00
Ben Kiel
0bc4ab9497 Remove duplicate variable assignment 2017-02-27 10:18:02 -06:00
Cosimo Lupo
869a8f6a45
[pointPen] add **kwargs to AbstractPointPen's beginPath and addCompoment too 2017-02-27 16:04:47 +00:00
Cosimo Lupo
6739bc8b9d
[pointPen] add identifier=None argument in AbstractPointPen.beginPath, addPoint and addComponent methods 2017-02-27 12:46:06 +00:00
Cosimo Lupo
3b9ced71e0 move all test data inside the inlined ufoLib/test modules, and install them
Since the test suite is inlined, it makes sense to also have the test data installed alongside the test modules.
So all the content of the two top-level folders Data and TestData is now placed inside Lib/ufoLib/test/testadata.
The MANIFEST.in has been adjusted accordingly.
The `install_package_data` in setup.py ensures the package data specified in the manifest is installed with the package.

This way anyone who installs ufoLib (even the wheel from PyPI) can run the test suite with `pytest --pyargs ufoLib`.
2016-10-17 19:41:13 +01:00
Denis Moyogo Jacquerye
e6a1a658f0 glifLib: try importing from fontTools.misc.xmlWriter first
fixes #41
2016-10-13 21:42:51 +01:00
Cosimo Lupo
f320554077 ufoLib.__init__: use os.path instead of slash to fix doctest failing on Windows 2016-09-11 17:44:12 +01:00
Cosimo Lupo
8747da76a4 filenames.py: fix doctests for py2.py3; import unicode_literals 2016-09-11 17:00:13 +01:00
Cosimo Lupo
ee38446982 glifLib.py: use +IGNORE_EXCEPTION_DETAIL to make doctest work on both Python2 and 3
http://python3porting.com/problems.html#handling-expected-exceptions
2016-09-11 17:00:13 +01:00
Cosimo Lupo
5fb9a13957 converters.py: fix up kerningValidator doctest 2016-09-11 17:00:13 +01:00
Denis Moyogo Jacquerye
4f83f4bbe1 tests: copy doctest as unittest in test_filenames 2016-07-11 13:49:59 +01:00
Denis Moyogo Jacquerye
bb21cb7c3a userNameToFileName expects userName to be unicode strings, let it raise
if not
2016-07-11 13:49:59 +01:00
Adrien Tétar
ec0fe57545 filenames: only allow unicode in py2
i.e. restore the old behavior
2016-07-08 21:19:16 -07:00
Cosimo Lupo
f92dcf36c1 don't write layerinfo.plist if 'lib' element is empty 2016-06-28 13:52:23 +01:00
Cosimo Lupo
f6689faf5b glifLib: don't raise AttributeError if element.text attribute is None
When an element tree is built from code, or it is parsed from a string that was not pretty-printed (i.e. without indentation), the 'text' attribute of an Element instance can be None. So we must ensure it's not None before calling `strip()` method.
2016-06-25 19:04:24 +01:00
Tal Leming
321ea7f766 Merge pull request #33 from anthrotype/isinstance-mapping
validators: check isinstance of collections.Mapping rather than dict
2016-06-24 09:47:59 -04:00
Tal Leming
89d8cfa7eb Removing metainfo.plist is no longer expressly prohibited (it shouldn't be done though). Raise an error when removing a missing file. 2016-06-13 13:36:30 -04:00
Tal Leming
ea54c77670 Don't try to remove the root directory. 2016-06-13 13:33:31 -04:00
Tal Leming
be90029b22 Arguments were transposed. 2016-06-13 13:22:36 -04:00
Tal Leming
c864359fb2 Define writer. 2016-06-13 13:19:40 -04:00
Tal Leming
0e569793a7 The populated info objects should be written, not an empty object. 2016-06-13 13:17:36 -04:00
Tal Leming
bfba532621 Force the removal of non-empty directories during directory removal. 2016-06-13 13:13:56 -04:00
Tal Leming
15c4ff20a3 UFOLibError is now raised instead of GlifLibError. 2016-06-13 13:10:55 -04:00
Tal Leming
a0a942bc7d Make copying a directory from a source to a dest work. 2016-06-08 14:26:01 -04:00
Tal Leming
4162429c53 Flipped args. 2016-06-08 13:39:14 -04:00
Tal Leming
6043db4f11 Switch to rb mode. 2016-06-08 12:06:35 -04:00
Tal Leming
cea3ba9b43 Fix some minor issues to resolve some failing tests. 2016-06-08 11:09:37 -04:00
Tal Leming
21f36611f0 Found something hardwired to the package structure. 2016-06-08 10:31:39 -04:00
Tal Leming
76480ec37f fs.path not self._fs.path. 2016-06-08 10:31:21 -04:00
Tal Leming
82958e2711 Name the argument. 2016-06-08 10:31:07 -04:00