Skip to content

Commit

Permalink
πŸ› S3TextualPath
Browse files Browse the repository at this point in the history
  • Loading branch information
juftin committed Mar 13, 2024
1 parent c3dca8a commit 6befa0a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions textual_universal_directorytree/alternate_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from __future__ import annotations

import os
import re
from typing import Any

from upath.implementations.cloud import S3Path
Expand Down Expand Up @@ -100,6 +101,12 @@ def _is_top_level_bucket(self) -> bool:
"""
return len(self.parts) == 1 and self.parts[0] == "/"

def __str__(self) -> str:
"""
String representation of the S3Path
"""
return re.sub(r"s3:/*", "s3://", super().__str__())

@property
def name(self) -> str:
"""
Expand Down

0 comments on commit 6befa0a

Please sign in to comment.