Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1018)

Unified Diff: webrtc/tools/barcode_tools/yuv_cropper.py

Issue 2737233003: Revert of PyLint fixes for tools-webrtc and webrtc/tools (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/tools/barcode_tools/helper_functions.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/tools/barcode_tools/yuv_cropper.py
diff --git a/webrtc/tools/barcode_tools/yuv_cropper.py b/webrtc/tools/barcode_tools/yuv_cropper.py
index 609f07dc9cc7ad90ec2d429167f92b53a782cf3a..c57a90db08635dc4611690a6e2f9c6d93b5db718 100755
--- a/webrtc/tools/barcode_tools/yuv_cropper.py
+++ b/webrtc/tools/barcode_tools/yuv_cropper.py
@@ -12,7 +12,7 @@
import sys
-def _CropOneFrame(yuv_file, output_file, component_sizes):
+def _crop_one_frame(yuv_file, output_file, component_sizes):
"""Crops one frame.
This function crops one frame going through all the YUV planes and cropping
@@ -44,7 +44,7 @@
return True
-def CropFrames(yuv_file_name, output_file_name, width, height, crop_height):
+def crop_frames(yuv_file_name, output_file_name, width, height, crop_height):
"""Crops rows of pixels from the top of the YUV frames.
This function goes through all the frames in a video and crops the crop_height
@@ -69,13 +69,13 @@
data_left = True
while data_left:
- data_left = _CropOneFrame(yuv_file, output_file, component_sizes)
+ data_left = _crop_one_frame(yuv_file, output_file, component_sizes)
yuv_file.close()
output_file.close()
-def _ParseArgs():
+def _parse_args():
"""Registers the command-line options."""
usage = "usage: %prog [options]"
parser = optparse.OptionParser(usage=usage)
@@ -101,7 +101,7 @@
return options
-def main():
+def _main():
"""A tool to crop rows of pixels from the top part of a YUV file.
A simple invocation will be:
@@ -109,17 +109,17 @@
--yuv_file=<path_and_name_of_yuv_file>
--output_yuv=<path and name_of_output_file>
"""
- options = _ParseArgs()
+ options = _parse_args()
if os.path.getsize(options.yuv_file) == 0:
sys.stderr.write('Error: The YUV file you have passed has size 0. The '
'produced output will also have size 0.\n')
return -1
- CropFrames(options.yuv_file, options.output_file, options.width,
- options.height, options.crop_height)
+ crop_frames(options.yuv_file, options.output_file, options.width,
+ options.height, options.crop_height)
return 0
if __name__ == '__main__':
- sys.exit(main())
+ sys.exit(_main())
« no previous file with comments | « webrtc/tools/barcode_tools/helper_functions.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698