Skip to content

Commit

Permalink
Changes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
Onager committed Jul 26, 2018
1 parent eb897c4 commit 4920467
Show file tree
Hide file tree
Showing 24 changed files with 42 additions and 36 deletions.
2 changes: 1 addition & 1 deletion plaso/analysis/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def GetPlugins(cls):
"""Retrieves the registered analysis plugin classes.
Yields:
tuple: contains:
tuple: containing:
str: name of the plugin
type: plugin class
Expand Down
2 changes: 1 addition & 1 deletion plaso/cli/image_export_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def _GetSourceFileSystem(self, source_path_spec, resolver_context=None):
resolver_context (dfvfs.Context): resolver context.
Returns:
tuple: contains:
tuple: containing:
dfvfs.FileSystem: file system.
dfvfs.PathSpec: mount point path specification that refers
Expand Down
2 changes: 1 addition & 1 deletion plaso/cli/tool_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def _GetParserPresetsInformation(self):
"""Retrieves the parser presets information.
Returns:
list[tuple]: contains:
list[tuple]: containing:
str: parser preset name
str: parsers names corresponding to the preset
Expand Down
2 changes: 1 addition & 1 deletion plaso/engine/tagging_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def _ParseDefinitions(self, tagging_file_path):
tagging_file_path (str): path to the tagging file.
Yields:
tuple: contains:
tuple: containing:
str: label name.
list[efilter.query.Query]: efilter queries.
Expand Down
3 changes: 2 additions & 1 deletion plaso/filters/filter_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ def _ParseEntry(self, entry):
"""Parses a single filter entry.
Args:
entry: YAML string that defines a single object filter entry.
entry (dict[str, dict(str, object)]): dictionary containing one more
filter rules and associated metadata.
Raises:
WrongPlugin: if the entry cannot be parsed.
Expand Down
6 changes: 3 additions & 3 deletions plaso/formatters/asl.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ def GetMessages(self, unused_formatter_mediator, event):
"""Determines the formatted message strings for an event object.
Args:
unused_formatter_mediator (FormatterMediator): mediates the interactions between
formatters and other components, such as storage and Windows EventLog
resources.
unused_formatter_mediator (FormatterMediator): mediates the interactions
between formatters and other components, such as storage and Windows
EventLog resources.
event (EventObject): event.
Returns:
Expand Down
4 changes: 2 additions & 2 deletions plaso/multi_processing/psort.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def _GetEventIdentifiers(self, event):
event (EventObject): event.
Returns:
tuple: contains:
tuple: containing:
str: identifier of the event MACB group or None if the event cannot
be grouped.
Expand Down Expand Up @@ -127,7 +127,7 @@ def PopEvent(self):
"""Pops an event from the heap.
Returns:
tuple: contains:
tuple: containing:
str: identifier of the event MACB group or None if the event cannot
be grouped.
Expand Down
5 changes: 3 additions & 2 deletions plaso/parsers/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,13 @@ def _GetIdentifierFromPath(self, parser_mediator):
and other components, such as storage and dfvfs.
Returns:
str: container or graph identifier.
str: container or graph identifier.
"""
file_entry = parser_mediator.GetFileEntry()
path = file_entry.path_spec.location
file_system = file_entry.GetFileSystem()
identifier = file_system.SplitPath(path)[-2]
path_segments = file_system.SplitPath(path)
identifier = path_segments[-2]
return identifier

