Skip to content

Commit

Permalink
Decouple from PyFilesystem2 dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
mxmlnkn committed Oct 12, 2024
1 parent 5590fb8 commit b9624a8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pyfatfs/FatIO.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,25 @@
import threading
from typing import Union, Optional

from fs.mode import Mode
from pyfatfs import PyFATException

from pyfatfs.PyFat import PyFat


class DefaultModeReadOnly:
def __init__(self):
self.truncate = False
self.appending = False
self.reading = True
self.writing = False


class FatIO(io.RawIOBase):
"""Wrap basic I/O operations for PyFat."""

def __init__(self, fs: PyFat,
path: str,
mode: Mode = Mode('r')) -> None:
mode = DefaultModeReadOnly()) -> None:
"""Wrap basic I/O operations for PyFat. **Currently read-only**.
:param fs: `PyFat`: Instance of opened filesystem
Expand Down

0 comments on commit b9624a8

Please sign in to comment.