Skip to content

Commit

Permalink
Complete docstring update
Browse files Browse the repository at this point in the history
  • Loading branch information
Onager committed Jul 24, 2018
1 parent e6a80b0 commit a1eb356
Show file tree
Hide file tree
Showing 69 changed files with 238 additions and 218 deletions.
2 changes: 2 additions & 0 deletions plaso/cli/helpers/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ class ArgumentHelperManager(object):

_helper_classes = {}

# Pylint is confused by the format of the argument_group docstring.
# pylint: disable=missing-type-doc
@classmethod
def AddCommandLineArguments(
cls, argument_group, category=None, names=None):
Expand Down
6 changes: 3 additions & 3 deletions plaso/engine/zeromq_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ def IsEmpty(self):
"""
return False

# pylint: disable=redundant-returns-doc
@abc.abstractmethod
def PushItem(self, item, block=True):
"""Pushes an item on to the queue.
Expand All @@ -306,6 +305,7 @@ def PushItem(self, item, block=True):
QueueAlreadyClosed: If the queue is closed.
"""

# pylint: disable=redundant-returns-doc
@abc.abstractmethod
def PopItem(self):
"""Pops an item off the queue.
Expand All @@ -315,7 +315,7 @@ def PopItem(self):
Raises:
QueueEmpty: If the queue is empty, and no item could be popped within the
queue timeout.
queue timeout.
"""


Expand Down Expand Up @@ -343,7 +343,7 @@ def PopItem(self):
Raises:
KeyboardInterrupt: if the process is sent a KeyboardInterrupt while
popping an item.
QueueEmpty: If the queue is empty, and no item could be popped within the
QueueEmpty: if the queue is empty, and no item could be popped within the
queue timeout.
RuntimeError: if closed or terminate event is missing.
zmq.error.ZMQError: if a ZeroMQ error occurs.
Expand Down
11 changes: 6 additions & 5 deletions plaso/filters/filter_list.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
"""List of object-filters."""
# pylint: disable=missing-type-doc,missing-return-type-doc

from __future__ import unicode_literals

Expand All @@ -13,6 +12,8 @@
from plaso.filters import manager
from plaso.lib import errors

# pylint: disable=missing-type-doc,missing-return-type-doc


class ObjectFilterList(interface.FilterObject):
"""A list of object-filters with additional metadata."""
Expand Down Expand Up @@ -119,20 +120,20 @@ def CompileFilter(self, filter_expression):
results_type))
self._filter_expression = filter_expression

def Match(self, event_object):
def Match(self, event):
"""Determines if an event object matches the filter.
Args:
event_object: an event object (instance of EventObject).
event (EventObject): event.
Returns:
A boolean value that indicates a match.
bool: True if the filter matched.
"""
if not self.filters:
return True

for _, matcher, _ in self.filters:
if matcher.Matches(event_object):
if matcher.Matches(event):
return True

return False
Expand Down
4 changes: 2 additions & 2 deletions plaso/filters/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ def CompileFilter(self, filter_expression):
WrongPlugin: if the filter could not be compiled.
"""

# pylint: disable=missing-type-doc,differing-type-doc,differing-param-doc
def Match(self, unused_event):
# pylint: disable=unused-argument
def Match(self, event):
"""Determines if an event matches the filter.
Args:
Expand Down
3 changes: 2 additions & 1 deletion plaso/filters/path_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
The scan tree is used in the filter to filter provided paths.
"""
# pylint: disable=missing-type-doc,missing-return-type-doc

from __future__ import unicode_literals

from plaso.lib import py2to3

# pylint: disable=missing-type-doc,missing-return-type-doc


class _PathFilterTable(object):
"""Class that implements a path filter table.
Expand Down
7 changes: 3 additions & 4 deletions plaso/formatters/chrome.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,13 @@ class ChromePageVisitedFormatter(interface.ConditionalEventFormatter):
4: 'SOURCE_IE_IMPORTED',
5: 'SOURCE_SAFARI_IMPORTED'}

# pylint: disable=differing-param-doc,differing-type-doc,missing-type-doc
def GetMessages(self, unused_formatter_mediator, event):
"""Determines the formatted message strings for an event object.
Args:
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
7 changes: 3 additions & 4 deletions plaso/formatters/chrome_extension_activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,13 @@ class ChromeExtensionActivityEventFormatter(
1001 : 'Unspecified'
}

# pylint: disable=differing-param-doc,differing-type-doc,missing-type-doc
def GetMessages(self, unused_formatter_mediator, event):
"""Determines the formatted message strings for an event object.
Args:
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
7 changes: 3 additions & 4 deletions plaso/formatters/chrome_preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,13 @@ class ChromeContentSettingsExceptionsFormatter(
SOURCE_LONG = 'Chrome Permission Event'
SOURCE_SHORT = 'LOG'

# pylint: disable=differing-param-doc,differing-type-doc,missing-type-doc
def GetMessages(self, unused_formatter_mediator, event):
"""Determines the formatted message strings for an event object.
Args:
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
7 changes: 3 additions & 4 deletions plaso/formatters/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ class DefaultFormatter(interface.EventFormatter):
FORMAT_STRING = '<WARNING DEFAULT FORMATTER> Attributes: {attribute_driven}'
FORMAT_STRING_SHORT = '<DEFAULT> {attribute_driven}'