def _ParseLayerConfigJSON(self, parser_mediator, file_object):
Expand Down
4 changes: 2 additions & 2 deletions plaso/parsers/firefox_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def _GetFirefoxConfig(self, file_object, display_name):
display_name (str): display name.
Returns:
firefox__cache_config: namedtuple containing the block size and first
firefox_cache_config: namedtuple containing the block size and first
record offset.
Raises:
Expand Down Expand Up @@ -285,7 +285,7 @@ def _ReadCacheEntry(self, file_object, display_name, block_size):
block_size (int): block size.
Returns:
tuple: contains:
tuple: containing:
construct.Struct: cache record header structure.
FirefoxCacheEventData: event data.
Expand Down
2 changes: 1 addition & 1 deletion plaso/parsers/mac_appfirewall.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def _GetTimeElementsTuple(self, structure):
a line of a text file.
Returns:
tuple: contains:
tuple: containing:
year (int): year.
month (int): month, where 1 represents January.
day_of_month (int): day of month, where 1 is the first day of the month.
Expand Down
10 changes: 5 additions & 5 deletions plaso/parsers/mac_keychain.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,13 @@ def _ReadEntryHeader(
Returns:
tuple: containing:
ssgp_hash: Hash of the encrypted data (passwd, cert, note).
ssgp_hash: hash of the encrypted data (passwd, cert, note).
creation_time (dfdatetime.TimeElements): entry creation time or None.
last_modification_time ((dfdatetime.TimeElements): entry last
last_modification_time (dfdatetime.TimeElements): entry last
modification time or None.
text_description: A brief description of the entry.
entry_name: Name of the entry
account_name: Name of the account.
text_description: brief description of the entry.
entry_name: name of the entry
account_name: name of the account.
"""
# TODO: reduce number of seeks and/or offset calculations needed
# for parsing.
Expand Down
2 changes: 1 addition & 1 deletion plaso/parsers/mac_securityd.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def _GetTimeElementsTuple(self, structure):
a line of a text file.
Returns:
tuple: contains:
tuple: containing:
year (int): year.
month (int): month, where 1 represents January.
day_of_month (int): day of month, where 1 is the first day of the month.
Expand Down
2 changes: 1 addition & 1 deletion plaso/parsers/mac_wifi.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def _GetTimeElementsTuple(self, key, structure):
a line of a text file.
Returns:
tuple: contains:
tuple: containing:
year (int): year.
month (int): month, where 1 represents January.
day_of_month (int): day of month, where 1 is the first day of the month.
Expand Down
6 changes: 3 additions & 3 deletions plaso/parsers/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def _GetParserFilters(cls, parser_filter_expression):
represents all parsers and plugins.
Returns:
tuple: contains:
tuple: containing:
* dict[str, BaseParser]: included parsers and plugins by name.
* dict[str, BaseParser]: excluded parsers and plugins by name.
Expand Down Expand Up @@ -211,7 +211,7 @@ def GetFormatsWithSignatures(cls, parser_filter_expression=None):
where None represents all parsers and plugins.
Returns:
tuple: contains:
tuple: containing:
* FormatSpecificationStore: format specifications with signaures.
* list[str[: remaining parser names that do not have a format
Expand Down Expand Up @@ -364,7 +364,7 @@ def GetParsers(cls, parser_filter_expression=None):
where None represents all parsers and plugins.
Yields:
tuple: contains:
tuple: containing:
* str: name of the parser:
* type: parser class (subclass of BaseParser).
Expand Down
8 changes: 6 additions & 2 deletions plaso/parsers/sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def _OpenDatabaseWithWAL(
filename (str): name of the database file entry.
Returns:
tuple: contains:
tuple: containing:
SQLiteDatabase: a database object with WAL file committed or None
dfvfs.FileEntry: a file entry object of WAL file or None
Expand Down Expand Up @@ -370,7 +370,11 @@ def _OpenDatabaseWithWAL(

@classmethod
def GetFormatSpecification(cls):
"""FormatSpecification: format specification."""
"""Retrieves the format specification.
Returns:
FormatSpecification: format specification.
"""
format_specification = specification.FormatSpecification(cls.NAME)
format_specification.AddNewSignature(b'SQLite format 3', offset=0)
return format_specification
Expand Down
2 changes: 1 addition & 1 deletion plaso/parsers/symantec.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def _GetTimeElementsTuple(self, timestamp):
timestamp (str): hexadecimal encoded date and time values.
Returns:
tuple: contains:
tuple: containing:
year (int): year.
month (int): month, where 1 represents January.
day_of_month (int): day of month, where 1 is the first day of the month.
Expand Down
2 changes: 1 addition & 1 deletion plaso/parsers/utmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def _ReadEntry(self, parser_mediator, file_object, file_offset):
the file-like object.
Returns:
tuple: contains:
tuple: containing:
int: timestamp, which contains the number of microseconds
since January 1, 1970, 00:00:00 UTC.
Expand Down
2 changes: 1 addition & 1 deletion plaso/parsers/utmpx.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def _ReadEntry(self, parser_mediator, file_object, file_offset):
the file-like object.
Returns:
tuple: contains:
tuple: containing:
int: timestamp, which contains the number of microseconds
since January 1, 1970, 00:00:00 UTC.
Expand Down
2 changes: 1 addition & 1 deletion plaso/parsers/winreg_plugins/bagmru.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def _ParseMRUListExValue(self, parser_mediator, registry_key):
the MRUListEx value.
Yields:
tuple: contains:
tuple: containing:
int: MRUListEx index, where 0 is the first index value.
int: entry number.
Expand Down
2 changes: 1 addition & 1 deletion plaso/parsers/winreg_plugins/task_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def _GetIdValue(self, registry_key):
registry_key (dfwinreg.WinRegistryKey): Windows Registry key.
Yields:
tuple: contains:
tuple: containing:
dfwinreg.WinRegistryKey: Windows Registry key.
dfwinreg.WinRegistryValue: Windows Registry value.
Expand Down
2 changes: 1 addition & 1 deletion plaso/parsers/xchatlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def _GetTimeElementsTuple(self, structure):
a line of a text file.
Returns:
tuple: contains:
tuple: containing:
year (int): year.
month (int): month, where 1 represents January.
day_of_month (int): day of month, where 1 is the first day of the month.
Expand Down
2 changes: 1 addition & 1 deletion plaso/parsers/xchatscrollback.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def _StripThenGetNicknameAndText(self, text):
text (str): text obtained from the log record.
Returns:
tuple: contains:
tuple: containing:
nickname (str): nickname.
text (str): text sent by nickname or service messages.
Expand Down
2 changes: 1 addition & 1 deletion plaso/storage/event_heaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def PopEvent(self):
"""Pops an event from the heap.
Returns:
tuple: contains:
tuple: containing:
int: event timestamp or None if the heap is empty
bytes: serialized event or None if the heap is empty
Expand Down
2 changes: 1 addition & 1 deletion tests/parsers/sqlite_plugins/test_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def _OpenDatabaseFile(self, path_segments, wal_path=None):
wal_path (Optional[str]): path to the SQLite WAL file.
Returns:
tuple: contains:
tuple: containing:
file_entry (dfvfs.FileEntry): file entry of the SQLite database file.
SQLiteDatabase: SQLite database file.
"""
Expand Down

0 comments on commit 4920467

Please sign in to comment.