Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support defcon-like Font(path) default constructor #47

Merged
merged 11 commits into from
Dec 16, 2019

Conversation

anthrotype
Copy link
Member

Part of #41 to ease up projects wishing to support both defcon and ufoLib2

@codecov-io
Copy link

codecov-io commented Dec 13, 2019

Codecov Report

Merging #47 into master will increase coverage by 2.13%.
The diff coverage is 89.61%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #47      +/-   ##
==========================================
+ Coverage   69.69%   71.82%   +2.13%     
==========================================
  Files          19       19              
  Lines        1023     1072      +49     
  Branches      145      159      +14     
==========================================
+ Hits          713      770      +57     
+ Misses        265      258       -7     
+ Partials       45       44       -1
Impacted Files Coverage Δ
src/ufoLib2/objects/layer.py 59.13% <100%> (+5.07%) ⬆️
src/ufoLib2/objects/layerSet.py 55.03% <100%> (+2.61%) ⬆️
src/ufoLib2/objects/info.py 96.61% <100%> (+0.07%) ⬆️
src/ufoLib2/objects/font.py 66% <86.27%> (+3.79%) ⬆️
src/ufoLib2/objects/misc.py 79.51% <90%> (+9.24%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9bb31e1...fc6393d. Read the comment docs.

tests/test_ufoLib2.py Outdated Show resolved Hide resolved
otherwise one may inadvertently lose reference to the reader object and leave it open
as result of comparing for equality or deepcopying (which automatically
call unlazify).

For all the lazy objects (Font, LayerSet, Layer, Data and Images) I
implement a custom __deepcopy__ method that ignores init=False
attributes while copying (such as the reader).
'path' must be init=True, but we don't want to pass it to the default constructor
when we deepcopy otherwise we end up reading from disk again while deepcopying...
@anthrotype anthrotype merged commit 6cbb279 into master Dec 16, 2019
@anthrotype anthrotype deleted the defcon-path-constructor branch February 19, 2020 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants