File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -235,6 +235,25 @@ def __iter__(self):
235235 return iter ((self .name , self ))
236236
237237 def matches (self , ** params ):
238+ """
239+ EntryPoint matches the given parameters.
240+
241+ >>> ep = EntryPoint(group='foo', name='bar', value='bing:bong [extra1, extra2]')
242+ >>> ep.matches(group='foo')
243+ True
244+ >>> ep.matches(name='bar', value='bing:bong [extra1, extra2]')
245+ True
246+ >>> ep.matches(group='foo', name='other')
247+ False
248+ >>> ep.matches()
249+ True
250+ >>> ep.matches(extras=['extra1', 'extra2'])
251+ True
252+ >>> ep.matches(module='bing')
253+ True
254+ >>> ep.matches(attr='bong')
255+ True
256+ """
238257 attrs = (getattr (self , param ) for param in params )
239258 return all (map (operator .eq , params .values (), attrs ))
240259
You can’t perform that action at this time.
0 commit comments