Skip to content

Delay fc-list warning by 5s. #7596

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

Merged
merged 1 commit into from
Dec 12, 2016

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Dec 9, 2016

Alternative for #7532.

This implementation also avoids calling fc-list twice.

We do not need to check filename validity in _call_fc_list as
findSystemFonts already does it.

@tacaswell
Copy link
Member

title says 'min', code looks like it is 's'

"""
fontext = get_fontext_synonyms(fontext)
return [fname for fname in _call_fc_list()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes the return type?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a set represented as a {key: 1, key: 1, ...} dict to a list, yes. I can even document this as a API break :-)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 , please document this. The duck typing of the likely usage is the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@anntzer anntzer changed the title Delay fc-list warning by 5min. Delay fc-list warning by 5s. Dec 9, 2016
Copy link
Member

@tacaswell tacaswell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like _call_fc_list always returns an empty list

fname = six.text_type(fname, sys.getfilesystemencoding())
except UnicodeDecodeError:
continue
return fnames
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it will always come out empty.

@tacaswell tacaswell added this to the 2.1 (next point release) milestone Dec 9, 2016
@anntzer
Copy link
Contributor Author

anntzer commented Dec 9, 2016

fixed min->s

@anntzer anntzer force-pushed the delay-fc-list-warning branch 2 times, most recently from c637d88 to fec1a93 Compare December 9, 2016 22:54
@anntzer
Copy link
Contributor Author

anntzer commented Dec 11, 2016

Milestoning to 2.0.1 similarly to #5836 (the original issue) and #7532 (the first proposed fix).

@anntzer anntzer modified the milestones: 2.0.1 (next bug fix release), 2.1 (next point release) Dec 11, 2016
``afm.get_fontconfig_fonts`` returns a list of paths and does not check for existence
`````````````````````````````````````````````````````````````````````````````````````

``afm.get_fontconfig_fonts`` used to return a set of paths encoded as a `{key: 1, ...}` dict, and checked for the existence of the paths. It now returns a list and dropped the existence check, as the same check is performed by the caller (``afm.findSystemFonts``) as well.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure the backticks are the wrong way here, in that single ticks are references and double are code formatting (or at least the dict one needs to be doubled if the other references are not wanted.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

We do not need to check filename validity in `_call_fc_list` as
`findSystemFonts` already does it.
@anntzer anntzer force-pushed the delay-fc-list-warning branch from fec1a93 to 823fd95 Compare December 11, 2016 06:41
@QuLogic QuLogic merged commit 9d93f03 into matplotlib:master Dec 12, 2016
@anntzer anntzer deleted the delay-fc-list-warning branch December 12, 2016 00:41
QuLogic added a commit that referenced this pull request Dec 12, 2016
@QuLogic
Copy link
Member

QuLogic commented Dec 12, 2016

Backported to v2.x as 93d09be.

@QuLogic QuLogic modified the milestones: 2.0 (style change major release), 2.0.1 (next bug fix release) Dec 12, 2016
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