Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to use docformatter #760

Merged
merged 3 commits into from
Jan 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions config/dpkg/changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dfvfs (20240115-1) unstable; urgency=low
dfvfs (20240128-1) unstable; urgency=low

* Auto-generated

-- Log2Timeline maintainers <[email protected]> Mon, 15 Jan 2024 05:37:59 +0100
-- Log2Timeline maintainers <[email protected]> Sun, 28 Jan 2024 13:31:12 +0100
16 changes: 8 additions & 8 deletions dependencies.ini
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@ minimum_version: 2.5
rpm_name: python3-idna
version_property: __version__

[pycaes]
dpkg_name: libcaes-python3
l2tbinaries_name: libcaes
minimum_version: 20240114
pypi_name: libcaes-python
rpm_name: libcaes-python3
version_property: get_version()

[pybde]
dpkg_name: libbde-python3
l2tbinaries_name: libbde
Expand All @@ -41,6 +33,14 @@ pypi_name: libbde-python
rpm_name: libbde-python3
version_property: get_version()

[pycaes]
dpkg_name: libcaes-python3
l2tbinaries_name: libcaes
minimum_version: 20240114
pypi_name: libcaes-python
rpm_name: libcaes-python3
version_property: get_version()

[pyewf]
dpkg_name: libewf-python3
l2tbinaries_name: libewf
Expand Down
8 changes: 4 additions & 4 deletions dfvfs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
"""Digital Forensics Virtual File System (dfVFS).

dfVFS, or Digital Forensics Virtual File System, is a Python module
that provides read-only access to file-system objects from various
storage media types and file formats.
dfVFS, or Digital Forensics Virtual File System, is a Python module that
provides read-only access to file-system objects from various storage media
types and file formats.
"""

__version__ = '20240115'
__version__ = '20240128'
14 changes: 10 additions & 4 deletions dfvfs/analyzer/analyzer_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,24 @@ def __init__(self):

@property
def format_categories(self):
"""set[str]: format categories, such as archive file or file system.
"""Retrieves the format categories.

The format categories are defined in definitions.FORMAT_CATEGORIES.

Returns:
set[str]: format categories, such as archive file or file system.
"""
# pylint: disable=no-member
return self.FORMAT_CATEGORIES

@property
def type_indicator(self):
"""str: type indicator."""
# pylint: disable=no-member
return self.TYPE_INDICATOR
"""Retrieves the type indicator.

Returns:
str: type indicator or None if not available.
"""
return getattr(self, 'TYPE_INDICATOR', None)

def AnalyzeFileObject(self, file_object): # pylint: disable=useless-type-doc
"""Retrieves the format specification.
Expand Down
6 changes: 5 additions & 1 deletion dfvfs/analyzer/specification.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ def __init__(self):

@property
def specifications(self):
"""generator[FormatSpecification]: format specifications."""
"""Retrieves the format specifications.

Returns:
generator[FormatSpecification]: format specifications.
"""
return iter(self._format_specifications.values())

def AddNewSpecification(self, identifier):
Expand Down
6 changes: 3 additions & 3 deletions dfvfs/credentials/keychain.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
"""The path specification key chain.

The key chain is used to manage credentials for path specifications.
E.g. BitLocker Drive Encryption (BDE) encrypted volumes can require a
credential (e.g. password) to access the unencrypted data (unlock).
The key chain is used to manage credentials for path specifications. E.g.
BitLocker Drive Encryption (BDE) encrypted volumes can require a credential
(e.g. password) to access the unencrypted data (unlock).
"""

from dfvfs.credentials import manager
Expand Down
2 changes: 1 addition & 1 deletion dfvfs/file_io/apfs_file_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


class APFSFile(file_io.FileIO):
"""File input/output (IO) object using pyfsapfs.file_entry"""
"""File input/output (IO) object using pyfsapfs.file_entry."""

def __init__(self, resolver_context, path_spec):
"""Initializes a file input/output (IO) object.
Expand Down
6 changes: 3 additions & 3 deletions dfvfs/file_io/compressed_stream_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ def __init__(self, resolver_context, path_spec):
def _Close(self):
"""Closes the file-like object.

If the file-like object was passed in the init function
the compressed stream file-like object does not control
the file-like object and should not actually close it.
If the file-like object was passed in the init function the compressed
stream file-like object does not control the file-like object and should not
actually close it.
"""
self._compressed_data = b''
self._file_object = None
Expand Down
13 changes: 6 additions & 7 deletions dfvfs/file_io/data_range_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@
class DataRange(file_io.FileIO):
"""File input/output (IO) object that maps an in-file data range.

The data range object allows to expose a single partition within
a full disk image as a separate file-like object by mapping
the data range (offset and size) of the volume on top of the full disk
image.
The data range object allows to expose a single partition within a full disk
image as a separate file-like object by mapping the data range (offset and
size) of the volume on top of the full disk image.
"""

def __init__(self, resolver_context, path_spec):
Expand All @@ -33,9 +32,9 @@ def __init__(self, resolver_context, path_spec):
def _Close(self):
"""Closes the file-like object.

If the file-like object was passed in the init function
the data range file-like object does not control the file-like object
and should not actually close it.
If the file-like object was passed in the init function the data range file-
like object does not control the file-like object and should not actually
close it.
"""
self._file_object = None
self._range_offset = -1
Expand Down
6 changes: 3 additions & 3 deletions dfvfs/file_io/encoded_stream_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ def __init__(self, resolver_context, path_spec):
def _Close(self):
"""Closes the file-like object.

If the file-like object was passed in the init function
the encoded stream file-like object does not control
the file-like object and should not actually close it.
If the file-like object was passed in the init function the encoded stream
file-like object does not control the file-like object and should not
actually close it.
"""
self._decoder = None
self._decoded_data = b''
Expand Down
6 changes: 3 additions & 3 deletions dfvfs/file_io/encrypted_stream_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ def __init__(self, resolver_context, path_spec):
def _Close(self):
"""Closes the file-like object.

