mirror of https://github.com/tLDP/python-tldp
allow case-insensitive matching for document types
The Python names for the document types are upper-cased and probably not predictably named for the end user; allow a case-insensitive match when trying to turn off building or listing for a particular document type.
This commit is contained in:
parent
aff926bb58
commit
b54962900d
|
@ -115,11 +115,15 @@ def getStatusNames(args):
|
|||
|
||||
|
||||
def getDocumentClasses(args):
|
||||
sought = set()
|
||||
largs = [x.lower() for x in args]
|
||||
sought = list()
|
||||
for cls in tldp.typeguesser.knowndoctypes:
|
||||
if cls.__name__.lower() in args:
|
||||
sought.add(cls)
|
||||
remainder = set(args).difference(sought)
|
||||
if cls.__name__.lower() in largs:
|
||||
sought.append(cls)
|
||||
else:
|
||||
sought.append(None)
|
||||
remainder = set([y for x, y in zip(sought, args) if x])
|
||||
sought = set(sought)
|
||||
return sought, remainder
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue