Skip to content

Commit

Permalink
Fix a couple of issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Onager committed Jul 25, 2018
1 parent afc2e57 commit eb897c4
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion plaso/analysis/windows_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def SetOutputFormat(self, output_format):
Args:
output_format (str): The format the the plugin should used to produce its
output.
output.
"""
self._output_format = output_format

Expand Down
14 changes: 7 additions & 7 deletions plaso/engine/zeromq_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def _SendItem(self, zmq_socket, item, block=True):
zmq_socket (zmq.Socket): used to the send the item.
item (object): sent on the queue. Will be pickled prior to sending.
block (Optional[bool]): whether the push should be performed in blocking
or non-block mode.
or non-blocking mode.
Returns:
bool: whether the item was sent successfully.
Expand Down Expand Up @@ -299,7 +299,7 @@ def PushItem(self, item, block=True):
Args:
item (object): item to push on the queue.
block (Optional[bool]): whether the push should be performed in blocking
or non-block mode.
or non-blocking mode.
Raises:
QueueAlreadyClosed: If the queue is closed.
Expand All @@ -314,7 +314,7 @@ def PopItem(self):
object: item from the queue.
Raises:
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.
"""

Expand Down Expand Up @@ -378,7 +378,7 @@ def PushItem(self, item, block=True):
Args:
item (object): item to push on the queue.
block (Optional[bool]): whether the push should be performed in blocking
or non-block mode.
or non-blocking mode.
Raises:
WrongQueueType: As Push is not supported this queue.
Expand Down Expand Up @@ -425,7 +425,7 @@ def PushItem(self, item, block=True):
Args:
item (object): item to push on the queue.
block (Optional[bool]): whether the push should be performed in blocking
or non-block mode.
or non-blocking mode.
Raises:
KeyboardInterrupt: if the process is sent a KeyboardInterrupt while
Expand Down Expand Up @@ -540,7 +540,7 @@ def PushItem(self, item, block=True):
Args:
item (object): item to push on the queue.
block (Optional[bool]): whether the push should be performed in blocking
or non-block mode.
or non-blocking mode.
Raises:
WrongQueueType: As Push is not supported this queue.
Expand Down Expand Up @@ -757,7 +757,7 @@ def PushItem(self, item, block=True):
Args:
item (object): item to push on the queue.
block (Optional[bool]): whether the push should be performed in blocking
or non-block mode.
or non-blocking mode.
Raises:
QueueAlreadyClosed: If the queue is closed.
Expand Down
10 changes: 4 additions & 6 deletions plaso/filters/filter_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
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 All @@ -32,11 +30,11 @@ def _IncludeKeyword(self, loader, node):
http://pyyaml.org/wiki/PyYAMLDocumentation
Args:
loader: the YAML loader object (instance of yaml.Loader).
node: a YAML node (instance of yaml.TODO).
loader (yaml.Loader): the YAML loader object (instance of yaml.Loader).
node (yaml.node): a YAML node.
Returns:
A Python object or None.
object: a Python object or None.
"""
filename = loader.construct_scalar(node)
if not os.path.isfile(filename):
Expand Down Expand Up @@ -82,7 +80,7 @@ def CompileFilter(self, filter_expression):
The filter expression contains the name of a YAML file.
Args:
filter_expression: string that contains the filter expression.
filter_expression (str): filter expression.
Raises:
WrongPlugin: if the filter could not be compiled.
Expand Down
3 changes: 1 addition & 2 deletions plaso/formatters/asl.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,11 @@ class ASLFormatter(interface.ConditionalEventFormatter):
6 : 'INFO',
7 : 'DEBUG'}

# 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
unused_formatter_mediator (FormatterMediator): mediates the interactions between
formatters and other components, such as storage and Windows EventLog
resources.
event (EventObject): event.
Expand Down
1 change: 0 additions & 1 deletion plaso/lib/timelib.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
# pylint: disable=missing-type-doc,missing-return-type-doc



MONTH_DICT = {
'jan': 1,
'feb': 2,
Expand Down
26 changes: 15 additions & 11 deletions plaso/parsers/bencode_plugins/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ def _GetKeys(self, data, keys, depth=1):
override the depth limit and use _GetKeys to fetch from a deeper level.
Args:
data: bencode data in dictionary form.
keys: A list of keys that should be returned.
depth: Defines how many levels deep to check for a match.
data (dict[str, object]): bencode data values.
keys (list[str]: keys that should be returned.
depth (int): how many levels deep to check for a match.
Returns:
A dictionary with just the keys requested.
dict: a dictionary with just the keys requested.
"""
keys = set(keys)
match = {}
Expand All @@ -72,7 +72,7 @@ def _GetKeys(self, data, keys, depth=1):
return match

def _RecurseKey(self, recur_item, root='', depth=15):
"""Flattens nested dictionaries and lists by yielding it's values.
"""Flattens nested dictionaries and lists by yielding their values.
The hierarchy of a bencode file is a series of nested dictionaries and
lists. This is a helper function helps plugins navigate the structure
Expand All @@ -83,12 +83,15 @@ def _RecurseKey(self, recur_item, root='', depth=15):
message is logged indicating which key processing stopped on.
Args:
recur_item: An object to be checked for additional nested items.
root: The pathname of the current working key.
depth: A counter to ensure we stop at the maximum recursion depth.
recur_item (object): object to be checked for additional nested items.
root (str): the pathname of the current working key.
depth (int): a counter to ensure we stop at the maximum recursion depth.
Yields:
A tuple of the root, key, and value from a bencoded file.
tuple: containing:
* str: root
* str: key
* str: value
"""
if depth < 1:
logger.debug('Recursion limit hit for key: {0:s}'.format(root))
Expand Down Expand Up @@ -134,8 +137,9 @@ def GetEntries(self, parser_mediator, data=None, match=None, **kwargs):
desc = Short description.
Args:
parser_mediator: A parser mediator object (instance of ParserMediator).
data: Bencode data in dictionary form.
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
data (dict[str, object]): bencode data values.
match: Optional dictionary containing only the keys selected in the
BENCODE_KEYS.
"""
Expand Down

0 comments on commit eb897c4

Please sign in to comment.