Make the utility classes function available in calibre

This commit is contained in:
Kovid Goyal 2020-04-27 13:27:23 +05:30
parent 9d47c150cb
commit da5359a617
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -33,6 +33,12 @@ from polyglot.builtins import unicode_type, string_or_bytes, getcwd
from polyglot.urllib import urlparse, urlsplit
def classes(classes):
q = frozenset(classes.split(' '))
return dict(attrs={
'class': lambda x: x and frozenset(x.split()).intersection(q)})
class LoginFailed(ValueError):
pass