Skip to content

Commit

Permalink
fix deletion bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
azuline committed Oct 18, 2023
1 parent 8c6155e commit 4103cb3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions rose/virtualfs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import errno
import logging
import os
import re
import stat
import subprocess
from collections.abc import Iterator
Expand Down Expand Up @@ -289,6 +290,9 @@ def chmod(self, *_, **__) -> None: # type: ignore
def chown(self, *_, **__) -> None: # type: ignore
pass

def unlink(self, *_, **__) -> None: # type: ignore
pass

def create(self, *_, **__) -> None: # type: ignore
raise fuse.FuseOSError(errno.ENOTSUP)

Expand Down Expand Up @@ -368,13 +372,13 @@ def parse_virtual_path(path: str) -> ParsedPath:
raise fuse.FuseOSError(errno.ENOENT)


POSITION_REGEX = re.compile(r"^\d+\. ")


# In collages, we print directories with position of the release in the collage. When parsing,
# strip it out. Otherwise we will have to handle this parsing in every method.
def rm_position(x: str) -> str:
try:
return x.split(". ", maxsplit=1)[1]
except IndexError:
return x
return POSITION_REGEX.sub("", x)


def mkstat(mode: Literal["dir", "file"], file: Path | None = None) -> dict[str, Any]:
Expand Down

0 comments on commit 4103cb3

Please sign in to comment.