mirror of
https://github.com/Garmelon/PFERD.git
synced 2023-12-21 10:23:01 +01:00
Use PurePath instead of Path
Path should only be used when we need to access the file system. For all other purposes (mainly crawling), we use PurePath instead since the paths don't correspond to paths in the local file system.
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import asyncio
|
||||
import random
|
||||
from pathlib import Path
|
||||
from pathlib import PurePath
|
||||
from typing import Any
|
||||
|
||||
from rich.markup import escape
|
||||
@ -37,9 +37,9 @@ DUMMY_TREE = {
|
||||
|
||||
class DummyCrawler(Crawler):
|
||||
async def crawl(self) -> None:
|
||||
await self._crawl_entry(Path(), DUMMY_TREE)
|
||||
await self._crawl_entry(PurePath(), DUMMY_TREE)
|
||||
|
||||
async def _crawl_entry(self, path: Path, value: Any) -> None:
|
||||
async def _crawl_entry(self, path: PurePath, value: Any) -> None:
|
||||
if value is True:
|
||||
async with self.exclusive_output():
|
||||
await ainput(f"File {path}, please press enter: ")
|
||||
|
Reference in New Issue
Block a user