Fix pylint warnings in update_device.py
We weren't actually using our own pylintrc file in repo upload hook,
which will be fixed by https://android-review.googlesource.com/#/c/platform/tools/repohooks/+/458996/
Even though both camel case and snake case are allowed for function
and method names, they still have to be consistent in a single file.
https://pylint.readthedocs.io/en/latest/user_guide/options.html#multiple-naming-styles
Bug: 27316596
Test: repo upload
Change-Id: I98adba957a547115ef3d8b00fe2e3e4931707b31
diff --git a/pylintrc b/pylintrc
index f83f8c6..f264479 100644
--- a/pylintrc
+++ b/pylintrc
@@ -263,7 +263,7 @@
bad-functions=map,filter,input,apply,reduce
# Good variable names which should always be accepted, separated by a comma
-good-names=i,j,k,ex,x,_
+good-names=i,j,k,ex,x,_,main
# Bad variable names which should always be refused, separated by a comma
bad-names=foo,bar,baz,toto,tutu,tata
diff --git a/scripts/update_device.py b/scripts/update_device.py
index 75c58a7..63d0fc9 100755
--- a/scripts/update_device.py
+++ b/scripts/update_device.py
@@ -93,7 +93,7 @@
"""
@staticmethod
- def _ParseRange(range_str, file_size):
+ def _parse_range(range_str, file_size):
"""Parse an HTTP range string.
Args:
@@ -141,11 +141,11 @@
self.send_response(200)
stat = os.fstat(f.fileno())
- start_range, end_range = self._ParseRange(self.headers.get('range'),
- stat.st_size)
+ start_range, end_range = self._parse_range(self.headers.get('range'),
+ stat.st_size)
logging.info('Serving request for %s from %s [%d, %d) length: %d',
- self.path, self.serving_payload, start_range, end_range,
- end_range - start_range)
+ self.path, self.serving_payload, start_range, end_range,
+ end_range - start_range)
self.send_header('Accept-Ranges', 'bytes')
self.send_header('Content-Range',