X Tutup
Skip to content

Delay fc-list warning by 5s.#7596

Merged
QuLogic merged 1 commit intomatplotlib:masterfrom
anntzer:delay-fc-list-warning
Dec 12, 2016
Merged

Delay fc-list warning by 5s.#7596
QuLogic merged 1 commit intomatplotlib:masterfrom
anntzer:delay-fc-list-warning

Conversation

@anntzer
Copy link
Copy Markdown
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
Copy Markdown
Member

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

"""List the font filenames known to `fc-list` having the given extension.
"""
fontext = get_fontext_synonyms(fontext)
return [fname for fname in _call_fc_list()
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

X Tutup