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,600
__init__.py
ninja-ide_ninja-ide/ninja_ide/core/file_handling/filesystem_notifications/__init__.py
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # any later version. # # NIN...
1,526
Python
.py
36
38.583333
81
0.748148
ninja-ide/ninja-ide
927
248
195
GPL-3.0
9/5/2024, 5:11:18 PM (Europe/Amsterdam)
11,601
base_watcher.py
ninja-ide_ninja-ide/ninja_ide/core/file_handling/filesystem_notifications/base_watcher.py
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # any later version. # # NIN...
4,017
Python
.py
101
32.455446
85
0.616431
ninja-ide/ninja-ide
927
248
195
GPL-3.0
9/5/2024, 5:11:18 PM (Europe/Amsterdam)
11,602
darwin.py
ninja-ide_ninja-ide/ninja_ide/core/file_handling/filesystem_notifications/darwin.py
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # any later version. # # NIN...
1,821
Python
.py
47
34.531915
84
0.719796
ninja-ide/ninja-ide
927
248
195
GPL-3.0
9/5/2024, 5:11:18 PM (Europe/Amsterdam)
11,603
openbsd.py
ninja-ide_ninja-ide/ninja_ide/core/file_handling/filesystem_notifications/openbsd.py
# -*- coding: utf-8 *-* from ninja_ide.core.file_handling.filesystem_notifications import base_watcher from PyQt4.QtCore import SIGNAL class NinjaFileSystemWatcher(base_watcher.BaseWatcher): def __init__(self): self.watching_paths = {} super(NinjaFileSystemWatcher, self).__init__() self._...
680
Python
.py
16
36.3125
78
0.675799
ninja-ide/ninja-ide
927
248
195
GPL-3.0
9/5/2024, 5:11:18 PM (Europe/Amsterdam)
11,604
plugins_manager.py
ninja-ide_ninja-ide/ninja_ide/core/encapsulated_env/plugins_manager.py
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # any later version. # # NIN...
3,254
Python
.py
76
35.355263
72
0.673095
ninja-ide/ninja-ide
927
248
195
GPL-3.0
9/5/2024, 5:11:18 PM (Europe/Amsterdam)
11,605
nenvironment.py
ninja-ide_ninja-ide/ninja_ide/core/encapsulated_env/nenvironment.py
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # any later version. # # NIN...
10,023
Python
.py
269
30.02974
79
0.612744
ninja-ide/ninja-ide
927
248
195
GPL-3.0
9/5/2024, 5:11:18 PM (Europe/Amsterdam)
11,606
ntemplate_registry.py
ninja-ide_ninja-ide/ninja_ide/core/template_registry/ntemplate_registry.py
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # any later version. # # NIN...
6,884
Python
.py
172
31.47093
79
0.626555
ninja-ide/ninja-ide
927
248
195
GPL-3.0
9/5/2024, 5:11:18 PM (Europe/Amsterdam)
11,607
bundled_project_types.py
ninja-ide_ninja-ide/ninja_ide/core/template_registry/bundled_project_types.py
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # any later version. # # NIN...
5,060
Python
.py
138
30.210145
79
0.648721
ninja-ide/ninja-ide
927
248
195
GPL-3.0
9/5/2024, 5:11:18 PM (Europe/Amsterdam)
11,608
__bundled_project_types.py
ninja-ide_ninja-ide/ninja_ide/core/template_registry/__bundled_project_types.py
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # any later version. # # NIN...
6,611
Python
.py
166
31.463855
79
0.627907
ninja-ide/ninja-ide
927
248
195
GPL-3.0
9/5/2024, 5:11:18 PM (Europe/Amsterdam)
11,609
python_project_type.py
ninja-ide_ninja-ide/ninja_ide/core/template_registry/bundled_project_types/python_project_type.py
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # any later version. # # NIN...
3,256
Python
.py
81
34.765432
79
0.681876
ninja-ide/ninja-ide
927
248
195
GPL-3.0
9/5/2024, 5:11:18 PM (Europe/Amsterdam)
11,610
__init__.py
ninja-ide_ninja-ide/ninja_ide/core/template_registry/bundled_project_types/__init__.py
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # any later version. # # NIN...
775
Python
.py
18
42
70
0.759259
ninja-ide/ninja-ide
927
248
195
GPL-3.0
9/5/2024, 5:11:18 PM (Europe/Amsterdam)
11,611
initial_page.py
ninja-ide_ninja-ide/ninja_ide/core/template_registry/bundled_project_types/initial_page.py
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # any later version. # # NIN...
5,393
Python
.py
128
35.609375
79
0.687476
ninja-ide/ninja-ide
927
248
195
GPL-3.0
9/5/2024, 5:11:18 PM (Europe/Amsterdam)
11,612
pyqt_project_type.py
ninja-ide_ninja-ide/ninja_ide/core/template_registry/bundled_project_types/pyqt_project_type.py
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # any later version. # # NIN...
4,843
Python
.py
120
33.941667
79
0.674473
ninja-ide/ninja-ide
927
248
195
GPL-3.0
9/5/2024, 5:11:18 PM (Europe/Amsterdam)
11,613
__init__.py
ninja-ide_ninja-ide/ninja_tests/__init__.py
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # any later version. # # NIN...
770
Python
.py
19
39.526316
70
0.768309
ninja-ide/ninja-ide
927
248
195
GPL-3.0
9/5/2024, 5:11:18 PM (Europe/Amsterdam)
11,614
test_indenter.py
ninja-ide_ninja-ide/ninja_tests/gui/editor/test_indenter.py
import pytest from PyQt5.QtWidgets import QPlainTextEdit from ninja_ide.gui.editor.indenter import base class DummyEditor(QPlainTextEdit): def __enter__(self): self.textCursor().beginEditBlock() def __exit__(self, exc_type, exc_value, traceback): self.textCursor().endEditBlock() @pytest....
2,747
Python
.py
85
27.117647
68
0.610964
ninja-ide/ninja-ide
927
248
195
GPL-3.0
9/5/2024, 5:11:18 PM (Europe/Amsterdam)
11,615
_test_autocomplete_braces.py
ninja-ide_ninja-ide/ninja_tests/gui/editor/_test_autocomplete_braces.py
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # any later version. # # NIN...
3,061
Python
.py
86
31.604651
71
0.661137
ninja-ide/ninja-ide
927
248
195
GPL-3.0
9/5/2024, 5:11:18 PM (Europe/Amsterdam)
11,616
test_python_indenter.py
ninja-ide_ninja-ide/ninja_tests/gui/editor/test_python_indenter.py
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # any later version. # # NIN...
6,477
Python
.py
207
25.661836
82
0.540058
ninja-ide/ninja-ide
927
248
195
GPL-3.0
9/5/2024, 5:11:18 PM (Europe/Amsterdam)
11,617
_test_autocomplete_quotes.py
ninja-ide_ninja-ide/ninja_tests/gui/editor/_test_autocomplete_quotes.py
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # any later version. # # NIN...
3,923
Python
.py
96
36.614583
75
0.691296
ninja-ide/ninja-ide
927
248
195
GPL-3.0
9/5/2024, 5:11:18 PM (Europe/Amsterdam)
11,618
test_code_editor.py
ninja-ide_ninja-ide/ninja_tests/gui/editor/test_code_editor.py
import pytest from PyQt5.QtGui import QTextCursor from ninja_ide.gui.editor.base import CodeEditor @pytest.fixture def code_editor(): editor = CodeEditor() editor.text = "NINJA-IDE is not just another IDE" return editor def test_find_match(code_editor): assert code_editor.find_match('IDE') is True...
1,111
Python
.py
31
30.903226
71
0.712008
ninja-ide/ninja-ide
927
248
195
GPL-3.0
9/5/2024, 5:11:18 PM (Europe/Amsterdam)
11,619
__init__.py
ninja-ide_ninja-ide/ninja_tests/gui/editor/__init__.py
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # any later version. # # NIN...
692
Python
.py
16
42.25
70
0.760355
ninja-ide/ninja-ide
927
248
195
GPL-3.0
9/5/2024, 5:11:18 PM (Europe/Amsterdam)
11,620
test_editor.py
ninja-ide_ninja-ide/ninja_tests/gui/editor/test_editor.py
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # any later version. # # NIN...
7,204
Python
.py
183
34.502732
118
0.684406
ninja-ide/ninja-ide
927
248
195
GPL-3.0
9/5/2024, 5:11:18 PM (Europe/Amsterdam)
11,621
__test_marker_area.py
ninja-ide_ninja-ide/ninja_tests/gui/editor/side_areas/__test_marker_area.py
from ninja_tests.gui import editor editor_ref = editor.create_editor() widget = editor_ref.side_widgets.get("MarkerWidget") def test_1(qtbot): widget.add_bookmark(2) widget.add_bookmark(5) assert widget.bookmarks == [2, 5] def test_2(qtbot): for i in range(100): editor_ref.textCursor().inse...
1,289
Python
.py
42
25.904762
52
0.68629
ninja-ide/ninja-ide
927
248
195
GPL-3.0
9/5/2024, 5:11:18 PM (Europe/Amsterdam)
11,622
__init__.py
ninja-ide_ninja-ide/ninja_tests/gui/editor/side_areas/__init__.py
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # any later version. # # NIN...
1,058
Python
.py
25
41.16
70
0.756074
ninja-ide/ninja-ide
927
248
195
GPL-3.0
9/5/2024, 5:11:18 PM (Europe/Amsterdam)
11,623
__test_plugin_interfaces.py
ninja-ide_ninja-ide/ninja_tests/core/__test_plugin_interfaces.py
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # any later version. # # NIN...
1,401
Python
.py
41
30.463415
70
0.726394
ninja-ide/ninja-ide
927
248
195
GPL-3.0
9/5/2024, 5:11:18 PM (Europe/Amsterdam)
11,624
__test_file_handling_nvirtualfilesystem.py
ninja-ide_ninja-ide/ninja_tests/core/__test_file_handling_nvirtualfilesystem.py
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # any later version. # # NIN...
2,769
Python
.py
67
35.761194
77
0.708271
ninja-ide/ninja-ide
927
248
195
GPL-3.0
9/5/2024, 5:11:18 PM (Europe/Amsterdam)
11,625
__test_plugin_manager.py
ninja-ide_ninja-ide/ninja_tests/core/__test_plugin_manager.py
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # any later version. # # NIN...
1,872
Python
.py
44
38.340909
79
0.720176
ninja-ide/ninja-ide
927
248
195
GPL-3.0
9/5/2024, 5:11:18 PM (Europe/Amsterdam)
11,626
__test_file_manager.py
ninja-ide_ninja-ide/ninja_tests/core/__test_file_manager.py
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # any later version. # # NIN...
1,472
Python
.py
34
39.558824
71
0.716491
ninja-ide/ninja-ide
927
248
195
GPL-3.0
9/5/2024, 5:11:18 PM (Europe/Amsterdam)
11,627
test_file_handling_nfile.py
ninja-ide_ninja-ide/ninja_tests/core/test_file_handling_nfile.py
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # any later version. # # NIN...
5,848
Python
.py
141
37.06383
78
0.713858
ninja-ide/ninja-ide
927
248
195
GPL-3.0
9/5/2024, 5:11:18 PM (Europe/Amsterdam)
11,628
__init__.py
ninja-ide_ninja-ide/ninja_tests/core/__init__.py
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # any later version. # # NIN...
692
Python
.py
16
42.25
70
0.760355
ninja-ide/ninja-ide
927
248
195
GPL-3.0
9/5/2024, 5:11:18 PM (Europe/Amsterdam)
11,629
__test_plugin.py
ninja-ide_ninja-ide/ninja_tests/core/plugins/test_plugin/__test_plugin.py
# -*- coding: utf-8 -*- from ninja_ide.core import plugin class TestPlugin(plugin.Plugin): pass
103
Python
.py
4
23
33
0.71875
ninja-ide/ninja-ide
927
248
195
GPL-3.0
9/5/2024, 5:11:18 PM (Europe/Amsterdam)
11,630
setup.py
ninja-ide_ninja-ide/build_files/installer/windows/setup.py
#********************************************* # Auto-Generated With py2Nsis #********************************************* from setuptools import find_packages packages = find_packages(exclude=["tests"]) import warnings #ignore the sets DeprecationWarning warnings.simplefilter('ignore', DeprecationWarning) ...
1,372
Python
.py
44
24.159091
169
0.510313
ninja-ide/ninja-ide
927
248
195
GPL-3.0
9/5/2024, 5:11:18 PM (Europe/Amsterdam)
11,631
typing_performance.py
ninja-ide_ninja-ide/ninja_profiling/typing_performance.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # any...
3,231
Python
.py
84
34.547619
76
0.71909
ninja-ide/ninja-ide
927
248
195
GPL-3.0
9/5/2024, 5:11:18 PM (Europe/Amsterdam)
11,632
test_python_indenter.py
ninja-ide_ninja-ide/ninja_tests/gui/editor/test_python_indenter.py
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # any later version. # # NIN...
6,477
Python
.pyt
207
25.661836
82
0.540058
ninja-ide/ninja-ide
927
248
195
GPL-3.0
9/5/2024, 5:11:18 PM (Europe/Amsterdam)
11,633
conftest.py
andreafrancia_trash-cli/conftest.py
def pytest_configure(config): config.addinivalue_line( "markers", "slow: tests that uses the filesystem" )
123
Python
.py
4
25.75
57
0.689076
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,634
setup.py
andreafrancia_trash-cli/setup.py
# Copyright (C) 2007-2021 Andrea Francia Trivolzio(PV) Italy from setuptools import setup setup()
99
Python
.py
3
31.666667
60
0.810526
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,635
test_parsing_trashinfo_contents.py
andreafrancia_trash-cli/tests/test_trashcli_lib/test_parsing_trashinfo_contents.py
# Copyright (C) 2011 Andrea Francia Trivolzio(PV) Italy import unittest from datetime import datetime from tests.support.py2mock import MagicMock from trashcli.parse_trashinfo.parse_path import parse_path from trashcli.parse_trashinfo.parse_trashinfo import ParseTrashInfo from trashcli.parse_trashinfo.maybe_parse_del...
3,777
Python
.py
78
38.064103
79
0.631608
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,636
test_trash_dir_reader.py
andreafrancia_trash-cli/tests/test_trashcli_lib/test_trash_dir_reader.py
# Copyright (C) 2011 Andrea Francia Trivolzio(PV) Italy import unittest from tests.support.fakes.fake_file_system import FakeFileSystem from trashcli.lib.trash_dir_reader import TrashDirReader class TestTrashDirReader(unittest.TestCase): def setUp(self): self.fs = FakeFileSystem() self.trash_dir...
677
Python
.py
16
35.9375
63
0.689708
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,637
test_trash_dir_scanner.py
andreafrancia_trash-cli/tests/test_trashcli_lib/trash_dir_scanner/test_trash_dir_scanner.py
import unittest from tests.support.py2mock import Mock from trashcli.fstab.volume_listing import VolumesListing from trashcli.lib.dir_checker import DirChecker from trashcli.lib.user_info import SingleUserInfoProvider from trashcli.trash_dirs_scanner import TrashDirsScanner, trash_dir_found class TestTrashDirScanne...
1,153
Python
.py
24
40.041667
75
0.673197
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,638
test_top_trash_dir_rules.py
andreafrancia_trash-cli/tests/test_trashcli_lib/trash_dir_scanner/test_top_trash_dir_rules.py
import unittest from tests.support.py2mock import Mock, call from trashcli.trash_dirs_scanner import ( TopTrashDirRules, top_trash_dir_does_not_exist, top_trash_dir_invalid_because_not_sticky, top_trash_dir_invalid_because_parent_is_symlink, top_trash_dir_valid, ) class TestTopTrashDirRules(unitt...
2,033
Python
.py
47
33.404255
70
0.598174
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,639
test_user_info_provider.py
andreafrancia_trash-cli/tests/test_trashcli_lib/trash_dir_scanner/test_user_info_provider.py
import unittest from trashcli.lib.user_info import SingleUserInfoProvider class TestUserInfoProvider(unittest.TestCase): def setUp(self): self.provider = SingleUserInfoProvider() def test_getuid(self): info = self.provider.get_user_info({}, 123) assert [123] == [i.uid for i in info...
513
Python
.py
12
35.416667
61
0.650407
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,640
test_volumes_listing.py
andreafrancia_trash-cli/tests/test_trashcli_lib/test_fstab/test_volumes_listing.py
import unittest from trashcli.fstab.mount_points_listing import FakeMountPointsListing from trashcli.fstab.volume_listing import VolumesListingImpl class TestVolumesListingImpl(unittest.TestCase): def setUp(self): self.volumes_listing = VolumesListingImpl(FakeMountPointsListing(['/os-vol1', '/os-vol2']))...
1,211
Python
.py
21
50.714286
105
0.675446
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,641
test_trash_rm.py
andreafrancia_trash-cli/tests/test_rm/cmd/test_trash_rm.py
import unittest from six import StringIO from tests.support.py2mock import Mock from tests.support.asserts import assert_starts_with from trashcli.rm.rm_cmd import RmCmd class TestTrashRmCmdRun(unittest.TestCase): def setUp(self): self.volumes_listing = Mock() self.stderr = StringIO() s...
1,173
Python
.py
27
33.074074
87
0.610035
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,642
test_trash_rm_slow.py
andreafrancia_trash-cli/tests/test_rm/cmd/test_trash_rm_slow.py
import unittest import pytest from six import StringIO from tests.support.fakes.fake_trash_dir import FakeTrashDir from tests.support.dirs.my_path import MyPath from trashcli.fstab.volume_listing import NoVolumesListing from trashcli.rm.main import RealRmFileSystemReader from trashcli.rm.rm_cmd import RmCmd @pytest...
1,562
Python
.py
32
39.21875
79
0.647136
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,643
test_list_trash_info.py
andreafrancia_trash-cli/tests/test_rm/components/test_list_trash_info.py
import unittest import pytest from tests.support.fakes.fake_trash_dir import FakeTrashDir from tests.support.dirs.my_path import MyPath from trashcli.file_system_reader import FileSystemReader from trashcli.rm.list_trashinfo import ListTrashinfos @pytest.mark.slow class TestListTrashinfos(unittest.TestCase): de...
1,390
Python
.py
27
39.703704
84
0.615385
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,644
test_file_remover.py
andreafrancia_trash-cli/tests/test_rm/components/test_file_remover.py
import unittest from trashcli.rm.file_remover import FileRemover try: FileNotFoundError except NameError: FileNotFoundError = OSError # python 2 class TestFileRemover(unittest.TestCase): def test_remove_file_fails_when_file_does_not_exists(self): file_remover = FileRemover() self.asser...
422
Python
.py
11
32
71
0.731527
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,645
test_filter.py
andreafrancia_trash-cli/tests/test_rm/components/test_filter.py
import unittest from trashcli.rm.filter import Filter class TestFilter(unittest.TestCase): def test_a_star_matches_all(self): self.cmd = Filter('*') assert self.cmd.matches('foo') == True assert self.cmd.matches('bar') == True def test_basename_matches(self): self.cmd = Fil...
1,073
Python
.py
25
35.16
56
0.61256
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,646
test_empty_cmd_fs.py
andreafrancia_trash-cli/tests/test_empty/cmd/test_empty_cmd_fs.py
# Copyright (C) 2011-2022 Andrea Francia Bereguardo(PV) Italy import unittest import pytest from tests.support.py2mock import Mock from six import StringIO from tests.support.fakes.stub_volume_of import StubVolumeOf from tests.support.files import make_unreadable_dir, make_readable from tests.support.dirs.my_path imp...
2,008
Python
.py
45
37.488889
78
0.71202
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,647
test_empty_cmd_with_multiple_volumes_fs.py
andreafrancia_trash-cli/tests/test_empty/cmd/test_empty_cmd_with_multiple_volumes_fs.py
# Copyright (C) 2011-2022 Andrea Francia Bereguardo(PV) Italy import os import unittest from tests.support.py2mock import Mock from six import StringIO from tests.support.fakes.stub_volume_of import StubVolumeOf from tests.support.files import make_empty_file, require_empty_dir, make_dirs, \ set_sticky_bit from t...
2,782
Python
.py
60
38.4
80
0.685999
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,648
test_empty_cmd.py
andreafrancia_trash-cli/tests/test_empty/cmd/test_empty_cmd.py
# Copyright (C) 2011-2022 Andrea Francia Bereguardo(PV) Italy import unittest from typing import cast from tests.support.py2mock import Mock, call from six import StringIO from tests.support.fakes.stub_volume_of import StubVolumeOf from tests.support.fakes.mock_dir_reader import MockDirReader from trashcli.empty.dele...
2,778
Python
.py
59
39.050847
73
0.68155
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,649
test_user.py
andreafrancia_trash-cli/tests/test_empty/components/test_user.py
import unittest from tests.support.py2mock import Mock, call from trashcli.empty.user import User from trashcli.lib.my_input import HardCodedInput class TestUser(unittest.TestCase): def setUp(self): self.prepare_output_message = Mock(spec=[]) self.input = HardCodedInput() self.parse_repl...
1,042
Python
.py
26
28.730769
83
0.574827
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,650
test_make_parser.py
andreafrancia_trash-cli/tests/test_empty/components/test_make_parser.py
import unittest from typing import Union from trashcli.empty.parser import Parser class TestMakeParser(unittest.TestCase): def setUp(self): self.parser = Parser() def test(self): parsed = self.parse(args=['--trash-dir=foo']) assert ['foo'] == parsed.user_specified_trash_dirs de...
1,513
Python
.py
35
30.685714
79
0.571819
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,651
test_empty_end_to_end_with_argument.py
andreafrancia_trash-cli/tests/test_empty/components/test_empty_end_to_end_with_argument.py
import datetime import unittest import pytest from tests.support.fakes.fake_trash_dir import FakeTrashDir from tests.support.trash_dirs.list_trash_dir import list_trash_dir from tests.support.dirs.my_path import MyPath from tests.support.run.run_command import run_command @pytest.mark.slow class TestEmptyEndToEndWi...
2,033
Python
.py
40
43.95
85
0.674772
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,652
test_empty_end_to_end_with_trash_dir.py
andreafrancia_trash-cli/tests/test_empty/components/test_empty_end_to_end_with_trash_dir.py
import os import unittest from tests.support.run.run_command import run_command from tests.support.fakes.fake_trash_dir import FakeTrashDir from tests.support.files import make_file from tests.support.trash_dirs.list_trash_dir import list_trash_dir from tests.support.dirs.my_path import MyPath class TestEmptyEndToEn...
2,431
Python
.py
48
37.9375
77
0.549683
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,653
test_empty_end_to_end_interactive.py
andreafrancia_trash-cli/tests/test_empty/components/test_empty_end_to_end_interactive.py
import datetime import unittest import pytest from tests.support.fakes.fake_trash_dir import FakeTrashDir from tests.support.dirs.my_path import MyPath from tests.support.run.run_command import run_command @pytest.mark.slow class TestEmptyEndToEndInteractive(unittest.TestCase): def setUp(self): self.tmp...
1,374
Python
.py
32
35.03125
85
0.631381
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,654
test_clock.py
andreafrancia_trash-cli/tests/test_empty/components/test_clock.py
import datetime import unittest from tests.support.py2mock import Mock, call from trashcli.empty.clock import Clock class TestClock(unittest.TestCase): def setUp(self): self.errors = Mock(spec=['print_error']) def test_return_real_time(self): clock = Clock(lambda: 'now', self.errors) ...
1,037
Python
.py
22
38.363636
75
0.617149
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,655
test_prepare_output_message.py
andreafrancia_trash-cli/tests/test_empty/components/test_prepare_output_message.py
import unittest from trashcli.empty.prepare_output_message import prepare_output_message from trashcli.trash_dirs_scanner import trash_dir_found class TestPrepareOutputMessage(unittest.TestCase): def test_one_dir(self): trash_dirs = [ (trash_dir_found, ('/Trash', '/')), ] resu...
981
Python
.py
30
26.466667
72
0.622081
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,656
test_guard.py
andreafrancia_trash-cli/tests/test_empty/components/test_guard.py
import unittest from tests.support.py2mock import Mock, call from trashcli.empty.guard import Guard, UserIntention class TestGuard(unittest.TestCase): def setUp(self): self.user = Mock(spec=['do_you_wanna_empty_trash_dirs']) self.guard = Guard(self.user) def test_user_says_yes(self): ...
1,054
Python
.py
21
39.952381
68
0.632094
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,657
test_empty_end_to_end.py
andreafrancia_trash-cli/tests/test_empty/components/test_empty_end_to_end.py
import unittest from trashcli import trash from tests.support.help.help_reformatting import reformat_help_message from tests.support.dirs.my_path import MyPath from tests.support.run.run_command import run_command class TestEmptyEndToEnd(unittest.TestCase): def setUp(self): self.tmp_dir = MyPath.make_tem...
3,165
Python
.py
66
36.272727
87
0.561221
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,658
test_existing_file_remover.py
andreafrancia_trash-cli/tests/test_empty/components/test_existing_file_remover.py
import unittest from trashcli.empty.existing_file_remover import ExistingFileRemover class TestExistingFileRemover(unittest.TestCase): def test_remove_file_if_exists_fails_when_file_does_not_exists(self): file_remover = ExistingFileRemover() file_remover.remove_file_if_exists('/non/existing/path...
323
Python
.py
6
48.833333
73
0.792332
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,659
test_parse_reply.py
andreafrancia_trash-cli/tests/test_empty/components/test_parse_reply.py
import unittest from trashcli.empty.parse_reply import parse_reply class TestParseReply(unittest.TestCase): def test_y(self): assert parse_reply('y') == True def test_Y(self): assert parse_reply('Y') == True def test_n(self): assert parse_reply('n') == False def test_N(self...
438
Python
.py
13
27.538462
50
0.643541
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,660
capture_exit_code.py
andreafrancia_trash-cli/tests/support/capture_exit_code.py
def capture_exit_code(callable): try: callable() except SystemExit as e: return e.code return None
127
Python
.py
6
15.5
32
0.636364
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,661
project_root.py
andreafrancia_trash-cli/tests/support/project_root.py
import os def project_root(): this_file = os.path.realpath(__file__) support_dir = os.path.dirname(this_file) tests_dir = os.path.dirname(support_dir) return os.path.dirname(tests_dir)
203
Python
.py
6
29.833333
44
0.702564
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,662
make_scripts.py
andreafrancia_trash-cli/tests/support/make_scripts.py
import os from textwrap import dedent from tests.support.project_root import project_root from trashcli.fs import write_file, make_file_executable def make_scripts(): return Scripts(write_file, make_file_executable) class Scripts: def __init__(self, write_file, make_file_executable): self.write_fil...
1,131
Python
.py
27
34.740741
79
0.673675
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,663
py2mock.py
andreafrancia_trash-cli/tests/support/py2mock.py
import sys if sys.version_info > (3, 3): from unittest.mock import * else: from mock import *
103
Python
.py
5
17.8
31
0.690722
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,664
capture_error.py
andreafrancia_trash-cli/tests/support/capture_error.py
def capture_error(callable): try: callable() except Exception as e: return e return None
117
Python
.py
6
13.833333
28
0.621622
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,665
files.py
andreafrancia_trash-cli/tests/support/files.py
import os import shutil from trashcli.fs import has_sticky_bit from trashcli.fs import mkdirs from trashcli.fs import write_file def mkdir_p(path): if not os.path.isdir(path): os.makedirs(path) def make_empty_file(path): make_file(path, '') def make_file(filename, contents=''): make_parent_fo...
2,099
Python
.py
71
25.338028
58
0.70348
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,666
dummy_clock.py
andreafrancia_trash-cli/tests/support/put/dummy_clock.py
import datetime from trashcli.put.clock import PutClock class FixedClock(PutClock): def __init__(self, now_value=None): self.now_value = now_value def set_clock(self, now_value): self.now_value = now_value def now(self): # type: () -> datetime.datetime return self.now_value ...
492
Python
.py
14
29.642857
51
0.66879
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,667
fake_random.py
andreafrancia_trash-cli/tests/support/put/fake_random.py
from typing import List from trashcli.put.core.int_generator import IntGenerator class FakeRandomInt(IntGenerator): def __init__(self, values, # type: List[int] ): self.values = values def new_int(self, _a, _b): return self.values.pop(0) def set_reply(...
364
Python
.py
11
25.272727
56
0.612069
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,668
my_file_not_found_error.py
andreafrancia_trash-cli/tests/support/put/my_file_not_found_error.py
try: FileNotFoundError except NameError: FileNotFoundError = OSError MyFileNotFoundError = FileNotFoundError
118
Python
.py
5
20.8
39
0.848214
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,669
inode.py
andreafrancia_trash-cli/tests/support/put/fake_fs/inode.py
from enum import Enum from tests.support.put.fake_fs.ent import Ent from trashcli.put.check_cast import check_cast class Stickiness(Enum): sticky = "sticky" not_sticky = "not_sticky" class INode: def __init__(self, entity, # type: Ent mode, # type: int ...
765
Python
.py
22
26.681818
78
0.609524
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,670
entry.py
andreafrancia_trash-cli/tests/support/put/fake_fs/entry.py
from typing import Union from tests.support.put.fake_fs.inode import INode from tests.support.put.fake_fs.symlink import SymLink Entry = Union[INode, SymLink]
161
Python
.py
4
38.75
53
0.832258
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,671
fake_fs.py
andreafrancia_trash-cli/tests/support/put/fake_fs/fake_fs.py
import errno import os from typing import cast from tests.support.fakes.fake_volume_of import FakeVolumeOf from tests.support.put.fake_fs.directory import Directory from tests.support.put.fake_fs.directory import make_inode_dir from tests.support.put.fake_fs.ent import Ent from tests.support.put.fake_fs.entry import ...
8,944
Python
.py
228
30.416667
80
0.6178
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,672
file.py
andreafrancia_trash-cli/tests/support/put/fake_fs/file.py
from tests.support.put.fake_fs.ent import Ent class File(Ent): def __init__(self, content): self.content = content def getsize(self): return len(self.content)
186
Python
.py
6
25.5
45
0.672316
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,673
symlink.py
andreafrancia_trash-cli/tests/support/put/fake_fs/symlink.py
class SymLink: def __init__(self, dest): self.dest = dest def __repr__(self): return "SymLink(%r)" % self.dest
136
Python
.py
5
21.2
40
0.553846
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,674
failing_fake_fs.py
andreafrancia_trash-cli/tests/support/put/fake_fs/failing_fake_fs.py
import os.path from tests.support.put.fake_fs.fake_fs import FakeFs class FailingOnAtomicWriteFakeFs(FakeFs): def __init__(self): super(FailingOnAtomicWriteFakeFs, self).__init__() self._atomic_write_can_fail = False self._atomic_write_failure_stop = None def fail_atomic_create_unless...
1,837
Python
.py
41
32.560976
76
0.577117
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,675
directory.py
andreafrancia_trash-cli/tests/support/put/fake_fs/directory.py
from collections import OrderedDict from typing import Optional from typing import Union from tests.support.put.fake_fs.ent import Ent from tests.support.put.fake_fs.inode import INode from tests.support.put.fake_fs.inode import Stickiness from tests.support.put.fake_fs.symlink import SymLink from tests.support.put.fa...
2,736
Python
.py
64
34.40625
79
0.630508
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,676
help_reformatting.py
andreafrancia_trash-cli/tests/support/help/help_reformatting.py
def reformat_help_message(help_message): # type: (str) -> str return _collapse_usage_paragraph(_normalize_options(help_message)) def _normalize_options(help_message): # type: (str) -> str return help_message.replace('optional arguments', 'options') def _collapse_usage_paragraph(help_message): # type: (st...
898
Python
.py
24
31.291667
70
0.634994
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,677
restore_file_fixture.py
andreafrancia_trash-cli/tests/support/restore/restore_file_fixture.py
import os from tests.support.fakes.fake_trash_dir import trashinfo_content_default_date from tests.support.files import make_file class RestoreFileFixture: def __init__(self, XDG_DATA_HOME): self.XDG_DATA_HOME = XDG_DATA_HOME def having_a_trashed_file(self, path): self.make_file('%s/info/foo...
820
Python
.py
18
38.388889
77
0.677582
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,678
has_been_restored_matcher.py
andreafrancia_trash-cli/tests/support/restore/has_been_restored_matcher.py
from typing import NamedTuple, Union from trashcli.fs import PathExists def has_been_restored(fs): # type: (PathExists) -> HasBeenRestoredBaseMatcher return HasBeenRestoredBaseMatcher(fs, HasBeenRestoredExpectations()) def has_not_been_restored( fs): # type: (PathExists) -> HasBeenRestoredBaseMatcher...
4,317
Python
.py
95
36.421053
83
0.656317
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,679
restore_user.py
andreafrancia_trash-cli/tests/support/restore/restore_user.py
import sys from io import StringIO from typing import Dict from tests.support.run.cmd_result import CmdResult from trashcli.fstab.volumes import Volumes from trashcli.lib.my_input import HardCodedInput from trashcli.restore.file_system import FakeReadCwd, FileReader, \ RestoreReadFileSystem, \ RestoreWriteFile...
2,922
Python
.py
68
29.279412
71
0.565752
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,680
fake_restore_fs.py
andreafrancia_trash-cli/tests/support/restore/fake_restore_fs.py
import os from tests.support.put.fake_fs.fake_fs import FakeFs from tests.support.restore.a_trashed_file import ATrashedFile from trashcli.fs import PathExists from trashcli.fstab.volumes import Volumes, FakeVolumes from trashcli.put.format_trash_info import format_trashinfo from trashcli.restore.file_system import Li...
2,819
Python
.py
57
40.54386
80
0.664845
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,681
a_trashed_file.py
andreafrancia_trash-cli/tests/support/restore/a_trashed_file.py
from typing import NamedTuple def a_trashed_file(trashed_from, info_file, backup_copy): return ATrashedFile(trashed_from=str(trashed_from), info_file=str(info_file), backup_copy=str(backup_copy)) class ATrashedFile(NamedTuple('ATrashedFile', [ ('trashed_from',...
391
Python
.py
11
28
57
0.62766
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,682
set_dev_version.py
andreafrancia_trash-cli/tests/support/tools/set_dev_version.py
from __future__ import print_function import argparse import sys from six import text_type from tests.support.project_root import project_root from tests.support.tools.adapters.real_cal import RealCal from tests.support.tools.bump_cmd import trash_py_file from tests.support.tools.version_from_date import dev_version...
1,761
Python
.py
38
37.684211
78
0.651285
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,683
bump_main.py
andreafrancia_trash-cli/tests/support/tools/bump_main.py
import os import sys from tests.support.project_root import project_root from tests.support.tools.adapters.real_cal import RealCal from tests.support.tools.bump_cmd import BumpCmd from trashcli.put.fs.real_fs import RealFs def main(): print(project_root()) bump_cmd = BumpCmd(os.system, print, RealFs(), RealC...
378
Python
.py
10
35.3
61
0.772603
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,684
version_from_date.py
andreafrancia_trash-cli/tests/support/tools/version_from_date.py
from __future__ import print_function def version_from_date(today): return "0.%s.%s.%s" % (today.year % 100, today.month, today.day) def dev_version_from_date(ref, sha, today): new_version = '%s.dev0+git.%s.%s' % (version_from_date(today), ref, sha) ...
339
Python
.py
8
32.625
76
0.568807
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,685
bump_cmd.py
andreafrancia_trash-cli/tests/support/tools/bump_cmd.py
import os from tests.support.tools.version_from_date import version_from_date from tests.support.tools.version_saver import VersionSaver def trash_py_file(root): return os.path.join(root, 'trashcli', 'trash.py') class BumpCmd: def __init__(self, os_system, print_func, fs, cal): self.system = os_sys...
1,069
Python
.py
22
39.045455
129
0.626204
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,686
version_saver.py
andreafrancia_trash-cli/tests/support/tools/version_saver.py
import re class VersionSaver: def __init__(self, fs): self.fs = fs def save_new_version(self, new_version, path): content = self.fs.read(path) new_content = re.sub(r'^version(\s*)=.*', 'version = \'%s\'' % new_version, content,...
416
Python
.py
11
25
62
0.487562
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,687
real_cal.py
andreafrancia_trash-cli/tests/support/tools/adapters/real_cal.py
import datetime from tests.support.tools.core.cal import Cal class RealCal(Cal): def today(self): return datetime.datetime.today()
146
Python
.py
5
25.2
44
0.76087
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,688
cal.py
andreafrancia_trash-cli/tests/support/tools/core/cal.py
from abc import abstractmethod from trashcli.compat import Protocol class Cal(Protocol): @abstractmethod def today(self): raise NotImplementedError
167
Python
.py
6
23.666667
36
0.791139
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,689
my_path.py
andreafrancia_trash-cli/tests/support/dirs/my_path.py
import os import shutil import tempfile from tests.support.files import make_sticky_dir from trashcli.put.fs.real_fs import RealFs from trashcli.put.fs.fs import list_all class MyPath(str): def __truediv__(self, other_path): return self.path_join(other_path) def __div__(self, other_path): r...
1,513
Python
.py
40
30.675
80
0.628944
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,690
list_file_in_dir.py
andreafrancia_trash-cli/tests/support/dirs/list_file_in_dir.py
import os def list_files_in_dir(path): if not os.path.isdir(path): return [] return os.listdir(path)
119
Python
.py
5
19.2
31
0.660714
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,691
temp_dir.py
andreafrancia_trash-cli/tests/support/dirs/temp_dir.py
import pytest from tests.support.dirs.my_path import MyPath @pytest.fixture def temp_dir(): temp_dir = MyPath.make_temp_dir() yield temp_dir temp_dir.clean_up()
176
Python
.py
7
22
45
0.740964
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,692
list_file_in_subdir.py
andreafrancia_trash-cli/tests/support/dirs/list_file_in_subdir.py
from tests.support.dirs.list_file_in_dir import list_files_in_dir def list_files_in_subdir(path, subdir): return ["%s/%s" % (subdir, f) for f in list_files_in_dir(path / subdir)]
185
Python
.py
3
58.666667
76
0.711111
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,693
parse_date.py
andreafrancia_trash-cli/tests/support/trashinfo/parse_date.py
from datetime import datetime def parse_date(date_string, # type: str ): # type: (...) -> datetime for format in ['%Y-%m-%d', '%Y-%m-%dT%H:%M:%S', '%Y-%m-%d %H:%M:%S', ]: try: return datetime.strptime(date_string, format...
429
Python
.py
12
24.583333
58
0.477108
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,694
fake_file_system.py
andreafrancia_trash-cli/tests/support/fakes/fake_file_system.py
# Copyright (C) 2011-2021 Andrea Francia Bereguardo(PV) Italy class FakeFileSystem: def __init__(self): self.files = {} self.dirs = {} def contents_of(self, path): return self.files[path] def exists(self, path): return path in self.files def entries_if_dir_exists(self,...
647
Python
.py
17
31.117647
75
0.6384
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,695
mock_dir_reader.py
andreafrancia_trash-cli/tests/support/fakes/mock_dir_reader.py
import os from typing import List from trashcli.lib.dir_reader import DirReader class MockDirReader(DirReader): def __init__(self): self.root = {} def entries_if_dir_exists(self, path): # type: (str) -> List[str] return list(self.pick_dir(path).keys()) def exists(self, path): # type:...
976
Python
.py
27
27.703704
82
0.578723
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,696
fake_is_mount.py
andreafrancia_trash-cli/tests/support/fakes/fake_is_mount.py
import os from typing import List class FakeIsMount: def __init__(self, mount_points, # type: List[str] ): self.mount_points = mount_points def is_mount(self, path): if path == '/': return True path = os.path.normpath(path) if pat...
553
Python
.py
18
22.222222
49
0.569811
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,697
stub_volume_of.py
andreafrancia_trash-cli/tests/support/fakes/stub_volume_of.py
from trashcli.fstab.volume_of import VolumeOf class StubVolumeOf(VolumeOf): def volume_of(self, path): return "volume_of %s" % path
146
Python
.py
4
32
45
0.728571
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,698
fake_volume_of.py
andreafrancia_trash-cli/tests/support/fakes/fake_volume_of.py
import os from typing import List from tests.support.fakes.fake_is_mount import FakeIsMount from trashcli.fstab.volume_of import VolumeOf from trashcli.fstab.volume_of_impl import VolumeOfImpl class FakeVolumeOf(VolumeOf): def __init__(self): # type: () -> None super(FakeVolumeOf, self).__init__() ...
572
Python
.py
14
35.785714
72
0.708861
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)
11,699
fake_trash_dir.py
andreafrancia_trash-cli/tests/support/fakes/fake_trash_dir.py
import datetime import os import uuid from tests.support.files import does_not_exist from tests.support.files import is_a_symlink_to_a_dir from tests.support.files import make_sticky_dir from tests.support.files import make_unsticky_dir from trashcli.put.format_trash_info import format_original_location from tests.su...
4,581
Python
.py
100
38.02
89
0.665392
andreafrancia/trash-cli
3,580
179
62
GPL-2.0
9/5/2024, 5:11:26 PM (Europe/Amsterdam)