Skip to content

Commit

Permalink
pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
stevejpurves committed Jun 3, 2024
1 parent b67b6b5 commit a806b14
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion repo2docker/contentproviders/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from .figshare import Figshare
from .git import Git
from .hydroshare import Hydroshare
from .meca import Meca
from .mercurial import Mercurial
from .swhid import Swhid
from .zenodo import Zenodo
from .meca import Meca
16 changes: 10 additions & 6 deletions repo2docker/contentproviders/meca.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
from .base import ContentProvider
from requests import Session
import os
from hashlib import md5
from os import path
import tempfile
import shutil
import tempfile
import xml.etree.ElementTree as ET
from zipfile import ZipFile, is_zipfile
from hashlib import md5
from os import path
from urllib.parse import urlparse, urlunparse
from zipfile import ZipFile, is_zipfile

from requests import Session

from .base import ContentProvider


def get_hashed_slug(url, changes_with_content):
"""Return a unique slug that is invariant to query parameters in the url"""
Expand All @@ -18,6 +21,7 @@ def get_hashed_slug(url, changes_with_content):

return "meca-" + md5(f"{stripped_url}-{changes_with_content}".encode()).hexdigest()


def fetch_zipfile(session, url, dst_dir):
resp = session.get(url, headers={"accept": "application/zip"}, stream=True)
resp.raise_for_status()
Expand Down

0 comments on commit a806b14

Please sign in to comment.