id
int64
0
458k
file_name
stringlengths
4
119
file_path
stringlengths
14
227
content
stringlengths
24
9.96M
size
int64
24
9.96M
language
stringclasses
1 value
extension
stringclasses
14 values
total_lines
int64
1
219k
avg_line_length
float64
2.52
4.63M
max_line_length
int64
5
9.91M
alphanum_fraction
float64
0
1
repo_name
stringlengths
7
101
repo_stars
int64
100
139k
repo_forks
int64
0
26.4k
repo_open_issues
int64
0
2.27k
repo_license
stringclasses
12 values
repo_extraction_date
stringclasses
433 values
11,800
test_volume_of_parent.py
andreafrancia_trash-cli/tests/test_put/components/test_volume_of_parent.py
import unittest from typing import cast import flexmock from tests.support.put.fake_fs.fake_fs import FakeFs from trashcli.fstab.volume_of import VolumeOf from trashcli.put.fs.parent_realpath import ParentRealpathFs from trashcli.put.fs.volume_of_parent import VolumeOfParent class TestVolumeOfParent(unittest.TestCa...
595
Python
.py
15
34.933333
72
0.75
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,801
test_trash_put_reporter.py
andreafrancia_trash-cli/tests/test_put/components/test_trash_put_reporter.py
from tests.support.py2mock import Mock from six import StringIO from trashcli.put.describer import Describer from tests.support.put.fake_fs.fake_fs import FakeFs from trashcli.put.my_logger import MyLogger from trashcli.put.my_logger import StreamBackend from trashcli.put.reporting.trash_put_reporter import TrashPutRe...
820
Python
.py
19
37.263158
70
0.727387
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,802
test_describer.py
andreafrancia_trash-cli/tests/test_put/components/test_describer.py
# Copyright (C) 2011-2022 Andrea Francia Bereguardo(PV) Italy import unittest from tests.support.put.fake_fs.fake_fs import FakeFs from trashcli.put.describer import Describer class TestDescriber(unittest.TestCase): def setUp(self): self.fs = FakeFs() self.describer = Describer(self.fs) def ...
1,599
Python
.py
32
42.6875
72
0.659355
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,803
test_readlink.py
andreafrancia_trash-cli/tests/test_put/components/test_fake_fs/test_readlink.py
from tests.support.capture_error import capture_error from tests.support.put.fake_fs.fake_fs import FakeFs from trashcli.put.fs.real_fs import RealFs from tests.support.dirs.temp_dir import temp_dir temp_dir = temp_dir class TestReadLinkOnRealFs: def setup_method(self): self.fs = RealFs() def test_r...
2,290
Python
.py
48
39.958333
80
0.636856
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,804
test_fake_fs.py
andreafrancia_trash-cli/tests/test_put/components/test_fake_fs/test_fake_fs.py
import unittest from tests.support.put.fake_fs.fake_fs import FakeFs from tests.support.put.format_mode import format_mode from tests.support.capture_error import capture_error class TestFakeFs(unittest.TestCase): def setUp(self): self.fs = FakeFs('/') def test(self): result = self.fs.ls_a("...
5,100
Python
.py
120
34.416667
78
0.597601
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,805
test_realpath.py
andreafrancia_trash-cli/tests/test_put/components/test_fake_fs/test_realpath.py
from tests.support.put.fake_fs.fake_fs import FakeFs class TestRealpath: def setup_method(self): self.fs = FakeFs() def test(self): self.fs.touch("pippo") assert self.fs.realpath("pippo") == "/pippo" def test_cur_dir_with_several_paths(self): self.fs.mkdir("music") ...
476
Python
.py
12
32.083333
74
0.629139
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,806
test_makedirs.py
andreafrancia_trash-cli/tests/test_put/components/test_fake_fs/test_makedirs.py
from tests.support.capture_error import capture_error from tests.support.put.fake_fs.fake_fs import FakeFs from trashcli.put.fs.fs import list_all class TestMakeDirs: def setup_method(self): self.fs = FakeFs() def test_makedirs(self): self.fs.makedirs("/foo/bar/baz", 0o700) assert [ ...
1,715
Python
.py
38
35.368421
71
0.56438
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,807
test_real_fs_permissions.py
andreafrancia_trash-cli/tests/test_put/components/real_fs/test_real_fs_permissions.py
import unittest from tests.support.capture_error import capture_error from tests.support.dirs.my_path import MyPath from trashcli.put.fs.real_fs import RealFs class TestRealFsPermissions(unittest.TestCase): def setUp(self): self.fs = RealFs() self.tmp_dir = MyPath.make_temp_dir() def test(se...
922
Python
.py
22
34.363636
80
0.628924
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,808
test_size_counter_on_fake_fs.py
andreafrancia_trash-cli/tests/test_put/components/real_fs/test_size_counter_on_fake_fs.py
import unittest from tests.support.dirs.my_path import MyPath from tests.support.put.fake_fs.fake_fs import FakeFs from trashcli.put.fs.size_counter import SizeCounter class TestSizeCounterOnFakeFs(unittest.TestCase): def setUp(self): self.fs = FakeFs() self.counter = SizeCounter(self.fs) ...
1,183
Python
.py
24
42.25
75
0.629565
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,809
test_real_fs_is_accessible.py
andreafrancia_trash-cli/tests/test_put/components/real_fs/test_real_fs_is_accessible.py
import os import unittest from tests.support.dirs.my_path import MyPath from trashcli.put.fs.real_fs import RealFs class TestRealFsIsAccessible(unittest.TestCase): def setUp(self): self.fs = RealFs() self.tmp_dir = MyPath.make_temp_dir() def test_dangling_link(self): os.symlink('non-...
1,144
Python
.py
26
36.730769
61
0.654578
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,810
test_real_fs_list_dir.py
andreafrancia_trash-cli/tests/test_put/components/real_fs/test_real_fs_list_dir.py
import unittest from tests.support.dirs.my_path import MyPath from trashcli.put.fs.real_fs import RealFs class TestRealFsListDir(unittest.TestCase): def setUp(self): self.fs = RealFs() self.tmp_dir = MyPath.make_temp_dir() def test(self): self.fs.make_file(self.tmp_dir / 'a' , 'conte...
627
Python
.py
15
35.333333
76
0.633663
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,811
test_fake_fs_list_dir.py
andreafrancia_trash-cli/tests/test_put/components/real_fs/test_fake_fs_list_dir.py
import unittest from tests.support.dirs.my_path import MyPath from tests.support.put.fake_fs.fake_fs import FakeFs class TestFakeFsListDir(unittest.TestCase): def setUp(self): self.fs = FakeFs() self.tmp_dir = MyPath('/tmp') self.fs.makedirs(self.tmp_dir, 0o700) def test(self): ...
616
Python
.py
14
37.5
76
0.638191
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,812
test_fake_fs_walk_no_follow.py
andreafrancia_trash-cli/tests/test_put/components/real_fs/test_fake_fs_walk_no_follow.py
from tests.support.put.fake_fs.fake_fs import FakeFs from trashcli.put.fs.fs import list_all class TestWalkNoFollow: def setup_method(self): self.fs = FakeFs() def test(self): self.fs.make_file("pippo") self.fs.makedirs("/a/b/c/d", 0o700) assert "\n".join(list_all(self.fs, "/...
592
Python
.py
13
25.153846
64
0.386087
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,813
test_size_counter_on_real_fs.py
andreafrancia_trash-cli/tests/test_put/components/real_fs/test_size_counter_on_real_fs.py
import unittest import pytest from tests.support.dirs.my_path import MyPath from trashcli.put.fs.size_counter import SizeCounter from trashcli.put.fs.real_fs import RealFs @pytest.mark.slow class TestSizeCounterOnRealFs(unittest.TestCase): def setUp(self): self.fs = RealFs() self.counter = SizeC...
1,231
Python
.py
27
39
75
0.637049
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,814
test_names.py
andreafrancia_trash-cli/tests/test_put/components/test_lstat/test_names.py
import getpass import os import grp from trashcli.put.fs.real_fs import Names class TestNames: def setup_method(self): self.names = Names() def test_username(self): assert self.names.username(os.getuid()) == getpass.getuser() def test_username_when_not_found(self): assert self....
698
Python
.py
19
31
74
0.687593
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,815
test_trashing_checker.py
andreafrancia_trash-cli/tests/test_put/components/trashing_checker/test_trashing_checker.py
from trashcli.fstab.volumes import FakeVolumes from trashcli.put.core.candidate import Candidate from trashcli.put.core.either import Left from trashcli.put.core.trashee import Trashee from trashcli.put.gate import Gate from trashcli.put.janitor_tools.trash_dir_checker import TrashDirChecker, \ DifferentVolumes fro...
1,695
Python
.py
39
34.358974
75
0.641119
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,816
test_home_fallback_gate_impl.py
andreafrancia_trash-cli/tests/test_put/components/trashing_checker/test_home_fallback_gate_impl.py
from tests.support.put.fake_fs.fake_fs import FakeFs from trashcli.put.core.candidate import Candidate from trashcli.put.core.check_type import NoCheck from trashcli.put.core.either import Left from trashcli.put.core.path_maker_type import PathMakerType from trashcli.put.core.trashee import Trashee from trashcli.put.ga...
1,541
Python
.py
38
33.631579
75
0.658194
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,817
check-python-dep
andreafrancia_trash-cli/scripts/lib/check-python-dep
#!/bin/bash set -euo pipefail SCRIPT_DIR="$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" COMMAND="$1" test -x "$VIRTUAL_ENV/bin/$COMMAND" || { >&2 echo "$COMMAND not installed Please run: pip install -r requirements.txt -r requirements-dev.txt " }
282
Python
.py
10
26
80
0.63806
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,818
fs.py
andreafrancia_trash-cli/trashcli/fs.py
import os import shutil import stat from abc import abstractmethod from typing import Iterable, List from trashcli.compat import Protocol class FileSize(Protocol): @abstractmethod def file_size(self, path): raise NotImplementedError() class MakeFileExecutable(Protocol): @abstractmethod def ...
6,321
Python
.py
182
29.065934
107
0.707522
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,819
trash.py
andreafrancia_trash-cli/trashcli/trash.py
# Copyright (C) 2007-2011 Andrea Francia Trivolzio(PV) Italy version = '0.24.5.26'
84
Python
.py
2
40.5
60
0.740741
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,820
trash_dirs_scanner.py
andreafrancia_trash-cli/trashcli/trash_dirs_scanner.py
import os from typing import Iterable from trashcli.compat import Protocol from trashcli.fs import PathExists, IsStickyDir, IsSymLink from trashcli.fstab.volume_listing import VolumesListing from trashcli.lib.dir_checker import DirChecker from trashcli.lib.user_info import UserInfoProvider class MyEnum(str): def...
4,006
Python
.py
84
37.27381
79
0.625833
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,821
shell_completion.py
andreafrancia_trash-cli/trashcli/shell_completion.py
import argparse from copy import copy from typing import Dict try: def convert_to_list(tuple): return [item for item in tuple] from shtab import add_argument_to, FILE, DIR # type: ignore defaults = convert_to_list(add_argument_to.__defaults__) defaults[-1] = { "zsh": r""" # https:/...
1,775
Python
.py
47
30.12766
116
0.59883
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,822
file_system_reader.py
andreafrancia_trash-cli/trashcli/file_system_reader.py
from trashcli.fs import RealIsStickyDir, RealHasStickyBit, \ RealIsSymLink, RealContentsOf, RealEntriesIfDirExists, RealExists from trashcli.list.fs import FileSystemReaderForListCmd class FileSystemReader(FileSystemReaderForListCmd, RealIsStickyDir, RealHasStickyBit,...
514
Python
.py
12
27.583333
69
0.602
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,823
compat.py
andreafrancia_trash-cli/trashcli/compat.py
def protocol(): try: from typing import Protocol return Protocol except ImportError as e: from typing_extensions import Protocol return Protocol Protocol = protocol() del protocol
223
Python
.py
9
19
46
0.696682
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,824
context.py
andreafrancia_trash-cli/trashcli/put/context.py
from typing import List from typing import NamedTuple from typing import Optional from trashcli.compat import Protocol from trashcli.lib.environ import Environ from trashcli.put.core.logs import LogData from trashcli.put.core.mode import Mode from trashcli.put.core.trash_all_result import TrashAllResult from trashcli....
1,219
Python
.py
34
28.852941
61
0.643766
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,825
suffix.py
andreafrancia_trash-cli/trashcli/put/suffix.py
from trashcli.put.core.int_generator import IntGenerator class Suffix: def __init__(self, int_gen, # type: IntGenerator ): self.int_gen = int_gen def suffix_for_index(self, index): if index == 0: return "" elif index < 100: re...
411
Python
.py
13
21.923077
57
0.521519
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,826
dir_maker.py
andreafrancia_trash-cli/trashcli/put/dir_maker.py
from trashcli.put.fs.fs import Fs class DirMaker: def __init__(self, fs): # type: (Fs) -> None self.fs = fs def mkdir_p(self, path, mode): try: self.fs.makedirs(path, mode) except OSError: if not self.fs.isdir(path): raise
298
Python
.py
10
21.3
48
0.54386
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,827
my_logger.py
andreafrancia_trash-cli/trashcli/put/my_logger.py
from typing import IO from typing import List from trashcli.compat import Protocol from trashcli.put.core.logs import Level from trashcli.put.core.logs import LogData from trashcli.put.core.logs import LogEntry class LoggerBackend(Protocol): def write_message(self, log_entry, # type: LogEn...
1,812
Python
.py
49
25.428571
80
0.525985
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,828
user.py
andreafrancia_trash-cli/trashcli/put/user.py
from trashcli.lib.my_input import Input from trashcli.put.describer import Describer class User: def __init__(self, my_input, # type: Input describer, # type: Describer ): self.input = my_input self.describer = describer def ask_user_about...
776
Python
.py
19
31.210526
74
0.599466
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,829
format_trash_info.py
andreafrancia_trash-cli/trashcli/put/format_trash_info.py
import datetime from six.moves.urllib.parse import quote as url_quote def format_trashinfo(original_location, # type: str deletion_date, # type: datetime.datetime ): content = ("[Trash Info]\n" + "Path=%s\n" % format_original_location(original_location) ...
665
Python
.py
13
42.846154
80
0.64031
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,830
trash_dir_volume_reader.py
andreafrancia_trash-cli/trashcli/put/trash_dir_volume_reader.py
import os from trashcli.put.fs.fs import RealPathFs class TrashDirVolumeReader: def __init__(self, fs, # type: RealPathFs ): self.fs = fs def volume_of_trash_dir(self, trash_dir_path): norm_trash_dir_path = os.path.normpath(trash_dir_path) return se...
388
Python
.py
11
26.818182
62
0.616622
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,831
describer.py
andreafrancia_trash-cli/trashcli/put/describer.py
import os class Describer: def __init__(self, fs): self.fs = fs def describe(self, path): """ Return a textual description of the file pointed by this path. Options: - "symbolic link" - "directory" - "'.' directory" - "'..' directory" ...
1,221
Python
.py
40
18.75
70
0.453311
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,832
gate.py
andreafrancia_trash-cli/trashcli/put/gate.py
from enum import Enum class Gate(Enum): HomeFallback = "HomeFallbackGate" SameVolume = "SameVolumeGate" def __repr__(self): return "%s.%s" % (type(self).__name__, self.name)
197
Python
.py
6
28
57
0.648936
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,833
clock.py
andreafrancia_trash-cli/trashcli/put/clock.py
import datetime class PutClock: def now(self): # type: () -> datetime.datetime raise NotImplementedError() class RealClock(PutClock): def now(self): # type: () -> datetime.datetime return datetime.datetime.now()
242
Python
.py
7
29.571429
51
0.683983
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,834
janitor.py
andreafrancia_trash-cli/trashcli/put/janitor.py
from typing import NamedTuple, TypeVar from trashcli.put.suffix import Suffix from trashcli.put.core.int_generator import IntGenerator from trashcli.put.my_logger import LoggerBackend from trashcli.put.clock import PutClock from trashcli.lib.environ import Environ from trashcli.put.core.candidate import Candidate ...
3,514
Python
.py
75
38.68
82
0.683841
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,835
file_trasher.py
andreafrancia_trash-cli/trashcli/put/file_trasher.py
# Copyright (C) 2007-2023 Andrea Francia Trivolzio(PV) Italy from trashcli.put.fs.fs import Fs from trashcli.put.context import Context from trashcli.put.core.trash_result import TrashResult from trashcli.put.core.trashee import Trashee from trashcli.put.fs.parent_realpath import ParentRealpathFs from trashcli.put.fs.v...
3,073
Python
.py
62
35.112903
80
0.591681
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,836
trash_directories_finder.py
andreafrancia_trash-cli/trashcli/put/trash_directories_finder.py
# Copyright (C) 2007-2023 Andrea Francia Trivolzio(PV) Italy from typing import List from trashcli.fstab.volume_of import VolumeOf from trashcli.lib.environ import Environ from trashcli.lib.trash_dirs import ( volume_trash_dir1, volume_trash_dir2, home_trash_dir) from trashcli.put.core.candidate import Candidate f...
3,078
Python
.py
64
30.90625
75
0.526946
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,837
octal.py
andreafrancia_trash-cli/trashcli/put/octal.py
def octal(n): # type: (int) -> str return "%s%s" % ("0o", _remove_octal_prefix(oct(n))) def _remove_octal_prefix(o): if o.startswith('0o'): return o[2:] elif o.startswith('0'): return o[1:] else: ValueError('Invalid octal format: %s' % o)
282
Python
.py
9
25.666667
56
0.560886
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,838
original_location.py
andreafrancia_trash-cli/trashcli/put/original_location.py
import os from trashcli.put.core.path_maker_type import PathMakerType from trashcli.put.fs.fs import Fs class OriginalLocation: def __init__(self, fs, # type: Fs ): self.fs = fs def for_file(self, path, path_maker_type, # type: Pa...
1,305
Python
.py
31
28.903226
67
0.541798
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,839
parser.py
andreafrancia_trash-cli/trashcli/put/parser.py
import os import pprint from argparse import ArgumentParser from argparse import RawDescriptionHelpFormatter from argparse import SUPPRESS from typing import Any from typing import List from typing import NamedTuple from typing import Optional from typing import Union from trashcli.put.core.mode import Mode from trash...
4,803
Python
.py
117
28.418803
80
0.544209
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,840
main.py
andreafrancia_trash-cli/trashcli/put/main.py
import os import random import sys from trashcli.lib.environ import cast_environ from trashcli.lib.my_input import Input from trashcli.lib.my_input import RealInput from trashcli.put.clock import RealClock from trashcli.put.core.int_generator import IntGenerator from trashcli.put.describer import Describer from trashc...
1,884
Python
.py
48
32.75
70
0.694915
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,841
trash_put_cmd.py
andreafrancia_trash-cli/trashcli/put/trash_put_cmd.py
from typing import List from trashcli.lib.environ import Environ from trashcli.put.context import Context from trashcli.put.my_logger import LogData from trashcli.put.parser import ExitWithCode from trashcli.put.parser import Parser from trashcli.put.parser import Trash from trashcli.put.reporting.trash_put_reporter i...
1,676
Python
.py
39
29.461538
70
0.569853
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,842
trasher.py
andreafrancia_trash-cli/trashcli/put/trasher.py
from trashcli.put.my_logger import LoggerBackend from trashcli.put.context import Context from trashcli.put.context import SingleTrasher from trashcli.put.core.trash_result import TrashResult from trashcli.put.core.trashee import should_skipped_by_specs from trashcli.put.file_trasher import FileTrasher from trashcli.p...
2,601
Python
.py
58
33.344828
80
0.621003
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,843
check_cast.py
andreafrancia_trash-cli/trashcli/put/check_cast.py
from typing import Any from typing import Type from typing import TypeVar from typing import cast T = TypeVar('T') def check_cast(t, value): # type: (Type[T], Any) -> T if isinstance(value, t): return cast(t, value) # type: ignore else: raise TypeError("expected %s, got %s" % (t, type(value...
324
Python
.py
10
28.7
65
0.665595
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,844
jobs.py
andreafrancia_trash-cli/trashcli/put/jobs.py
from typing import Generic from typing import Iterator from typing import Type from typing import TypeVar from trashcli.put.core.logs import Level from trashcli.put.core.logs import LogData from trashcli.put.core.logs import LogEntry from trashcli.put.core.logs import LogTag from trashcli.put.core.logs import MessageS...
2,190
Python
.py
57
28.859649
74
0.583176
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,845
stats_reader.py
andreafrancia_trash-cli/trashcli/put/reporting/stats_reader.py
# Copyright (C) 2007-2024 Andrea Francia Trivolzio(PV) Italy import os from grp import getgrgid from pwd import getpwuid from typing import NamedTuple import re from trashcli.put.core.either import Either from trashcli.put.core.either import Left from trashcli.put.core.either import Right def gentle_stat_read(path)...
1,634
Python
.py
44
30.090909
77
0.624446
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,846
trash_put_reporter.py
andreafrancia_trash-cli/trashcli/put/reporting/trash_put_reporter.py
# Copyright (C) 2007-2024 Andrea Francia Trivolzio(PV) Italy import os from typing import List from typing import Tuple from trashcli.put.fs.fs import Fs from trashcli.lib.environ import Environ from trashcli.lib.exit_codes import EX_IOERR from trashcli.lib.exit_codes import EX_OK from trashcli.put.core.candidate imp...
3,742
Python
.py
85
33.082353
80
0.589737
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,847
real_fs.py
andreafrancia_trash-cli/trashcli/put/fs/real_fs.py
import grp import os import pwd import stat from typing import NamedTuple from typing import Optional from trashcli import fs from trashcli.fs import write_file from trashcli.fstab.real_volume_of import RealVolumeOf from trashcli.put.fs.fs import Fs class Names: def username(self, uid): # type: (int) -> Optiona...
2,914
Python
.py
90
25.288889
72
0.620158
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,848
fs.py
andreafrancia_trash-cli/trashcli/put/fs/fs.py
import os from abc import abstractmethod from typing import Iterable from trashcli.compat import Protocol class RealPathFs(Protocol): @abstractmethod def realpath(self, path): raise NotImplementedError class Fs(RealPathFs, Protocol): @abstractmethod def atomic_write(self, path, content): ...
2,290
Python
.py
75
24.053333
59
0.692413
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,849
volume_of_parent.py
andreafrancia_trash-cli/trashcli/put/fs/volume_of_parent.py
from trashcli.fstab.volume_of import VolumeOf from trashcli.put.fs.parent_realpath import ParentRealpathFs class VolumeOfParent: def __init__(self, fs, # type: VolumeOf ): self.fs = fs def volume_of_parent(self, path): parent_realpath = ParentRealpathFs(self...
397
Python
.py
10
31.8
73
0.669271
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,850
parent_realpath.py
andreafrancia_trash-cli/trashcli/put/fs/parent_realpath.py
import os from trashcli.put.fs.fs import RealPathFs class ParentRealpathFs: def __init__(self, fs): # type: (RealPathFs) -> None self.fs = fs def parent_realpath(self, path): parent = os.path.dirname(path) return self.fs.realpath(parent)
275
Python
.py
8
28.875
57
0.673004
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,851
size_counter.py
andreafrancia_trash-cli/trashcli/put/fs/size_counter.py
import os from six.moves import map as imap from trashcli.put.fs.fs import Fs class SizeCounter: def __init__(self, fs, # type: Fs ): self.fs = fs def get_size_recursive(self, path): if self.fs.isfile(path): return self.fs.getsize(path) ...
675
Python
.py
20
23.4
62
0.541667
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,852
security_check.py
andreafrancia_trash-cli/trashcli/put/janitor_tools/security_check.py
from trashcli.put.core.candidate import Candidate from trashcli.put.core.check_type import NoCheck, TopTrashDirCheck from trashcli.put.core.either import Either, Right, Left from trashcli.put.core.failure_reason import FailureReason, LogContext class SecurityCheck: def __init__(self, fs): self.fs = fs ...
2,545
Python
.py
47
43.531915
96
0.649758
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,853
info_file_persister.py
andreafrancia_trash-cli/trashcli/put/janitor_tools/info_file_persister.py
import errno import os from typing import NamedTuple, Iterator from trashcli.lib.path_of_backup_copy import path_of_backup_copy from trashcli.put.fs.fs import Fs from trashcli.put.jobs import JobStatus, NeedsMoreAttempts, Succeeded, \ JobExecutor from trashcli.put.my_logger import LogData, MyLogger from trashcli.p...
2,896
Python
.py
69
29.391304
91
0.557214
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,854
trash_dir_checker.py
andreafrancia_trash-cli/trashcli/put/janitor_tools/trash_dir_checker.py
from typing import NamedTuple from trashcli.lib.environ import Environ from trashcli.put.core.candidate import Candidate from trashcli.put.core.either import Either from trashcli.put.core.either import Left from trashcli.put.core.either import Right from trashcli.put.core.failure_reason import FailureReason from trash...
3,039
Python
.py
68
34.558824
116
0.620807
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,855
put_trash_dir.py
andreafrancia_trash-cli/trashcli/put/janitor_tools/put_trash_dir.py
import os.path from typing import NamedTuple from trashcli.put.core.either import Either from trashcli.put.core.either import Left from trashcli.put.core.either import Right from trashcli.put.core.failure_reason import FailureReason from trashcli.put.core.failure_reason import LogContext from trashcli.put.fs.fs import...
1,534
Python
.py
40
30.1
70
0.629879
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,856
trash_dir_creator.py
andreafrancia_trash-cli/trashcli/put/janitor_tools/trash_dir_creator.py
from typing import NamedTuple from trashcli.put.core.candidate import Candidate from trashcli.put.core.either import Either, Right, Left from trashcli.put.core.failure_reason import FailureReason, LogContext from trashcli.put.dir_maker import DirMaker from trashcli.put.fs.fs import Fs class TrashDirCannotBeCreated( ...
1,198
Python
.py
26
37.615385
86
0.657804
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,857
info_creator.py
andreafrancia_trash-cli/trashcli/put/janitor_tools/info_creator.py
import os from typing import NamedTuple from trashcli.put.clock import PutClock from trashcli.put.core.candidate import Candidate from trashcli.put.core.either import Either from trashcli.put.core.either import Left from trashcli.put.core.either import Right from trashcli.put.core.failure_reason import FailureReason ...
2,058
Python
.py
43
35.906977
90
0.628799
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,858
trashee.py
andreafrancia_trash-cli/trashcli/put/core/trashee.py
import os from typing import NamedTuple class Trashee(NamedTuple('FileToBeTrashed', [ ('path', str), ('volume', str) ])): pass def should_skipped_by_specs(path): basename = os.path.basename(path) return (basename == ".") or (basename == "..")
267
Python
.py
10
23.3
50
0.664032
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,859
failure_reason.py
andreafrancia_trash-cli/trashcli/put/core/failure_reason.py
from abc import abstractmethod from typing import NamedTuple from trashcli.compat import Protocol from trashcli.lib.environ import Environ from trashcli.put.core.candidate import Candidate class LogContext(NamedTuple('LogContext', [ ('trashee_path', str), ('candidate', Candidate), ('environ', Environ), ]...
715
Python
.py
20
31.2
64
0.736919
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,860
check_type.py
andreafrancia_trash-cli/trashcli/put/core/check_type.py
from enum import Enum class CheckType(Enum): NoCheck = 'NoCheck' TopTrashDirCheck = 'TopTrashDirCheck' NoCheck = CheckType.NoCheck TopTrashDirCheck = CheckType.TopTrashDirCheck
189
Python
.py
6
28.5
45
0.815642
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,861
int_generator.py
andreafrancia_trash-cli/trashcli/put/core/int_generator.py
from trashcli.compat import Protocol class IntGenerator(Protocol): def new_int(self, min, # type: int max, # type: int ): # type: (...) -> int raise NotImplementedError
237
Python
.py
7
23.571429
41
0.530702
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,862
logs.py
andreafrancia_trash-cli/trashcli/put/core/logs.py
from abc import abstractmethod from enum import Enum from typing import List from typing import NamedTuple from trashcli.compat import Protocol class Level(Enum): INFO = "INFO" DEBUG = "DEBUG" WARNING = "WARNING" class LogTag(Enum): "tags used only during testing" unspecified = "unspecified" ...
1,628
Python
.py
49
27.673469
67
0.666881
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,863
either.py
andreafrancia_trash-cli/trashcli/put/core/either.py
from abc import abstractmethod from typing import Callable, TypeVar, Generic S = TypeVar("S") R = TypeVar("R") E = TypeVar("E") class Either(Generic[S, E]): @abstractmethod def bind(self, func): # type: (Callable[[S], Either[R, E]]) -> Either[R, E] raise NotImplementedError @abstra...
1,824
Python
.py
47
31.489362
74
0.561683
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,864
path_maker_type.py
andreafrancia_trash-cli/trashcli/put/core/path_maker_type.py
from enum import Enum class PathMakerType(Enum): AbsolutePaths = 'AbsolutePaths' RelativePaths = 'RelativePaths'
123
Python
.py
4
27.25
35
0.786325
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,865
trash_result.py
andreafrancia_trash-cli/trashcli/put/core/trash_result.py
from enum import Enum class TrashResult(Enum): Failure = "Failure" Success = "Success"
97
Python
.py
4
20.75
24
0.725275
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,866
candidate.py
andreafrancia_trash-cli/trashcli/put/core/candidate.py
import os import posixpath import re from typing import NamedTuple from trashcli.put.core.check_type import CheckType from trashcli.put.core.path_maker_type import PathMakerType from trashcli.put.gate import Gate class Candidate(NamedTuple('Candidate', [ ('trash_dir_path', str), ('volume', str), ('path_m...
1,139
Python
.py
32
29.0625
66
0.630909
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,867
mode.py
andreafrancia_trash-cli/trashcli/put/core/mode.py
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)...
414
Python
.py
9
40.555556
84
0.683292
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,868
trash_all_result.py
andreafrancia_trash-cli/trashcli/put/core/trash_all_result.py
from typing import NamedTuple, List class TrashAllResult(NamedTuple('TrashAllResult', [ ('failed_paths', List[str]), ])): def any_failure(self): # type: () -> bool return len(self.failed_paths) > 0
217
Python
.py
6
32.166667
51
0.674641
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,869
fs.py
andreafrancia_trash-cli/trashcli/list/fs.py
import abc from six import add_metaclass from trashcli.fs import IsSymLink, ContentsOf, EntriesIfDirExists, PathExists, \ IsStickyDir, HasStickyBit @add_metaclass(abc.ABCMeta) class FileSystemReaderForListCmd( IsStickyDir, HasStickyBit, IsSymLink, ContentsOf, EntriesIfDirExists, PathExis...
336
Python
.py
14
20.428571
80
0.789308
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,870
extractors.py
andreafrancia_trash-cli/trashcli/list/extractors.py
import os from trashcli.fs import file_size from trashcli.lib.path_of_backup_copy import path_of_backup_copy from trashcli.parse_trashinfo.maybe_parse_deletion_date import \ maybe_parse_deletion_date class DeletionDateExtractor: def extract_attribute(self, _trashinfo_path, contents): return maybe_par...
691
Python
.py
18
30.888889
64
0.696108
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,871
list_trash_action.py
andreafrancia_trash-cli/trashcli/list/list_trash_action.py
from __future__ import print_function import os from typing import List from typing import NamedTuple from trashcli.lib.dir_reader import DirReader from trashcli.lib.path_of_backup_copy import path_of_backup_copy from trashcli.lib.trash_dir_reader import TrashDirReader from trashcli.list.extractors import DeletionDat...
5,915
Python
.py
144
27.805556
78
0.55805
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,872
trash_dir_selector.py
andreafrancia_trash-cli/trashcli/list/trash_dir_selector.py
# Copyright (C) 2007-2023 Andrea Francia Trivolzio(PV) Italy from typing import List, Dict, Iterator, Tuple from trashcli.fstab.volume_of import VolumeOf from trashcli.lib.dir_checker import DirChecker from trashcli.lib.user_info import AllUsersInfoProvider, \ SingleUserInfoProvider from trashcli.trash_dirs_scanne...
2,342
Python
.py
51
30.254902
80
0.542432
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,873
parser.py
andreafrancia_trash-cli/trashcli/list/parser.py
import argparse from enum import Enum from typing import List, Union from trashcli.lib.print_version import PrintVersionArgs from trashcli.list.list_trash_action import ListTrashArgs from trashcli.list.minor_actions.debug_volumes import DebugVolumesArgs from trashcli.list.minor_actions.list_trash_dirs import ListTrash...
5,083
Python
.py
105
29.961905
120
0.511473
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,874
main.py
andreafrancia_trash-cli/trashcli/list/main.py
# Copyright (C) 2011-2022 Andrea Francia Bereguardo(PV) Italy import os import sys import trashcli.trash from trashcli.empty.main import ContentReader from trashcli.file_system_reader import FileSystemReader from trashcli.fs import RealContentsOf from trashcli.fstab.volume_listing import RealVolumesListing from trashc...
3,839
Python
.py
84
29.702381
80
0.559915
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,875
list_trash_dirs.py
andreafrancia_trash-cli/trashcli/list/minor_actions/list_trash_dirs.py
from typing import List, NamedTuple from trashcli.trash_dirs_scanner import trash_dir_found, \ trash_dir_skipped_because_parent_not_sticky, \ trash_dir_skipped_because_parent_is_symlink class ListTrashDirsArgs( NamedTuple('ListTrashDirsArgs', [('trash_dirs', List[str]), ('a...
1,344
Python
.py
32
29.28125
70
0.552833
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,876
print_python_executable.py
andreafrancia_trash-cli/trashcli/list/minor_actions/print_python_executable.py
class PrintPythonExecutableArgs: pass class PrintPythonExecutable: def run_action(self, _args, # type: PrintPythonExecutableArgs ): import sys print(sys.executable)
230
Python
.py
8
19.75
60
0.618182
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,877
debug_volumes.py
andreafrancia_trash-cli/trashcli/list/minor_actions/debug_volumes.py
from pprint import pprint class DebugVolumesArgs: pass class DebugVolumes(object): def run_action(self, _args, # type: DebugVolumesArgs ): import psutil import os all = sorted([p for p in psutil.disk_partitions(all=True)], k...
647
Python
.py
19
23.736842
67
0.551282
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,878
list_volumes.py
andreafrancia_trash-cli/trashcli/list/minor_actions/list_volumes.py
from __future__ import print_function class PrintVolumesArgs(object): pass class PrintVolumesList(object): def __init__(self, environ, volumes_listing, out): self.environ = environ self.volumes_listing = volumes_listing self.out = out def run_action(self, args...
482
Python
.py
13
28.461538
70
0.635776
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,879
output_event.py
andreafrancia_trash-cli/trashcli/restore/output_event.py
from typing import NamedTuple, Union Quit = NamedTuple('Quit', []) Die = NamedTuple('Die', [('msg', Union[str, Exception])]) Println = NamedTuple('Println', [('msg', str)]) Exiting = NamedTuple('Exiting', [('msg', str)]) OutputEvent = Union[Quit, Die, Println, Exiting]
271
Python
.py
6
44
57
0.689394
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,880
trashed_files.py
andreafrancia_trash-cli/trashcli/restore/trashed_files.py
from typing import Iterable from typing import NamedTuple from typing import Optional from typing import Union from trashcli.lib.path_of_backup_copy import path_of_backup_copy from trashcli.parse_trashinfo.parse_deletion_date import parse_deletion_date from trashcli.parse_trashinfo.parse_original_location import \ ...
3,841
Python
.py
85
31.835294
81
0.582999
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,881
trash_directories.py
andreafrancia_trash-cli/trashcli/restore/trash_directories.py
# Copyright (C) 2007-2023 Andrea Francia Trivolzio(PV) Italy from abc import abstractmethod, ABCMeta import six from typing import Optional from trashcli.fstab.volume_of import VolumeOf from trashcli.fstab.volumes import Volumes from trashcli.lib.environ import Environ from trashcli.lib.trash_dirs import ( volume...
2,510
Python
.py
60
30.333333
76
0.598522
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,882
run_restore_action.py
andreafrancia_trash-cli/trashcli/restore/run_restore_action.py
import os from abc import ABCMeta, abstractmethod import six from typing import Optional, Iterable from trashcli.restore.args import RunRestoreArgs from trashcli.restore.sort_method import sort_files from trashcli.restore.trashed_file import TrashedFile from trashcli.restore.trashed_files import TrashedFiles class ...
1,964
Python
.py
44
31.727273
78
0.58543
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,883
range.py
andreafrancia_trash-cli/trashcli/restore/range.py
from six.moves import range class Range: def __init__(self, start, stop): self.start = start self.stop = stop def __eq__(self, other): if type(other) != type(self): return False if self.start != other.start: return False if self.stop != other.st...
530
Python
.py
17
23.058824
56
0.551181
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,884
trashed_file.py
andreafrancia_trash-cli/trashcli/restore/trashed_file.py
import datetime import os from typing import NamedTuple, Optional class TrashedFile( NamedTuple('TrashedFile', [ ('original_location', str), ('deletion_date', Optional[datetime.datetime]), ('info_file', str), ('original_file', str), ])): """ Represent a trashed file. ...
1,092
Python
.py
29
30.034483
80
0.639282
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,885
output_recorder.py
andreafrancia_trash-cli/trashcli/restore/output_recorder.py
from typing import List from trashcli.restore.output import Output from trashcli.restore.output_event import Quit, Die, Println, OutputEvent class OutputRecorder(Output): def __init__(self): # type: (...) -> None self.events = [] # type: List[OutputEvent] def quit(self): # type: () -> None ...
847
Python
.py
20
33.8
73
0.578755
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,886
real_restore_logger.py
andreafrancia_trash-cli/trashcli/restore/real_restore_logger.py
from logging import Logger from trashcli.restore.restore_logger import RestoreLogger class RealRestoreLogger(RestoreLogger): def __init__(self, logger, # type: Logger ): self._logger = logger def warning(self, message): self._logger.warning(message)
313
Python
.py
9
26.888889
57
0.656667
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,887
sort_method.py
andreafrancia_trash-cli/trashcli/restore/sort_method.py
from abc import abstractmethod from typing import Callable, Any, Iterable from trashcli.compat import Protocol from trashcli.restore.args import Sort from trashcli.restore.trashed_file import TrashedFile def sort_files(sort, # type: Sort trashed_files, # type: Iterable[TrashedFile] ):...
1,526
Python
.py
34
37.176471
76
0.64503
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,888
restorer.py
andreafrancia_trash-cli/trashcli/restore/restorer.py
import os from trashcli.restore.file_system import RestoreWriteFileSystem, \ RestoreReadFileSystem from trashcli.restore.trashed_file import TrashedFile class Restorer: def __init__(self, read_fs, # type: RestoreReadFileSystem write_fs, # type: RestoreWriteFileSystem ...
1,218
Python
.py
27
33.037037
95
0.610455
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,889
restore_arg_parser.py
andreafrancia_trash-cli/trashcli/restore/restore_arg_parser.py
import os from typing import Union, List, cast from trashcli.lib.print_version import PrintVersionArgs from trashcli.restore.args import RunRestoreArgs, Sort from trashcli.shell_completion import add_argument_to, TRASH_FILES, TRASH_DIRS, \ complete_with Command = Union[PrintVersionArgs, RunRestoreArgs] class Re...
2,595
Python
.py
55
28.054545
95
0.478467
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,890
sequences.py
andreafrancia_trash-cli/trashcli/restore/sequences.py
from typing import NamedTuple, List from trashcli.restore.index import Sequence class Sequences(NamedTuple('Sequences', [ ('sequences', List[Sequence]), ])): def all_indexes(self): for sequence in self.sequences: for index in sequence: yield index
295
Python
.py
9
26.555556
43
0.681979
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,891
output.py
andreafrancia_trash-cli/trashcli/restore/output.py
from abc import ABCMeta, abstractmethod import six from trashcli.restore.output_event import OutputEvent @six.add_metaclass(ABCMeta) class Output: @abstractmethod def quit(self): raise NotImplementedError @abstractmethod def die(self, msg): raise NotImplementedError @abstractme...
542
Python
.py
19
21.578947
53
0.686047
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,892
restore_cmd.py
andreafrancia_trash-cli/trashcli/restore/restore_cmd.py
# Copyright (C) 2007-2023 Andrea Francia Trivolzio(PV) Italy from typing import TextIO, Callable from trashcli.lib.my_input import Input from trashcli.lib.print_version import PrintVersionAction, PrintVersionArgs from trashcli.restore.args import RunRestoreArgs from trashcli.restore.file_system import RestoreReadFileS...
2,385
Python
.py
49
37.285714
81
0.633047
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,893
info_dir_searcher.py
andreafrancia_trash-cli/trashcli/restore/info_dir_searcher.py
from typing import NamedTuple, Iterable, Optional from trashcli.restore.info_files import InfoFiles from trashcli.restore.trash_directories import TrashDirectories class InfoDirSearcher: def __init__(self, trash_directories, # type: TrashDirectories info_files, # type: InfoFile...
970
Python
.py
23
32.173913
77
0.60255
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,894
index.py
andreafrancia_trash-cli/trashcli/restore/index.py
from typing import Union from trashcli.restore.range import Range from trashcli.restore.single import Single Sequence = Union[Range, Single]
143
Python
.py
4
34.25
42
0.854015
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,895
restore_asking_the_user.py
andreafrancia_trash-cli/trashcli/restore/restore_asking_the_user.py
from typing import TypeVar, Generic, List, NamedTuple, Callable from six.moves import range from trashcli.lib.my_input import Input from trashcli.restore.index import Sequence from trashcli.restore.output import Output from trashcli.restore.output_event import Die, OutputEvent, Quit from trashcli.restore.output_event...
5,528
Python
.py
139
29.884892
104
0.585917
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,896
single.py
andreafrancia_trash-cli/trashcli/restore/single.py
from typing import NamedTuple class Single(NamedTuple('Single', [ ('index', int), ])): pass
102
Python
.py
5
17.4
35
0.684211
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,897
real_output.py
andreafrancia_trash-cli/trashcli/restore/real_output.py
from __future__ import print_function import six from trashcli.restore.output import Output from trashcli.restore.output_event import Println, Die, Quit, Exiting, \ OutputEvent class RealOutput(Output): def __init__(self, stdout, stderr, exit): self.stdout = stdout self.stderr = stderr ...
1,077
Python
.py
32
25.0625
72
0.604247
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,898
args.py
andreafrancia_trash-cli/trashcli/restore/args.py
from enum import Enum from typing import NamedTuple, Optional from trashcli.lib.enum_repr import repr_for_enum class Sort(Enum): ByDate = "ByDate" ByPath = "ByPath" DoNot = "DoNot" def __repr__(self): return repr_for_enum(self) class RunRestoreArgs( NamedTuple('RunRestoreArgs', [ ...
447
Python
.py
17
20.941176
48
0.625
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,899
info_files.py
andreafrancia_trash-cli/trashcli/restore/info_files.py
import os from trashcli.restore.file_system import ListingFileSystem class InfoFiles: def __init__(self, fs, # type: ListingFileSystem ): self.fs = fs def all_info_files(self, path): norm_path = os.path.normpath(path) info_dir = os.path.join(norm_pa...
688
Python
.py
18
27.111111
74
0.561562
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)