Skip to content

Commit

Permalink
Merge pull request #87 from internetarchive/small-fixes
Browse files Browse the repository at this point in the history
Fix some regex warnings + add venv to gitignore
  • Loading branch information
cdrini authored Nov 26, 2024
2 parents 6d61dda + d459aaa commit e65bfd1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,8 @@ cache/
.idea/

# Old folder from v2?
media/
media/

# Python venv
.venv/
venv/
4 changes: 2 additions & 2 deletions iiify/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class IsCollection(Exception):
pass

def purify_domain(domain):
domain = re.sub('^http:\/\/', "https://", domain)
domain = re.sub(r'^http:\/\/', "https://", domain)
return domain if domain.endswith('/iiif/') else domain + 'iiif/'


Expand Down Expand Up @@ -704,7 +704,7 @@ def create_manifest3(identifier, domain=None, page=None):

if f['format'] == 'Web Video Text Tracks':
# Example: cruz-test.en.vtt and 34C3_-_International_Image_Interoperability_Framework_IIIF_Kulturinstitutionen_schaffen_interop-SvH4fbjOT0A.autogenerated.vtt
sourceFilename = re.sub('\.[a-zA-H-]*\.vtt', '', f['name'])
sourceFilename = re.sub(r'\.[a-zA-H-]*\.vtt', '', f['name'])
if sourceFilename not in vttfiles:
vttfiles[sourceFilename] = []

Expand Down

0 comments on commit e65bfd1

Please sign in to comment.