Skip to content

Commit

Permalink
Mem (1/3): defer copy_file_locally to next PR
Browse files Browse the repository at this point in the history
  • Loading branch information
cjao committed Jul 14, 2023
1 parent 0556d23 commit a3ab70b
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions covalent/_shared_files/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"""General utils for Covalent."""

import inspect
import shutil
import socket
from datetime import timedelta
from typing import Callable, Dict, Set, Tuple
Expand Down Expand Up @@ -241,20 +240,3 @@ def format_server_url(hostname: str = None, port: int = None) -> str:
url = "".join(["/".join(parts[:3])] + [f":{port}/"] + ["/".join(parts[3:])])

return url.strip("/")


# For use by LocalDispatcher and ResultsManager when running Covalent
# server locally
def copy_file_locally(src_uri, dest_uri):
scheme_prefix = "file://"
if src_uri.startswith(scheme_prefix):
src_path = src_uri[len(scheme_prefix) :]
else:
raise TypeError(f"{src_uri} is not a valid URI")
# src_path = src_uri
if dest_uri.startswith(scheme_prefix):
dest_path = dest_uri[len(scheme_prefix) :]
else:
raise TypeError(f"{dest_uri} is not a valid URI")

shutil.copyfile(src_path, dest_path)

0 comments on commit a3ab70b

Please sign in to comment.