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,900 | main.py | andreafrancia_trash-cli/trashcli/restore/main.py | # Copyright (C) 2007-2023 Andrea Francia Trivolzio(PV) Italy
import os
import sys
import trashcli.trash
from .file_system import RealRestoreReadFileSystem, \
RealRestoreWriteFileSystem, RealReadCwd, RealFileReader, \
RealListingFileSystem
from .info_dir_searcher import InfoDirSearcher
from .info_files import I... | 1,447 | Python | .py | 37 | 30.891892 | 62 | 0.686567 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,901 | restore_logger.py | andreafrancia_trash-cli/trashcli/restore/restore_logger.py | from trashcli.compat import Protocol
class RestoreLogger(Protocol):
def warning(self, message):
raise NotImplementedError
| 136 | Python | .py | 4 | 29.5 | 36 | 0.792308 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,902 | file_system.py | andreafrancia_trash-cli/trashcli/restore/file_system.py | import os
from abc import ABCMeta, abstractmethod
from trashcli.compat import Protocol
import six
from trashcli import fs
from trashcli.fs import FsMethods, RealListFilesInDir, ListFilesInDir, \
RealContentsOf
class FileReader(Protocol):
@abstractmethod
def contents_of(self, path):
raise NotImpl... | 2,250 | Python | .py | 65 | 29.338462 | 72 | 0.722455 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,903 | handler.py | andreafrancia_trash-cli/trashcli/restore/handler.py | from __future__ import print_function
from __future__ import unicode_literals
from typing import List
from trashcli.lib.my_input import Input
from trashcli.restore.file_system import ReadCwd
from trashcli.restore.output import Output
from trashcli.restore.output_recorder import OutputRecorder
from trashcli.restore.re... | 2,187 | Python | .py | 45 | 33.933333 | 83 | 0.575176 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,904 | user_info.py | andreafrancia_trash-cli/trashcli/lib/user_info.py | # Copyright (C) 2007-2023 Andrea Francia Trivolzio(PV) Italy
from __future__ import absolute_import
import pwd
from typing import Union
from trashcli.lib.trash_dirs import (
home_trash_dir_path_from_env,
home_trash_dir_path_from_home)
class UserInfo:
def __init__(self, home_trash_dir_paths, uid):
... | 860 | Python | .py | 22 | 33.136364 | 72 | 0.706522 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,905 | dir_checker.py | andreafrancia_trash-cli/trashcli/lib/dir_checker.py | from __future__ import absolute_import
import os
class DirChecker:
@staticmethod
def is_dir(path):
return os.path.isdir(path)
| 145 | Python | .py | 6 | 20 | 38 | 0.720588 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,906 | my_input.py | andreafrancia_trash-cli/trashcli/lib/my_input.py | from abc import abstractmethod, ABCMeta
import six
from six.moves import input as _my_input
@six.add_metaclass(ABCMeta)
class Input:
@abstractmethod
def read_input(self, prompt): # type: (str) -> str
raise NotImplementedError
class RealInput(Input):
def read_input(self, prompt): # type: (str)... | 1,040 | Python | .py | 30 | 27.966667 | 55 | 0.651652 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,907 | trash_dir_reader.py | andreafrancia_trash-cli/trashcli/lib/trash_dir_reader.py | from __future__ import absolute_import
import os
from trashcli.lib.dir_reader import DirReader
class TrashDirReader:
def __init__(self,
dir_reader, # type: DirReader
):
self.dir_reader = dir_reader
def list_orphans(self, path):
info_dir = os.path.join(path... | 919 | Python | .py | 21 | 34.142857 | 73 | 0.613917 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,908 | print_version.py | andreafrancia_trash-cli/trashcli/lib/print_version.py | # Copyright (C) 2007-2023 Andrea Francia Trivolzio(PV) Italy
from __future__ import absolute_import
from __future__ import print_function
import os
import six
from typing import NamedTuple
class PrintVersionArgs(
NamedTuple('PrintVersionArgs', [
('argv0', str),
])):
def program_name(self):
... | 774 | Python | .py | 22 | 29.045455 | 69 | 0.665317 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,909 | trash_dirs.py | andreafrancia_trash-cli/trashcli/lib/trash_dirs.py | # Copyright (C) 2007-2023 Andrea Francia Trivolzio(PV) Italy
from __future__ import absolute_import
import os
from trashcli.fstab.volume_of import VolumeOf
def home_trash_dir_path_from_env(environ):
if 'XDG_DATA_HOME' in environ:
return ['%(XDG_DATA_HOME)s/Trash' % environ]
elif 'HOME' in environ:
... | 926 | Python | .py | 24 | 32.833333 | 60 | 0.662921 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,910 | exit_codes.py | andreafrancia_trash-cli/trashcli/lib/exit_codes.py | # Copyright (C) 2007-2023 Andrea Francia Trivolzio(PV) Italy
from __future__ import absolute_import
import os
# Error codes (from os on *nix, hard coded for Windows):
EX_OK = getattr(os, 'EX_OK', 0)
EX_USAGE = getattr(os, 'EX_USAGE', 64)
EX_IOERR = getattr(os, 'EX_IOERR', 74)
| 279 | Python | .py | 7 | 38.571429 | 60 | 0.714815 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,911 | environ.py | andreafrancia_trash-cli/trashcli/lib/environ.py | import os
from typing import Dict
Environ = Dict[str, str]
def cast_environ(env,
): # type: (...) -> Environ
if env == os.environ:
return env
else:
raise ValueError("env must be os.environ")
| 237 | Python | .py | 9 | 20.333333 | 50 | 0.59375 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,912 | logger.py | andreafrancia_trash-cli/trashcli/lib/logger.py | # Copyright (C) 2007-2023 Andrea Francia Trivolzio(PV) Italy
import logging
my_logger = logging.getLogger('trashcli.trash')
my_logger.setLevel(logging.WARNING)
my_logger.addHandler(logging.StreamHandler())
| 207 | Python | .py | 5 | 40.2 | 60 | 0.820896 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,913 | path_of_backup_copy.py | andreafrancia_trash-cli/trashcli/lib/path_of_backup_copy.py | from __future__ import absolute_import
import os
def path_of_backup_copy(trashinfo_path):
trash_dir = os.path.dirname(os.path.dirname(trashinfo_path))
basename = os.path.basename(trashinfo_path)[:-len('.trashinfo')]
return os.path.join(trash_dir, 'files', basename)
| 281 | Python | .py | 6 | 43.333333 | 68 | 0.738971 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,914 | enum_repr.py | andreafrancia_trash-cli/trashcli/lib/enum_repr.py | from enum import Enum
def repr_for_enum(enum): # type: (Enum) -> str
return "%s.%s" % (type(enum).__name__, enum.name)
| 126 | Python | .py | 3 | 39 | 53 | 0.619835 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,915 | my_permission_error.py | andreafrancia_trash-cli/trashcli/lib/my_permission_error.py | from typing import Type
def get_permission_error_class(): # type: () -> Type[Exception]
try:
return PermissionError
except NameError:
return OSError
MyPermissionError = get_permission_error_class()
| 227 | Python | .py | 7 | 27.428571 | 64 | 0.717593 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,916 | dir_reader.py | andreafrancia_trash-cli/trashcli/lib/dir_reader.py | from __future__ import absolute_import
from trashcli.compat import Protocol
from trashcli.fs import EntriesIfDirExists, PathExists, RealEntriesIfDirExists, \
RealExists
class DirReader(
EntriesIfDirExists,
PathExists,
Protocol,
):
pass
class RealDirReader(RealEntriesIfDirExists, RealExists):
... | 328 | Python | .py | 12 | 23.833333 | 81 | 0.806452 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,917 | file_remover.py | andreafrancia_trash-cli/trashcli/rm/file_remover.py | from trashcli.fs import FsMethods
class FileRemover:
remove_file2 = FsMethods().remove_file2
remove_file_if_exists = FsMethods().remove_file_if_exists
| 161 | Python | .py | 4 | 36.75 | 61 | 0.780645 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,918 | filter.py | andreafrancia_trash-cli/trashcli/rm/filter.py | # Copyright (C) 2011-2021 Andrea Francia Bereguardo(PV) Italy
import fnmatch
import os
class Filter:
def __init__(self, pattern):
self.pattern = pattern
def matches(self, original_location):
basename = os.path.basename(original_location)
subject = original_location if self.pattern[0] ... | 399 | Python | .py | 10 | 34.6 | 75 | 0.712435 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,919 | cleanable_trashcan.py | andreafrancia_trash-cli/trashcli/rm/cleanable_trashcan.py | # Copyright (C) 2011-2021 Andrea Francia Bereguardo(PV) Italy
from trashcli.rm.file_remover import FileRemover
from trashcli.lib.path_of_backup_copy import path_of_backup_copy
class CleanableTrashcan:
def __init__(self,
file_remover, # type: FileRemover
):
self._file_remo... | 584 | Python | .py | 12 | 41.25 | 65 | 0.697715 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,920 | rm_cmd.py | andreafrancia_trash-cli/trashcli/rm/rm_cmd.py | # Copyright (C) 2011-2021 Andrea Francia Bereguardo(PV) Italy
from trashcli.compat import Protocol
from trashcli.fs import ContentsOf
from trashcli.lib.dir_checker import DirChecker
from trashcli.lib.dir_reader import DirReader
from trashcli.lib.user_info import SingleUserInfoProvider
from trashcli.rm.cleanable_trashc... | 3,066 | Python | .py | 67 | 31.522388 | 151 | 0.567839 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,921 | list_trashinfo.py | andreafrancia_trash-cli/trashcli/rm/list_trashinfo.py | # Copyright (C) 2011-2021 Andrea Francia Bereguardo(PV) Italy
import os
from abc import abstractmethod
from trashcli.compat import Protocol
from trashcli.fs import ContentsOf
from trashcli.lib.dir_reader import DirReader
from trashcli.lib.trash_dir_reader import TrashDirReader
from trashcli.parse_trashinfo.parse_path ... | 1,612 | Python | .py | 37 | 34.891892 | 76 | 0.677296 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,922 | main.py | andreafrancia_trash-cli/trashcli/rm/main.py | # Copyright (C) 2011-2021 Andrea Francia Bereguardo(PV) Italy
import os
import sys
from trashcli.fs import RealExists, RealIsStickyDir, RealIsSymLink, \
RealContentsOf, RealEntriesIfDirExists
from trashcli.fstab.volume_listing import RealVolumesListing
from trashcli.rm.rm_cmd import RmCmd, RmFileSystemReader
def... | 963 | Python | .py | 24 | 27.916667 | 69 | 0.61588 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,923 | parse_trashinfo.py | andreafrancia_trash-cli/trashcli/parse_trashinfo/parse_trashinfo.py | from __future__ import absolute_import
import datetime
from six.moves.urllib.parse import unquote
def do_nothing(*argv, **argvk): pass
class ParseTrashInfo:
def __init__(self,
on_deletion_date=do_nothing,
on_invalid_date=do_nothing,
on_path=do_nothing):
... | 1,116 | Python | .py | 27 | 28.851852 | 76 | 0.560074 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,924 | maybe_parse_deletion_date.py | andreafrancia_trash-cli/trashcli/parse_trashinfo/maybe_parse_deletion_date.py | # Copyright (C) 2007-2023 Andrea Francia Trivolzio(PV) Italy
from __future__ import absolute_import
from trashcli.parse_trashinfo.basket import Basket
from trashcli.parse_trashinfo.parse_trashinfo import ParseTrashInfo
def maybe_parse_deletion_date(contents):
result = Basket(unknown_date)
parser = ParseTrash... | 557 | Python | .py | 13 | 38.692308 | 67 | 0.74397 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,925 | parse_original_location.py | andreafrancia_trash-cli/trashcli/parse_trashinfo/parse_original_location.py | from __future__ import absolute_import
import os
from trashcli.parse_trashinfo.parse_path import parse_path
def parse_original_location(contents, volume_path):
path = parse_path(contents)
return os.path.join(volume_path, path)
| 239 | Python | .py | 6 | 36.833333 | 58 | 0.790393 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,926 | parse_deletion_date.py | andreafrancia_trash-cli/trashcli/parse_trashinfo/parse_deletion_date.py | from __future__ import absolute_import
from trashcli.parse_trashinfo.parse_trashinfo import ParseTrashInfo
from trashcli.parse_trashinfo.basket import Basket
def parse_deletion_date(contents):
result = Basket()
parser = ParseTrashInfo(on_deletion_date=result.collect)
parser.parse_trashinfo(contents)
... | 344 | Python | .py | 8 | 39.625 | 67 | 0.810811 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,927 | parse_path.py | andreafrancia_trash-cli/trashcli/parse_trashinfo/parse_path.py | from __future__ import absolute_import
from six.moves.urllib.parse import unquote
from trashcli.parse_trashinfo.parser_error import ParseError
def parse_path(contents):
for line in contents.split('\n'):
if line.startswith('Path='):
return unquote(line[len('Path='):])
raise ParseError('Un... | 341 | Python | .py | 8 | 37.625 | 60 | 0.723404 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,928 | basket.py | andreafrancia_trash-cli/trashcli/parse_trashinfo/basket.py | from __future__ import absolute_import
class Basket:
def __init__(self, initial_value=None):
self.collected = initial_value
def collect(self, value):
self.collected = value
| 200 | Python | .py | 6 | 27.833333 | 43 | 0.680628 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,929 | prepare_output_message.py | andreafrancia_trash-cli/trashcli/empty/prepare_output_message.py | from trashcli.trash_dirs_scanner import trash_dir_found
def prepare_output_message(trash_dirs):
result = []
if trash_dirs:
result.append("Would empty the following trash directories:")
for event, args in trash_dirs:
if event == trash_dir_found:
trash_dir, volume = a... | 512 | Python | .py | 13 | 30.846154 | 69 | 0.607646 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,930 | description.py | andreafrancia_trash-cli/trashcli/empty/description.py | def description(program_name, printer):
printer.usage('Usage: %s [days]' % program_name)
printer.summary('Purge trashed files.')
printer.options(
" --version show program's version number and exit",
" -h, --help show this help message and exit")
printer.bug_reporting()
| 307 | Python | .py | 7 | 38.285714 | 63 | 0.663333 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,931 | errors.py | andreafrancia_trash-cli/trashcli/empty/errors.py | class Errors:
def __init__(self, program_name, err):
self.program_name = program_name
self.err = err
def print_error(self, msg):
self.err.write(format_error_msg(self.program_name, msg))
def format_error_msg(program_name, msg):
return "%s: %s\n" % (program_name, msg)
| 306 | Python | .py | 8 | 32.375 | 64 | 0.644068 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,932 | user.py | andreafrancia_trash-cli/trashcli/empty/user.py | from trashcli.lib.my_input import Input
class User:
def __init__(self,
prepare_output_message,
input, # type: Input
parse_reply):
self.prepare_output_message = prepare_output_message
self.input = input
self.parse_reply = parse_reply
d... | 490 | Python | .py | 12 | 31.333333 | 78 | 0.631579 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,933 | print_time_action.py | andreafrancia_trash-cli/trashcli/empty/print_time_action.py | # Copyright (C) 2007-2023 Andrea Francia Trivolzio(PV) Italy
from __future__ import print_function
from typing import NamedTuple
from trashcli.lib.environ import Environ
class PrintTimeArgs(
NamedTuple('PrintTimeArgs', [
('environ', Environ),
])):
pass
class PrintTimeAction:
def __init__(s... | 618 | Python | .py | 18 | 27.5 | 74 | 0.652614 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,934 | delete_according_date.py | andreafrancia_trash-cli/trashcli/empty/delete_according_date.py | from trashcli.empty.clock import Clock
from trashcli.empty.older_than import older_than
from trashcli.fs import ContentsOf
from trashcli.parse_trashinfo.parse_deletion_date import parse_deletion_date
class DeleteAccordingDate:
def __init__(self,
reader, # type: ContentsOf
clock,... | 952 | Python | .py | 23 | 30.695652 | 76 | 0.609071 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,935 | emptier.py | andreafrancia_trash-cli/trashcli/empty/emptier.py | # Copyright (C) 2022 Andrea Francia Bereguardo(PV) Italy
from typing import Iterable
from trashcli.empty.console import Console
from trashcli.empty.delete_according_date import DeleteAccordingDate
from trashcli.empty.existing_file_remover import ExistingFileRemover
from trashcli.lib.path_of_backup_copy import path_of_... | 2,328 | Python | .py | 47 | 35.489362 | 104 | 0.576011 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,936 | clock.py | andreafrancia_trash-cli/trashcli/empty/clock.py | from __future__ import absolute_import
import datetime
class Clock:
def __init__(self, real_now, errors):
self.real_now = real_now
self.errors = errors
def get_now_value(self, environ):
if 'TRASH_DATE' in environ:
try:
return datetime.datetime.strptime(env... | 642 | Python | .py | 16 | 26.25 | 72 | 0.508039 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,937 | console.py | andreafrancia_trash-cli/trashcli/empty/console.py | from typing import TextIO
from trashcli.empty.errors import format_error_msg
class Console:
def __init__(self, program_name, out,
err): # type: (str, TextIO, TextIO) -> None
self.program_name = program_name
self.out = out
self.err = err
def print_cannot_remove_error... | 655 | Python | .py | 16 | 33.6875 | 64 | 0.637658 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,938 | older_than.py | andreafrancia_trash-cli/trashcli/empty/older_than.py | def older_than(days_ago, now_value, deletion_date):
from datetime import timedelta
limit_date = now_value - timedelta(days=days_ago)
return deletion_date < limit_date
| 179 | Python | .py | 4 | 40.75 | 53 | 0.742857 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,939 | file_system_dir_reader.py | andreafrancia_trash-cli/trashcli/empty/file_system_dir_reader.py | from trashcli.fs import RealExists, RealEntriesIfDirExists
from trashcli.lib.dir_reader import DirReader
class FileSystemDirReader(DirReader,
RealEntriesIfDirExists,
RealExists,
):
pass
| 270 | Python | .py | 7 | 25.571429 | 58 | 0.613027 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,940 | empty_cmd.py | andreafrancia_trash-cli/trashcli/empty/empty_cmd.py | import os
from datetime import datetime
from typing import TextIO, Callable
from trashcli.empty.clock import Clock
from trashcli.empty.console import Console
from trashcli.empty.empty_action import EmptyAction, EmptyActionArgs
from trashcli.empty.errors import Errors
from trashcli.empty.existing_file_remover import Ex... | 3,298 | Python | .py | 73 | 32.657534 | 75 | 0.607331 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,941 | empty_action.py | andreafrancia_trash-cli/trashcli/empty/empty_action.py | from typing import NamedTuple, List
from trashcli.empty.clock import Clock
from trashcli.empty.console import Console
from trashcli.empty.delete_according_date import (
DeleteAccordingDate,
)
from trashcli.empty.emptier import Emptier
from trashcli.empty.existing_file_remover import ExistingFileRemover
from trashc... | 2,991 | Python | .py | 66 | 33.075758 | 75 | 0.601576 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,942 | parser.py | andreafrancia_trash-cli/trashcli/empty/parser.py | import argparse
from typing import List
from trashcli.empty.empty_action import EmptyActionArgs
from trashcli.empty.print_time_action import PrintTimeArgs
from trashcli.lib.environ import Environ
from trashcli.lib.print_version import PrintVersionArgs
from trashcli.shell_completion import TRASH_DIRS, add_argument_to
... | 3,538 | Python | .py | 77 | 29.064935 | 86 | 0.514765 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,943 | main.py | andreafrancia_trash-cli/trashcli/empty/main.py | # Copyright (C) 2011-2022 Andrea Francia Bereguardo(PV) Italy
import os
import sys
from datetime import datetime
from trashcli.compat import Protocol
from trashcli import trash
from trashcli.empty.empty_cmd import EmptyCmd
from trashcli.fs import RealContentsOf, ContentsOf
from .existing_file_remover import ExistingF... | 1,366 | Python | .py | 31 | 34.096774 | 67 | 0.675207 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,944 | guard.py | andreafrancia_trash-cli/trashcli/empty/guard.py | from typing import Iterable, NamedTuple
from trashcli.empty.user import User
from trashcli.trash_dirs_scanner import TrashDir
UserIntention = NamedTuple('UserIntention',
[('ok_to_empty', bool),
('trash_dirs', Iterable[TrashDir])])
class Guard:
def __init__... | 1,477 | Python | .py | 31 | 34.483871 | 70 | 0.561892 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,945 | top_trash_dir_rules_file_system_reader.py | andreafrancia_trash-cli/trashcli/empty/top_trash_dir_rules_file_system_reader.py | from trashcli.fs import RealExists, RealIsStickyDir, RealIsSymLink
from trashcli.trash_dirs_scanner import TopTrashDirRules
class RealTopTrashDirRulesReader(
TopTrashDirRules.Reader,
RealExists,
RealIsStickyDir,
RealIsSymLink,
):
pass
| 257 | Python | .py | 9 | 25.111111 | 66 | 0.825203 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,946 | mount_points_listing.py | andreafrancia_trash-cli/trashcli/fstab/mount_points_listing.py | # Copyright (C) 2009-2020 Andrea Francia Trivolzio(PV) Italy
import os
from abc import ABCMeta, abstractmethod
import six
@six.add_metaclass(ABCMeta)
class MountPointsListing:
@abstractmethod
def list_mount_points(self):
raise NotImplementedError()
class RealMountPointsListing(MountPointsListing):
... | 1,823 | Python | .py | 49 | 30.204082 | 72 | 0.670461 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,947 | volume_listing.py | andreafrancia_trash-cli/trashcli/fstab/volume_listing.py | import os
from abc import ABCMeta, abstractmethod
import six
from trashcli.fstab.mount_points_listing import MountPointsListing, \
RealMountPointsListing
@six.add_metaclass(ABCMeta)
class VolumesListing:
@abstractmethod
def list_volumes(self, environ): # type (dict) -> Iterable[str]
raise NotIm... | 1,361 | Python | .py | 36 | 30.527778 | 73 | 0.6822 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,948 | volume_of_impl.py | andreafrancia_trash-cli/trashcli/fstab/volume_of_impl.py | import os
from trashcli.fstab.volume_of import VolumeOf
class VolumeOfImpl(VolumeOf):
def __init__(self, ismount, abspath):
self.ismount = ismount
self.abspath = abspath
def volume_of(self, path):
path = self.abspath(path)
while path != os.path.dirname(path):
if s... | 431 | Python | .py | 13 | 25.076923 | 45 | 0.620773 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,949 | volume_of.py | andreafrancia_trash-cli/trashcli/fstab/volume_of.py | from abc import abstractmethod
from trashcli.compat import Protocol
class VolumeOf(Protocol):
@abstractmethod
def volume_of(self, path):
raise NotImplementedError()
| 184 | Python | .py | 6 | 26.5 | 36 | 0.782857 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,950 | volumes.py | andreafrancia_trash-cli/trashcli/fstab/volumes.py | from abc import ABCMeta
import six
import os
from trashcli.fstab.mount_points_listing import MountPointsListing, \
RealMountPointsListing
from trashcli.fstab.volume_of import VolumeOf
from trashcli.fstab.real_volume_of import RealVolumeOf
@six.add_metaclass(ABCMeta)
class Volumes(VolumeOf, MountPointsListing):
... | 1,961 | Python | .py | 53 | 29.471698 | 69 | 0.665607 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,951 | real_volume_of.py | andreafrancia_trash-cli/trashcli/fstab/real_volume_of.py | import os
from trashcli.fstab.volume_listing import RealIsMount
from trashcli.fstab.volume_of import VolumeOf
from trashcli.fstab.volume_of_impl import VolumeOfImpl
class RealVolumeOf(VolumeOf):
def __init__(self):
self.impl = VolumeOfImpl(RealIsMount(), os.path.abspath)
def volume_of(self, path):
... | 360 | Python | .py | 9 | 35.888889 | 64 | 0.766571 | andreafrancia/trash-cli | 3,580 | 179 | 62 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,952 | 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 | .pyt | 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,953 | 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 | .pyt | 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,954 | setup.py | cobbler_cobbler/setup.py | #!/usr/bin/env python3
"""
Setup module for Cobbler
"""
import codecs
import glob as _glob
import os
import pwd
import shutil
import subprocess
import sys
import time
from configparser import ConfigParser
from distutils.command.build import build as _build
from typing import Any, Dict, List
from setuptools import Co... | 35,181 | Python | .py | 813 | 32.220172 | 103 | 0.505821 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,955 | .pylintrc | cobbler_cobbler/.pylintrc | [MASTER]
# Specify a score threshold to be exceeded before program exits with error.
fail-under=9.5
# List of plugins (as comma separated values of python module names) to load,
# usually to register additional checkers.
load-plugins=pylint.extensions.no_self_use
[MESSAGES CONTROL]
# Disable the message, report, ca... | 654 | Python | .py | 15 | 42.2 | 79 | 0.797788 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,956 | copyright | cobbler_cobbler/debian/copyright | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: cobbler
Upstream-Contact: Enno Gotthold <enno@4seul.de>
Source: https://github.com/cobbler/cobbler
Files: *
Copyright: 2006-2022 The Cobbler Team
License: GPL-2+
# TODO: Add individual copyright of all files having explicit spdx... | 329 | Python | .py | 8 | 39.875 | 74 | 0.808777 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,957 | conf.py | cobbler_cobbler/docs/conf.py | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# https://www.sphinx-doc.org/en/master/config
# -- Path setup -----------------------------------------------------------... | 6,553 | Python | .py | 167 | 36.60479 | 84 | 0.653779 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,958 | conftest.py | cobbler_cobbler/tests/conftest.py | """
Fixtures that are shared between all tests inside the testsuite.
"""
import os
import pathlib
import shutil
from contextlib import contextmanager
from pathlib import Path
from typing import Callable
import pytest
from cobbler.api import CobblerAPI
from cobbler.items.distro import Distro
from cobbler.items.image ... | 9,257 | Python | .py | 251 | 30.442231 | 135 | 0.658509 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,959 | tftpgen_test.py | cobbler_cobbler/tests/tftpgen_test.py | """
Tests that validate the functionality of the module that is responsible for generating the TFTP boot tree.
"""
import glob
import os
import pathlib
import shutil
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Tuple, Union
import pytest
from cobbler import enums, tftpgen
from cobbler.api import Cobb... | 17,579 | Python | .py | 437 | 35.336384 | 167 | 0.69973 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,960 | configgen_test.py | cobbler_cobbler/tests/configgen_test.py | """
Tests that validate the functionality of the module that is responsible for generating configuration data.
"""
import os
from typing import Any, Callable, Generator
import pytest
from cobbler.api import CobblerAPI
from cobbler.configgen import ConfigGen
from cobbler.items.distro import Distro
from cobbler.items.... | 3,796 | Python | .py | 93 | 35.677419 | 116 | 0.711717 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,961 | templar_test.py | cobbler_cobbler/tests/templar_test.py | """
Tests that validate the functionality of the module that is responsible for abstracting access to the different
template rendering engines that Cobbler supports.
"""
import pytest
from cobbler.api import CobblerAPI
from cobbler.cexceptions import CX
from cobbler.templar import Templar
@pytest.fixture(scope="fun... | 2,265 | Python | .py | 66 | 27.757576 | 111 | 0.641544 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,962 | module_loader_test.py | cobbler_cobbler/tests/module_loader_test.py | """
Tests that validate the functionality of the module that is responsible for dynamically loading Python modules for
Cobbler. This includes both custom plugins and built-in ones.
"""
from typing import Any, Callable, List
import pytest
from cobbler import module_loader
from cobbler.api import CobblerAPI
from cobbl... | 7,124 | Python | .py | 207 | 26.062802 | 114 | 0.604472 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,963 | grub_test.py | cobbler_cobbler/tests/grub_test.py | """
Tests that validate the functionality of the module that is responsible for GRUB functionality.
"""
from typing import Any, Optional
import pytest
from cobbler import grub
from tests.conftest import does_not_raise
@pytest.mark.parametrize(
"input_file_location,expected_output,expected_exception",
[
... | 1,180 | Python | .py | 32 | 30.78125 | 95 | 0.632778 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,964 | template_api_test.py | cobbler_cobbler/tests/template_api_test.py | """
Tests that validate the functionality of the module that is responsible for extending Cheetah to work with Cobbler.
"""
import pytest
from cobbler.template_api import CobblerTemplate
class TestCobblerTemplate:
def test_compile(self):
# Arrange
# Act
compiled_template = CobblerTempla... | 2,692 | Python | .py | 74 | 27.5 | 115 | 0.594605 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,965 | validate_test.py | cobbler_cobbler/tests/validate_test.py | """
Tests that validate the functionality of the module that is responsible for validating data before it is consumed by
the application.
"""
import uuid
from ipaddress import AddressValueError, NetmaskValueError
from typing import Any
import pytest
from cobbler import enums, validate
from cobbler.api import Cobbler... | 6,785 | Python | .py | 219 | 25.109589 | 116 | 0.630485 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,966 | enums_test.py | cobbler_cobbler/tests/enums_test.py | """
Tests that validate the functionality of the module that is responsible for defining constants and parsing them from
given data.
"""
from typing import Any, Union
import pytest
from cobbler import enums
from tests.conftest import does_not_raise
@pytest.mark.parametrize(
"test_architecture,test_raise",
... | 3,443 | Python | .py | 102 | 26.95098 | 116 | 0.636254 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,967 | autoinstallation_manager_test.py | cobbler_cobbler/tests/autoinstallation_manager_test.py | """
Tests that validate the functionality of the module that is responsible for generating auto-installation control files.
"""
from unittest.mock import MagicMock
import pytest
from cobbler import autoinstall_manager
from cobbler.api import CobblerAPI
from cobbler.items.distro import Distro
from cobbler.items.profi... | 4,703 | Python | .py | 86 | 51.930233 | 171 | 0.749023 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,968 | serializer_test.py | cobbler_cobbler/tests/serializer_test.py | """
Tests that validate the functionality of the module that is responsible for abstracting access to the item
(de)serializers.
"""
from typing import TYPE_CHECKING
import pytest
from cobbler import serializer
from cobbler.api import CobblerAPI
if TYPE_CHECKING:
from pytest_mock import MockerFixture
@pytest.f... | 4,256 | Python | .py | 106 | 35.45283 | 106 | 0.73411 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,969 | system_test.py | cobbler_cobbler/tests/items/system_test.py | """
Test module that asserts that Cobbler System functionality is working as expected.
"""
from typing import TYPE_CHECKING, Any, Callable, List, Optional
import pytest
from cobbler import enums
from cobbler.api import CobblerAPI
from cobbler.cexceptions import CX
from cobbler.items.distro import Distro
from cobbler... | 31,407 | Python | .py | 962 | 26.110187 | 113 | 0.628745 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,970 | image_test.py | cobbler_cobbler/tests/items/image_test.py | """
Tests that validate the functionality of the module that is responsible for providing image related functionality.
"""
from typing import TYPE_CHECKING, Any, Callable
import pytest
from cobbler import enums
from cobbler.api import CobblerAPI
from cobbler.items.image import Image
from cobbler.settings import Sett... | 7,716 | Python | .py | 238 | 26.281513 | 114 | 0.656678 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,971 | distro_test.py | cobbler_cobbler/tests/items/distro_test.py | """
Test module to confirm that the Cobbler Item Distro is working as expected.
"""
import os
import pathlib
from typing import TYPE_CHECKING, Any, Callable
import pytest
from cobbler import enums
from cobbler.api import CobblerAPI
from cobbler.items.distro import Distro
from cobbler.settings import Settings
from co... | 15,487 | Python | .py | 474 | 26.799578 | 112 | 0.648259 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,972 | inmemory_test.py | cobbler_cobbler/tests/items/inmemory_test.py | """
Tests that validate the functionality of the module that is responsible for lazy loading items.
"""
import os
import pathlib
from typing import Callable
import pytest
from cobbler.api import CobblerAPI
from cobbler.cobbler_collections import manager
from cobbler.items.distro import Distro
from cobbler.items.imag... | 7,835 | Python | .py | 185 | 35.789189 | 109 | 0.662649 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,973 | inheritance_test.py | cobbler_cobbler/tests/items/inheritance_test.py | """
Test that verifies that the inheritance concept in Cobbler works for all data types.
"""
from typing import Callable
from cobbler.api import CobblerAPI
from cobbler.items.distro import Distro
from cobbler.items.profile import Profile
# pylint: disable=protected-access
def test_resolved_dict_deduplication(
... | 2,906 | Python | .py | 75 | 34.28 | 84 | 0.696625 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,974 | cache_test.py | cobbler_cobbler/tests/items/cache_test.py | """
Tests that validate the functionality of the module that is responsible for caching the results of the to_dict method.
"""
from typing import Any, Callable, List, Sequence
import pytest
from cobbler.api import CobblerAPI
from cobbler.cexceptions import CX
from cobbler.items.abstract.base_item import BaseItem
fro... | 18,660 | Python | .py | 534 | 29.181648 | 118 | 0.671483 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,975 | menu_test.py | cobbler_cobbler/tests/items/menu_test.py | """
Tests that validate the functionality of the module that is responsible for providing menu related functionality.
"""
from typing import TYPE_CHECKING
import pytest
from cobbler import enums
from cobbler.api import CobblerAPI
from cobbler.items.menu import Menu
from cobbler.settings import Settings
if TYPE_CHEC... | 3,461 | Python | .py | 93 | 29.344086 | 113 | 0.639796 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,976 | base_item_test.py | cobbler_cobbler/tests/items/base_item_test.py | """
Tests that validate the functionality of the module that is responsible for providing basic item functionality.
"""
import copy
from typing import Any, List, Optional
import pytest
from cobbler import enums
from cobbler.api import CobblerAPI
from cobbler.items.abstract.base_item import BaseItem
from tests.conft... | 5,103 | Python | .py | 149 | 28.067114 | 111 | 0.654253 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,977 | bootable_item_test.py | cobbler_cobbler/tests/items/bootable_item_test.py | """
Test module that asserts that generic Cobbler BootableItem functionality is working as expected.
"""
import os
from typing import TYPE_CHECKING, Any, Callable, Dict, Optional
import pytest
from cobbler import enums
from cobbler.api import CobblerAPI
from cobbler.items.abstract.bootable_item import BootableItem
f... | 9,929 | Python | .py | 291 | 28.103093 | 120 | 0.65281 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,978 | network_interface_test.py | cobbler_cobbler/tests/items/network_interface_test.py | """
Tests that validate the functionality of the module that is responsible for providing network interface related
functionality.
"""
import logging
from ipaddress import AddressValueError
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Union
import pytest
from cobbler import enums
from cobbler.api imp... | 20,961 | Python | .py | 631 | 27.255151 | 111 | 0.65741 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,979 | inheritable_item_test.py | cobbler_cobbler/tests/items/inheritable_item_test.py | """
Test module that asserts that generic Cobbler InheritableItem functionality is working as expected.
"""
from typing import Any, Callable, Optional
import pytest
from cobbler.api import CobblerAPI
from cobbler.items.distro import Distro
from cobbler.items.image import Image
from cobbler.items.menu import Menu
fro... | 5,892 | Python | .py | 184 | 26.695652 | 104 | 0.678773 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,980 | repo_test.py | cobbler_cobbler/tests/items/repo_test.py | """
Tests that validate the functionality of the module that is responsible for providing repository related functionality.
"""
from typing import TYPE_CHECKING, Any
import pytest
from cobbler import enums
from cobbler.api import CobblerAPI
from cobbler.items.repo import Repo
from cobbler.settings import Settings
f... | 7,971 | Python | .py | 252 | 25.130952 | 119 | 0.642492 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,981 | profile_test.py | cobbler_cobbler/tests/items/profile_test.py | """
Test module to validate the functionality of the Cobbler Profile item.
"""
from typing import TYPE_CHECKING, Any, Callable, Dict, List
import pytest
from cobbler import enums
from cobbler.api import CobblerAPI
from cobbler.cexceptions import CX
from cobbler.items.distro import Distro
from cobbler.items.image imp... | 21,606 | Python | .py | 648 | 27.310185 | 112 | 0.641817 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,982 | sync_test.py | cobbler_cobbler/tests/performance/sync_test.py | """
Test module to assert the performance of "cobbler sync".
"""
from typing import Any, Callable, Dict, Tuple
import pytest
from pytest_benchmark.fixture import ( # type: ignore[reportMissingTypeStubs]
BenchmarkFixture,
)
from cobbler.api import CobblerAPI
from cobbler.items.distro import Distro
from cobbler.i... | 1,888 | Python | .py | 66 | 22.454545 | 103 | 0.642541 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,983 | get_autoinstall_test.py | cobbler_cobbler/tests/performance/get_autoinstall_test.py | """
Test module to assert the performance of retrieving an auto-installation file.
"""
from typing import Any, Callable, Dict, Tuple
import pytest
from pytest_benchmark.fixture import ( # type: ignore[reportMissingTypeStubs]
BenchmarkFixture,
)
from cobbler import autoinstall_manager
from cobbler.api import Cob... | 2,204 | Python | .py | 65 | 28.538462 | 114 | 0.697696 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,984 | item_copy_test.py | cobbler_cobbler/tests/performance/item_copy_test.py | """
Test module to assert the performance of copying items.
"""
from typing import Any, Callable, Dict, Tuple
import pytest
from pytest_benchmark.fixture import ( # type: ignore[reportMissingTypeStubs]
BenchmarkFixture,
)
from cobbler.api import CobblerAPI
from cobbler.items.distro import Distro
from cobbler.it... | 2,157 | Python | .py | 79 | 21.088608 | 83 | 0.625363 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,985 | deserialize_test.py | cobbler_cobbler/tests/performance/deserialize_test.py | """
Test module to assert the performance of deserializing the object tree.
"""
from typing import Any, Callable, Dict, Tuple
import pytest
from pytest_benchmark.fixture import ( # type: ignore[reportMissingTypeStubs]
BenchmarkFixture,
)
from cobbler.api import CobblerAPI
from cobbler.items.distro import Distro... | 2,122 | Python | .py | 72 | 23.138889 | 79 | 0.643768 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,986 | make_pxe_menu_test.py | cobbler_cobbler/tests/performance/make_pxe_menu_test.py | """
Test module to assert the performance of creating the PXE menu.
"""
from typing import Any, Callable, Dict, Tuple
import pytest
from pytest_benchmark.fixture import ( # type: ignore[reportMissingTypeStubs]
BenchmarkFixture,
)
from cobbler.api import CobblerAPI
from cobbler.items.distro import Distro
from co... | 1,942 | Python | .py | 68 | 22.382353 | 89 | 0.64232 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,987 | item_rename_test.py | cobbler_cobbler/tests/performance/item_rename_test.py | """
Test module to assert the performance of renaming items.
"""
from typing import Any, Callable, Dict, Tuple
import pytest
from pytest_benchmark.fixture import ( # type: ignore[reportMissingTypeStubs]
BenchmarkFixture,
)
from cobbler.api import CobblerAPI
from cobbler.items.distro import Distro
from cobbler.i... | 2,170 | Python | .py | 79 | 21.253165 | 84 | 0.627706 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,988 | item_remove_test.py | cobbler_cobbler/tests/performance/item_remove_test.py | """
Test module to assert the performance of removing items.
"""
from typing import Any, Callable, Dict, Tuple
import pytest
from pytest_benchmark.fixture import ( # type: ignore[reportMissingTypeStubs]
BenchmarkFixture,
)
from cobbler.api import CobblerAPI
from cobbler.items.distro import Distro
from cobbler.i... | 2,184 | Python | .py | 79 | 21.43038 | 94 | 0.628285 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,989 | item_edit_test.py | cobbler_cobbler/tests/performance/item_edit_test.py | """
Test module to assert the performance of editing items.
"""
from typing import Any, Callable, Dict, Tuple
import pytest
from pytest_benchmark.fixture import ( # type: ignore[reportMissingTypeStubs]
BenchmarkFixture,
)
from cobbler.api import CobblerAPI
from cobbler.items.distro import Distro
from cobbler.it... | 2,359 | Python | .py | 90 | 19.788889 | 83 | 0.614533 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,990 | start_test.py | cobbler_cobbler/tests/performance/start_test.py | """
Test module to assert the performance of the startup of the daemon.
"""
from typing import Any, Callable, Dict, Tuple
import pytest
from pytest_benchmark.fixture import ( # type: ignore[reportMissingTypeStubs]
BenchmarkFixture,
)
from cobbler.api import CobblerAPI
from cobbler.items.distro import Distro
fro... | 2,151 | Python | .py | 71 | 24 | 90 | 0.647002 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,991 | __init__.py | cobbler_cobbler/tests/performance/__init__.py | """
Module that contains a helper class which supports the performance testsuite. This is not a pytest style fixture but
rather related pytest-benchmark. Thus, the different style in usage.
"""
from typing import Any, Callable
from cobbler.api import CobblerAPI
from cobbler.items.distro import Distro
from cobbler.ite... | 6,293 | Python | .py | 164 | 28.743902 | 120 | 0.598036 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,992 | item_add_test.py | cobbler_cobbler/tests/performance/item_add_test.py | """
Test module to assert the performance of adding different kinds of items.
"""
from typing import Any, Callable, Dict, Tuple
import pytest
from pytest_benchmark.fixture import ( # type: ignore[reportMissingTypeStubs]
BenchmarkFixture,
)
from cobbler.api import CobblerAPI
from cobbler.items.distro import Dist... | 7,949 | Python | .py | 275 | 22.534545 | 94 | 0.632857 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,993 | conftest.py | cobbler_cobbler/tests/cobbler_collections/conftest.py | """
Fixtures that are common for testing the cobbler collections.
"""
import pytest
from cobbler.api import CobblerAPI
from cobbler.cobbler_collections.manager import CollectionManager
@pytest.fixture()
def collection_mgr(cobbler_api: CobblerAPI) -> CollectionManager:
"""
Fixture that provides access to the... | 488 | Python | .py | 13 | 34.692308 | 80 | 0.789809 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,994 | distro_collection_test.py | cobbler_cobbler/tests/cobbler_collections/distro_collection_test.py | """
Tests that validate the functionality of the module that is responsible for managing the list of distros.
"""
import os.path
from typing import Callable
import pytest
from cobbler.api import CobblerAPI
from cobbler.cexceptions import CX
from cobbler.cobbler_collections import distros
from cobbler.cobbler_collect... | 7,754 | Python | .py | 239 | 27.857741 | 105 | 0.702978 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,995 | __init__.py | cobbler_cobbler/tests/cobbler_collections/__init__.py | """
Tests cannot be written with a generic Collection. Thus we always need a specific one. See the base collection as an
abstract class when being under test!
"""
| 163 | Python | .py | 4 | 39.75 | 116 | 0.786164 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,996 | system_collection_test.py | cobbler_cobbler/tests/cobbler_collections/system_collection_test.py | """
Tests that validate the functionality of the module that is responsible for managing the list of systems.
"""
from typing import Any, Callable, Dict
import pytest
from cobbler.api import CobblerAPI
from cobbler.cexceptions import CX
from cobbler.cobbler_collections import systems
from cobbler.cobbler_collections... | 23,517 | Python | .py | 675 | 28.037037 | 116 | 0.623611 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,997 | mtab_test.py | cobbler_cobbler/tests/utils/mtab_test.py | import os
from cobbler.utils import mtab
def test_get_mtab():
# Arrange
# Act
result = mtab.get_mtab()
# Assert
assert isinstance(result, list)
def test_get_file_device_path():
# Arrange
test_symlink = "/tmp/test_symlink"
os.symlink("/foobar/test", test_symlink)
# Act
res... | 670 | Python | .py | 26 | 21 | 52 | 0.65873 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,998 | process_management_test.py | cobbler_cobbler/tests/utils/process_management_test.py | """
Tests that validate the functionality of the module that is responsible for process management in Cobbler.
"""
from typing import TYPE_CHECKING
from cobbler.utils import process_management
if TYPE_CHECKING:
from pytest_mock import MockerFixture
def test_is_systemd():
# Arrange
# Act
result = p... | 2,799 | Python | .py | 86 | 26.767442 | 106 | 0.692937 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |
11,999 | input_converters_test.py | cobbler_cobbler/tests/utils/input_converters_test.py | """
Tests that validate the functionality of the module that is responsible for input conversion.
"""
from typing import Any
import pytest
from cobbler.utils import input_converters
from tests.conftest import does_not_raise
@pytest.mark.parametrize(
"test_input,expected_result,expected_exception",
[
... | 3,017 | Python | .py | 87 | 28.54023 | 93 | 0.607695 | cobbler/cobbler | 2,597 | 653 | 318 | GPL-2.0 | 9/5/2024, 5:11:26 PM (Europe/Amsterdam) |