File: mode.py

package info (click to toggle)
trash-cli 0.24.5.26-0.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,972 kB
  • sloc: python: 9,789; sh: 121; makefile: 11
file content (13 lines) | stat: -rw-r--r-- 414 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
from enum import Enum


class Mode(Enum):
    mode_unspecified = 'mode_unspecified'
    mode_interactive = 'mode_interactive'
    mode_force = 'mode_force'

    def can_ignore_not_existent_path(self):  # type: () -> bool
        return self == Mode.mode_force

    def should_we_ask_to_the_user(self, is_path_accessible):  # type: (bool) -> bool
        return self == Mode.mode_interactive and is_path_accessible