Convert a ``filepath`` to standard format of petrel oss. If the ``filepath`` is concatenated by ``os.path.join``, in a Windows environment, the ``filepath`` will be the format of 's3://bucket_name\\image.jpg'. By invoking :meth:`_format_path`, the above ``filepath``
(self, filepath: str)
| 76 | return filepath |
| 77 | |
| 78 | def _format_path(self, filepath: str) -> str: |
| 79 | """Convert a ``filepath`` to standard format of petrel oss. |
| 80 | |
| 81 | If the ``filepath`` is concatenated by ``os.path.join``, in a Windows |
| 82 | environment, the ``filepath`` will be the format of |
| 83 | 's3://bucket_name\\image.jpg'. By invoking :meth:`_format_path`, the |
| 84 | above ``filepath`` will be converted to 's3://bucket_name/image.jpg'. |
| 85 | |
| 86 | Args: |
| 87 | filepath (str): Path to be formatted. |
| 88 | """ |
| 89 | return re.sub(r'\\+', '/', filepath) |
| 90 | |
| 91 | def get(self, filepath: Union[str, Path]) -> bytes: |
| 92 | """Read data from a given ``filepath`` with 'rb' mode. |