# pylint: disable=differing-param-doc,differing-type-doc,missing-type-doc
def GetMessages(self, unused_formatter_mediator, event):
"""Determines the formatted message strings for an event object.
Args:
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
21 changes: 9 additions & 12 deletions plaso/formatters/file_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,13 @@ class FileStatEventFormatter(interface.ConditionalEventFormatter):
dfvfs_definitions.FILE_ENTRY_TYPE_SOCKET: 'socket',
dfvfs_definitions.FILE_ENTRY_TYPE_PIPE: 'pipe'}

# pylint: disable=differing-param-doc,differing-type-doc,missing-type-doc
def GetMessages(self, unused_formatter_mediator, event):
"""Determines the formatted message strings for an event object.
Args:
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 Expand Up @@ -124,14 +123,13 @@ class NTFSFileStatEventFormatter(FileStatEventFormatter):
0x00000030: '$FILE_NAME'
}

# pylint: disable=differing-param-doc,differing-type-doc,missing-type-doc
def GetMessages(self, unused_formatter_mediator, event):
"""Determines the formatted message strings for an event object.
Args:
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 Expand Up @@ -214,14 +212,13 @@ class NTFSUSNChangeEventFormatter(interface.ConditionalEventFormatter):
0x00000002: 'USN_SOURCE_AUXILIARY_DATA',
0x00000004: 'USN_SOURCE_REPLICATION_MANAGEMENT'}

# pylint: disable=differing-param-doc,differing-type-doc,missing-type-doc
def GetMessages(self, unused_formatter_mediator, event):
"""Determines the formatted message strings for an event object.
Args:
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
7 changes: 3 additions & 4 deletions plaso/formatters/firefox.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,13 @@ class FirefoxPageVisitFormatter(interface.ConditionalEventFormatter):
SOURCE_LONG = 'Firefox History'
SOURCE_SHORT = 'WEBHIST'

# pylint: disable=differing-param-doc,differing-type-doc,missing-type-doc
def GetMessages(self, unused_formatter_mediator, event):
"""Determines the formatted message strings for an event object.
Args:
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
7 changes: 3 additions & 4 deletions plaso/formatters/fseventsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,13 @@ def _GetFlagValues(self, flags):
event_types.append(description)
return ', '.join(event_types)

# pylint: disable=differing-param-doc,differing-type-doc,missing-type-doc
def GetMessages(self, unused_formatter_mediator, event):
"""Determines the formatted message strings for an event object.
Args:
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
7 changes: 3 additions & 4 deletions plaso/formatters/gdrive.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,13 @@ class GDriveCloudEntryFormatter(interface.ConditionalEventFormatter):
7: 'TABLE',
}

# pylint: disable=differing-param-doc,differing-type-doc,missing-type-doc
def GetMessages(self, unused_formatter_mediator, event):
"""Determines the formatted message strings for an event object.
Args:
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
7 changes: 3 additions & 4 deletions plaso/formatters/hachoir.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ class HachoirFormatter(interface.EventFormatter):
SOURCE_LONG = 'Hachoir Metadata'
SOURCE_SHORT = 'META'

# pylint: disable=differing-param-doc,differing-type-doc,missing-type-doc
def GetMessages(self, unused_formatter_mediator, event):
"""Determines the formatted message strings for an event object.
Args:
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
7 changes: 3 additions & 4 deletions plaso/formatters/imessage.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,13 @@ class IMessageFormatter(interface.ConditionalEventFormatter):
1: 'Sent'
}

# pylint: disable=differing-param-doc,differing-type-doc,missing-type-doc
def GetMessages(self, unused_formatter_mediator, event):
"""Determines the formatted message strings for an event object.
Args:
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
14 changes: 6 additions & 8 deletions plaso/formatters/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,13 @@ def GetFormatStringAttributeNames(self):

return set(self._format_string_attribute_names)

# pylint: disable=differing-param-doc,differing-type-doc,missing-type-doc
def GetMessages(self, unused_formatter_mediator, event):
"""Determines the formatted message strings for an event object.
Args:
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 Expand Up @@ -325,14 +324,13 @@ def GetFormatStringAttributeNames(self):

return set(self._format_string_attribute_names)

# pylint: disable=differing-param-doc,differing-type-doc,missing-type-doc
def GetMessages(self, unused_formatter_mediator, event):
"""Determines the formatted message strings for an event object.
Args:
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
7 changes: 3 additions & 4 deletions plaso/formatters/kik_ios.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,13 @@ class KikIOSMessageFormatter(interface.ConditionalEventFormatter):
94: 'read after offline'
}

# pylint: disable=differing-param-doc,differing-type-doc,missing-type-doc
def GetMessages(self, unused_formatter_mediator, event):
"""Determines the formatted message strings for an event object.
Args:
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
7 changes: 3 additions & 4 deletions plaso/formatters/msiecf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@
class MsiecfItemFormatter(interface.ConditionalEventFormatter):
"""Formatter for a MSIECF item event."""

# pylint: disable=differing-param-doc,differing-type-doc,missing-type-doc
def GetMessages(self, unused_formatter_mediator, event):
"""Determines the formatted message strings for an event object.
Args:
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

0 comments on commit a1eb356

Please sign in to comment.