Skip to content

Commit

Permalink
Code review: 235710044: Migration to print as a function and removed …
Browse files Browse the repository at this point in the history
…unused files.
  • Loading branch information
joachimmetz committed Dec 31, 2015
1 parent 1fb2745 commit 769affb
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 2,769 deletions.
2 changes: 1 addition & 1 deletion config/dpkg/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ python-plaso (1.2.1-1) unstable; urgency=low

* Auto-generated

-- Log2Timeline <[email protected]> Wed, 03 Jun 2015 13:12:18 -0700
-- Log2Timeline <[email protected]> Wed, 03 Jun 2015 22:22:10 +0200
5 changes: 3 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#
# Valid options are documented at http://sphinx-doc.org/config.html.

from __future__ import print_function
import os
import sys
import time
Expand Down Expand Up @@ -92,9 +93,9 @@ def __add__(self, other):
PIP_INSTALLED_MODULES = set(
[u'google.protobuf', u'six', u'pyparsing', u'construct'])
modules_to_mock = set(modules_to_mock).difference(PIP_INSTALLED_MODULES)
print u'Mocking modules'
print(u'Mocking modules')
for module_name in modules_to_mock:
print module_name
print(module_name)

sys.modules.update((module_name, Mock()) for module_name in modules_to_mock)

Expand Down
4 changes: 3 additions & 1 deletion plaso/frontend/psort.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
"""The psort front-end."""

from __future__ import print_function
import collections
import multiprocessing
import logging
Expand Down Expand Up @@ -564,7 +565,8 @@ def _ConsumeItem(self, analysis_report, **unused_kwargs):

report_string = analysis_report.GetString()
try:
print report_string.encode(self._preferred_encoding)
# TODO: move this print to the psort tool or equivalent.
print(report_string.encode(self._preferred_encoding))
except UnicodeDecodeError:
logging.error(
u'Unable to print report due to an unicode decode error. '
Expand Down
2 changes: 1 addition & 1 deletion plaso/lib/objectfilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self, code, color="white", doors=3):
for car in fleet:
if compiled_filter.Matches(car):
print "Car %s matches the supplied filter." % car.code
print("Car %s matches the supplied filter." % car.code)
The filter expression contains two subexpressions joined by an AND operator:
"color is grey" and "doors >= 3"
Expand Down
5 changes: 0 additions & 5 deletions plaso/lib/objectfilter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,17 +173,12 @@ def setUp(self):
def testBinaryOperators(self):
for operator, test_data in self.operator_tests.items():
for test_unit in test_data:
# TODO: why is there a print statement here?
print (u'Testing {0:s} with {1!s} and {2!s}'.format(
operator, test_unit[0], test_unit[1]))
kwargs = {'arguments': test_unit[1],
'value_expander': self.value_expander}
ops = operator(**kwargs)
self.assertEqual(test_unit[0], ops.Matches(self.file))
if hasattr(ops, 'FlipBool'):
ops.FlipBool()
# TODO: why is there a print statement here?
print u'Testing negative matching.'
self.assertEqual(not test_unit[0], ops.Matches(self.file))

def testExpand(self):
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
sudo python setup.py install
"""

from __future__ import print_function
import glob
import locale
import os
Expand All @@ -27,8 +28,8 @@

version_tuple = (sys.version_info[0], sys.version_info[1])
if version_tuple < (2, 7) or version_tuple >= (3, 0):
print (u'Unsupported Python version: {0:s}, version 2.7 or higher and '
u'lower than 3.x required.').format(sys.version)
print((u'Unsupported Python version: {0:s}, version 2.7 or higher and '
u'lower than 3.x required.').format(sys.version))
sys.exit(1)


Expand Down
5 changes: 3 additions & 2 deletions utils/check_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# -*- coding: utf-8 -*-
"""Script to check for the availability and version of dependencies."""

from __future__ import print_function
import sys

# Change PYTHONPATH to include plaso.
Expand All @@ -16,5 +17,5 @@
u'https://sites.google.com/a/kiddaland.net/plaso/developer'
u'/building-the-tool')

print u'See: {0:s} on how to set up plaso.'.format(build_instructions_url)
print u''
print(u'See: {0:s} on how to set up plaso.'.format(build_instructions_url))
print(u'')
5 changes: 3 additions & 2 deletions utils/create_authors.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
# -*- coding: utf-8 -*-
"""This file simply creates the AUTHOR file based on parser content."""

import os
from __future__ import print_function
import fnmatch
import os


def ProcessFile(file_path):
Expand Down Expand Up @@ -63,4 +64,4 @@ def ProcessFile(file_path):
out_file.write('\n'.join(authors))
out_file.write('\n')

print 'Added {0:d} authors from files.'.format(len(authors))
print(u'Added {0:d} authors from files.'.format(len(authors)))
101 changes: 0 additions & 101 deletions utils/download_patch_set.py

This file was deleted.

Loading

0 comments on commit 769affb

Please sign in to comment.