Skip to content

Commit

Permalink
config: use raw strings for regular expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
max-moser committed Sep 23, 2024
1 parent 6120947 commit 28fef34
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions flask_iiif/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,32 +107,35 @@
"v1": {
"region": {
"ignore": "full",
"validate": "(^full|(pct:)?([\d.]+,){3}([\d.]+))",
"validate": r"(^full|(pct:)?([\d.]+,){3}([\d.]+))",
},
"size": {
"ignore": "full",
"validate": (
"(^full|[\d.]+,|,[\d.]+|pct:[\d.]+|[\d.]+," "[\d.]+|![\d.]+,[\d.]+)"
r"(^full|[\d.]+,|,[\d.]+|pct:[\d.]+|[\d.]+,[\d.]+|![\d.]+,[\d.]+)"
),
},
"rotation": {"ignore": "0", "validate": "^[\d.]+$"},
"quality": {"ignore": "default", "validate": "(native|color|gr[ae]y|bitonal)"},
"image_format": {"ignore": "", "validate": "(gif|jp2|jpe?g|pdf|png|tiff?)"},
"rotation": {"ignore": "0", "validate": r"^[\d.]+$"},
"quality": {"ignore": "default", "validate": r"(native|color|gr[ae]y|bitonal)"},
"image_format": {"ignore": "", "validate": r"(gif|jp2|jpe?g|pdf|png|tiff?)"},
},
"v2": {
"region": {
"ignore": "full",
"validate": "(^full|(pct:)?([\d.]+,){3}([\d.]+))",
"validate": r"(^full|(pct:)?([\d.]+,){3}([\d.]+))",
},
"size": {
"ignore": "full",
"validate": (
"(^full|[\d.]+,|,[\d.]+|pct:[\d.]+|[\d.]+," "[\d.]+|![\d.]+,[\d.]+)"
r"(^full|[\d.]+,|,[\d.]+|pct:[\d.]+|[\d.]+,[\d.]+|![\d.]+,[\d.]+)"
),
},
"rotation": {"ignore": "0", "validate": "^!?[\d.]+$"},
"quality": {"ignore": "default", "validate": "(default|color|gr[ae]y|bitonal)"},
"image_format": {"ignore": "", "validate": "(gif|jp2|jpe?g|pdf|png|tiff?)"},
"rotation": {"ignore": "0", "validate": r"^!?[\d.]+$"},
"quality": {
"ignore": "default",
"validate": r"(default|color|gr[ae]y|bitonal)",
},
"image_format": {"ignore": "", "validate": r"(gif|jp2|jpe?g|pdf|png|tiff?)"},
},
}

Expand Down

0 comments on commit 28fef34

Please sign in to comment.