Home | History | Annotate | Download | only in python2.7

Lines Matching defs:strict

5 guess_type(url, strict=1) -- guess the MIME type and encoding of a URL.
7 guess_extension(type, strict=1) -- guess the extension for a given MIME type.
64 def __init__(self, filenames=(), strict=True):
69 self.types_map = ({}, {}) # dict for (non-strict, strict)
76 self.read(name, strict)
78 def add_type(self, type, ext, strict=True):
86 If strict is true, information will be added to
90 self.types_map[strict][ext] = type
91 exts = self.types_map_inv[strict].setdefault(type, [])
95 def guess_type(self, url, strict=True):
111 Optional `strict' argument when False adds a bunch of commonly found,
147 elif strict:
157 def guess_all_extensions(self, type, strict=True):
165 Optional `strict' argument when false adds a bunch of commonly found,
170 if not strict:
176 def guess_extension(self, type, strict=True):
186 Optional `strict' argument when false adds a bunch of commonly found,
189 extensions = self.guess_all_extensions(type, strict)
194 def read(self, filename, strict=True):
198 If strict is true, information will be added to
203 self.readfp(fp, strict)
205 def readfp(self, fp, strict=True):
209 If strict is true, information will be added to
226 self.add_type(type, '.' + suff, strict)
228 def read_windows_registry(self, strict=True):
232 If strict is true, information will be added to
272 self.add_type(ctype, suffix, strict)
275 def guess_type(url, strict=True):
290 Optional `strict' argument when false adds a bunch of commonly found, but
295 return _db.guess_type(url, strict)
298 def guess_all_extensions(type, strict=True):
308 Optional `strict' argument when false adds a bunch of commonly found,
313 return _db.guess_all_extensions(type, strict)
315 def guess_extension(type, strict=True):
324 Optional `strict' argument when false adds a bunch of commonly found,
329 return _db.guess_extension(type, strict)
331 def add_type(type, ext, strict=True):
339 If strict is true, information will be added to
345 return _db.add_type(type, ext, strict)
533 # only match if strict=0 flag is given to the API methods.
577 strict = 1
583 strict = 0
588 guess = guess_extension(gtype, strict)
592 guess, encoding = guess_type(gtype, strict)