If the file-like object was passed in the init function
the encrypted stream file-like object does not control
the file-like object and should not actually close it.
If the file-like object was passed in the init function the encrypted stream
file-like object does not control the file-like object and should not
actually close it.
"""
self._decrypter = None
self._decrypted_data = b''
Expand Down
2 changes: 1 addition & 1 deletion dfvfs/file_io/ext_file_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


class EXTFile(file_io.FileIO):
"""File input/output (IO) object using pyfsext.file_entry"""
"""File input/output (IO) object using pyfsext.file_entry."""

def __init__(self, resolver_context, path_spec):
"""Initializes a file input/output (IO) object.
Expand Down
2 changes: 1 addition & 1 deletion dfvfs/file_io/fat_file_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


class FATFile(file_io.FileIO):
"""File input/output (IO) object using pyfsfat.file_entry"""
"""File input/output (IO) object using pyfsfat.file_entry."""

def __init__(self, resolver_context, path_spec):
"""Initializes a file input/output (IO) object.
Expand Down
30 changes: 25 additions & 5 deletions dfvfs/file_io/gzip_file_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,47 @@ class GzipFile(file_object_io.FileObjectIO):

@property
def comments(self):
"""list(str): comments in the gzip file."""
"""Retrieves the comments.

Returns:
list[str]: comments of the members.
"""
return [member.comment for member in self._file_object.members]

@property
def modification_times(self):
"""list(int): modification times stored in the gzip file."""
"""Retrieves the modification times.

Returns:
list[str]: modification times of the members.
"""
return [member.modification_time for member in self._file_object.members]

@property
def original_filenames(self):
"""list(str): original filenames stored in the gzip file."""
"""Retrieves the original filenames.

Returns:
list[str]: original filenames of the members.
"""
return [member.original_filename for member in self._file_object.members]

@property
def operating_systems(self):
"""list(int): operating system values stored in the gzip file."""
"""Retrieves the operating system values.

Returns:
list[str]: operating system values of the members.
"""
return [member.operating_system for member in self._file_object.members]

@property
def uncompressed_data_size(self):
"""int: uncompressed data size."""
"""Retrieves the uncompressed data size.

Returns:
int: uncompressed data size.
"""
return self._file_object.uncompressed_data_size

def _OpenFileObject(self, path_spec):
Expand Down
2 changes: 1 addition & 1 deletion dfvfs/file_io/hfs_file_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


class HFSFile(file_io.FileIO):
"""File input/output (IO) object using pyfshfs.file_entry"""
"""File input/output (IO) object using pyfshfs.file_entry."""

def __init__(self, resolver_context, path_spec):
"""Initializes a file input/output (IO) object.
Expand Down
2 changes: 1 addition & 1 deletion dfvfs/file_io/xfs_file_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


class XFSFile(file_io.FileIO):
"""File input/output (IO) object using pyfsxfs.file_entry"""
"""File input/output (IO) object using pyfsxfs.file_entry."""

def __init__(self, resolver_context, path_spec):
"""Initializes a file input/output (IO) object.
Expand Down
12 changes: 10 additions & 2 deletions dfvfs/helpers/source_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ def __init__(self, path_spec):

@property
def type_indicator(self):
"""str: path specification type indicator."""
"""Retrieves the type indicator.

Returns:
str: path specification type indicator.
"""
return self.path_spec.type_indicator

def GetSubNodeByLocation(self, location):
Expand Down Expand Up @@ -165,7 +169,11 @@ def __init__(self):

@property
def locked_scan_nodes(self):
"""list[SourceScanNode]: locked scan nodes."""
"""Retrieves the locked scan nodes.

Returns:
list[SourceScanNode]: locked scan nodes.
"""
return list(self._locked_scan_nodes.values())

def AddScanNode(self, path_spec, parent_scan_node):
Expand Down
6 changes: 5 additions & 1 deletion dfvfs/lib/gzipfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,11 @@ def __init__(self):

@property
def members(self):
"""list(GzipMember): members in the gzip file."""
"""Retrieves the members in the file.

Returns:
list[GzipMember]: members in the file.
"""
return list(self._members_by_end_offset.values())

def _GetMemberForOffset(self, offset):
Expand Down
18 changes: 15 additions & 3 deletions dfvfs/vfs/apfs_container_file_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ def _GetSubFileEntries(self):

@property
def name(self):
"""str: name of the file entry, which does not include the full path."""
"""Retrieves the name.

Return:
str: name of the file entry, which does not include the full path.
"""
if self._name is None:
self._name = ''

Expand All @@ -98,7 +102,11 @@ def name(self):

@property
def size(self):
"""int: size of the file entry in bytes or None if not available."""
"""Retrieves the size.

Returns:
int: size of the file entry in bytes or None if not available.
"""
if self._fsapfs_volume is None:
return None

Expand All @@ -107,7 +115,11 @@ def size(self):

@property
def sub_file_entries(self):
"""generator[APFSContainerFileEntry]: sub file entries."""
"""Retrieves sub file entries.

Returns:
generator[APFSContainerFileEntry]: sub file entries.
"""
return self._GetSubFileEntries()

def GetAPFSVolume(self):
Expand Down
6 changes: 5 additions & 1 deletion dfvfs/vfs/directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,9 @@ def _EntriesGenerator(self):

@property
def entries(self):
"""generator[PathSpec]: path specifications of the directory entries."""
"""Retrieves directory entries.

Returns:
generator[PathSpec]: path specifications of the directory entries.
"""
return self._EntriesGenerator()
Loading
Loading