From fa4e36a568be07102343418e681f616e8418af54 Mon Sep 17 00:00:00 2001 From: Emma Turetsky Date: Tue, 16 Apr 2024 16:27:23 -0500 Subject: [PATCH] Modified the core code to interact with same package modules correctly --- src/pelicanfs/core.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pelicanfs/core.py b/src/pelicanfs/core.py index 527ba08..bd23b33 100644 --- a/src/pelicanfs/core.py +++ b/src/pelicanfs/core.py @@ -17,7 +17,7 @@ import fsspec import fsspec.registry from fsspec.asyn import AsyncFileSystem -import pelicanfs.dir_header_parser as dir_header_parser +from .dir_header_parser import parse_metalink, get_dirlist_loc import fsspec.implementations.http as fshttp import aiohttp import urllib.parse @@ -91,7 +91,7 @@ async def get_working_cache(self, fileloc): Returns the highest priority cache for the namespace that appears to be owrking """ headers = await self.get_director_headers(fileloc) - metalist = dir_header_parser.parse_metalink(headers)[1:] + metalist = parse_metalink(headers)[1:] while len(metalist) > 0: updatedUrl = metalist[0][0] metalist = metalist[1:] @@ -122,7 +122,7 @@ async def wrapper(self, *args, **kwargs): path = args[0] parsedUrl = urllib.parse.urlparse(path) headers = await self.get_director_headers(parsedUrl.path) - dirlistloc = dir_header_parser.get_dirlist_loc(headers) + dirlistloc = get_dirlist_loc(headers) if dirlistloc == None: raise RuntimeError listUrl = dirlistloc + "/" + parsedUrl.path @@ -146,7 +146,7 @@ async def _find(self, path, maxdepth=None, withdirs=False, **kwargs): async def _walk(self, path, maxdepth=None, on_error="omit", **kwargs): parsedUrl = urllib.parse.urlparse(path) headers = await self.get_director_headers(parsedUrl.path) - dirlistloc = dir_header_parser.get_dirlist_loc(headers) + dirlistloc = get_dirlist_loc(headers) if dirlistloc == "": raise RuntimeError listUrl = dirlistloc + "/" + path