Falcon v1.0.0 Documentationraise falcon.HTTPNotFound() Or you could handle a bogus filename like this: VALID_IMAGE_NAME = re.compile(r'[a-f0-9]{10}\.(jpeg|gif|png)$') # ... class Item(object): def __init__(self, storage_path): CompiledRouterNode(object): """Represents a single URI segment in a URI.""" _regex_vars = re.compile('{([-_a-zA-Z0-9]+)}') def __init__(self, raw_segment, method_map=None, resource=None): append(seg[prev_end_idx:]) seg_pattern = ''.join(seg_fields) self.var_regex = re.compile(seg_pattern) else: self.is_var = False def matches(self, segment):0 码力 | 249 页 | 406.22 KB | 1 年前3
Falcon v3.0.1 Documentation_image_store.open(name) class ImageStore: _CHUNK_SIZE_BYTES = 4096 _IMAGE_NAME_PATTERN = re.compile( '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\. [a-z]{2,4}$' ) if not hasattr(prefix, 'match'): # Assume it is a string prefix = re.compile(prefix) # NOTE(kgriffs): Insert at the head of the list such that # in the case as _QUOTED_PAIR but contains a capture group _QUOTED_PAIR_REPLACE_RE = re.compile(r'\\([\t !-~])') _FORWARDED_PAIR_RE = re.compile(_FORWARDED_PAIR) [docs]class Forwarded: """Represents a parsed Forwarded0 码力 | 1058 页 | 741.59 KB | 1 年前3
Falcon v1.0.0 Documentationraise falcon.HTTPNotFound() Or you could handle a bogus filename like this: VALID_IMAGE_NAME = re.compile(r'[a-f0-9]{10}\.(jpeg|gif|png)$') # ... class Item(object): def __init__(self, storage_path): if not hasattr(prefix, 'match'): # Assume it is a string prefix = re.compile(prefix) # NOTE(kgriffs): Insert at the head of the list such that # in the case CompiledRouterNode(object): """Represents a single URI segment in a URI.""" _regex_vars = re.compile('{([-_a-zA-Z0-9]+)}') def __init__(self, raw_segment, method_map=None, resource=None0 码力 | 312 页 | 368.58 KB | 1 年前3
Falcon v3.0.0-b1 Documentation_image_store.open(name) class ImageStore: _CHUNK_SIZE_BYTES = 4096 _IMAGE_NAME_PATTERN = re.compile( '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\. [a-z]{2,4}$' ) if not hasattr(prefix, 'match'): # Assume it is a string prefix = re.compile(prefix) # NOTE(kgriffs): Insert at the head of the list such that # in the case as _QUOTED_PAIR but contains a capture group _QUOTED_PAIR_REPLACE_RE = re.compile(r'\\([\t !-~])') _FORWARDED_PAIR_RE = re.compile(_FORWARDED_PAIR) [docs]class Forwarded: """Represents a parsed Forwarded0 码力 | 1028 页 | 725.86 KB | 1 年前3
Falcon v3.0.0 Documentation_image_store.open(name) class ImageStore: _CHUNK_SIZE_BYTES = 4096 _IMAGE_NAME_PATTERN = re.compile( '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\. [a-z]{2,4}$' ) if not hasattr(prefix, 'match'): # Assume it is a string prefix = re.compile(prefix) # NOTE(kgriffs): Insert at the head of the list such that # in the case as _QUOTED_PAIR but contains a capture group _QUOTED_PAIR_REPLACE_RE = re.compile(r'\\([\t !-~])') _FORWARDED_PAIR_RE = re.compile(_FORWARDED_PAIR) [docs]class Forwarded: """Represents a parsed Forwarded0 码力 | 1055 页 | 739.30 KB | 1 年前3
Falcon v3.0.0-b2 Documentation_image_store.open(name) class ImageStore: _CHUNK_SIZE_BYTES = 4096 _IMAGE_NAME_PATTERN = re.compile( '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\. [a-z]{2,4}$' ) if not hasattr(prefix, 'match'): # Assume it is a string prefix = re.compile(prefix) # NOTE(kgriffs): Insert at the head of the list such that # in the case as _QUOTED_PAIR but contains a capture group _QUOTED_PAIR_REPLACE_RE = re.compile(r'\\([\t !-~])') _FORWARDED_PAIR_RE = re.compile(_FORWARDED_PAIR) [docs]class Forwarded: """Represents a parsed Forwarded0 码力 | 1041 页 | 730.21 KB | 1 年前3
Falcon v0.2.0 Documentationraise falcon.HTTPNotFound() Or you could handle a bogus filename like this: VALID_IMAGE_NAME = re.compile(r'[a-f0-9]{10}\.(jpeg|gif|png)$') # ... class Item(object): def __init__(self, storage_path): if not hasattr(prefix, 'match'): # Assume it is a string prefix = re.compile(prefix) # NOTE(kgriffs): Insert at the head of the list such that # in the case sub(expression_pattern, r'(?P<\1>[^/]+)', escaped) pattern = r'\A' + pattern + r'\Z' return fields, re.compile(pattern, re.IGNORECASE) # NOTE(kgriffs): Published method; take care to avoid breaking changes0 码力 | 188 页 | 358.44 KB | 1 年前3
Falcon v0.2.0 Documentationraise falcon.HTTPNotFound() Or you could handle a bogus filename like this: VALID_IMAGE_NAME = re.compile(r'[a-f0-9]{10}\.(jpeg|gif|png)$') # ... class Item(object): def __init__(self, storage_path):0 码力 | 70 页 | 296.15 KB | 1 年前3
Falcon v0.3.0.1 Documentationraise falcon.HTTPNotFound() Or you could handle a bogus filename like this: VALID_IMAGE_NAME = re.compile(r'[a-f0-9]{10}\.(jpeg|gif|png)$') # ... class Item(object): def __init__(self, storage_path):0 码力 | 77 页 | 311.34 KB | 1 年前3
Falcon v1.0.0 Documentationraise falcon.HTTPNotFound() Or you could handle a bogus filename like this: VALID_IMAGE_NAME = re.compile(r'[a-f0-9]{10}\.(jpeg|gif|png)$') # ... class Item(object): def __init__(self, storage_path):0 码力 | 87 页 | 348.15 KB | 1 年前3
共 40 条
- 1
- 2
- 3
- 4













