You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to grab oembed data and would prefer to do it ourselves using the providers in micawber.providers.bootstrap_basic.
There are some services that don't provide endpoints (thinking of Facebook and Vine, in particular) or aren't defined in bootstrap_basic. We want to compose a ProviderRegistry instance which tries providers from bootstrap_basic first, falling back to oembedio or Embedly if nothing is found.
Our current (proposed) solution:
frommicawberimportbootstrap_basic, bootstrap_embedio# embedio first so that basic providers overwrite embedio providers# a bit icky since it relies on internal registry implementationproviders=bootstrap_embedio()
forproviderinboostrap_basic():
providers.register(provider)
That seems a bit ... circuitous. So, here a couple of ways to provide composited ProverRegistrys that I can think of:
use our proposed solution above, and note it in the docs,
allow the various bootstrap_* funcs to take an optional registry argument that defaults to None, but is used if passed,
I implemented the second option you suggested. Because the registry is unordered (dict), it is ambiguous which provider might be used if multiple regex matches exist. In a subsequent commit I may change the dict to a list to ensure predictable ordering.
We need to grab oembed data and would prefer to do it ourselves using the providers in
micawber.providers.bootstrap_basic
.There are some services that don't provide endpoints (thinking of Facebook and Vine, in particular) or aren't defined in
bootstrap_basic
. We want to compose aProviderRegistry
instance which tries providers frombootstrap_basic
first, falling back to oembedio or Embedly if nothing is found.Our current (proposed) solution:
That seems a bit ... circuitous. So, here a couple of ways to provide composited
ProverRegistry
s that I can think of:bootstrap_*
funcs to take an optionalregistry
argument that defaults toNone
, but is used if passed,bootstrap_basic
so that they're available to use by library users.Thoughts?
The text was updated successfully, but these errors were encountered: