mirror of
https://github.com/servo/servo.git
synced 2025-08-16 10:55:34 +01:00
Auto merge of #27007 - saschanaz:py3-flake, r=jdm
Upgrade flake8/pyflakes for Py3 compatibility <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
commit
3f999ce785
33 changed files with 377 additions and 357 deletions
|
@ -65,15 +65,15 @@ if __name__ == '__main__':
|
|||
while not server.got_post:
|
||||
server.handle_request()
|
||||
data = json.loads(server.post_data[0])
|
||||
n = 0
|
||||
l = 0
|
||||
number = 0
|
||||
length = 0
|
||||
for test in data:
|
||||
n = max(n, len(data[test]))
|
||||
l = max(l, len(test))
|
||||
print("\n Test{0} | Time".format(" " * (l - len("Test"))))
|
||||
print("-{0}-|-{1}-".format("-" * l, "-" * n))
|
||||
number = max(number, len(data[test]))
|
||||
length = max(length, len(test))
|
||||
print("\n Test{0} | Time".format(" " * (length - len("Test"))))
|
||||
print("-{0}-|-{1}-".format("-" * length, "-" * number))
|
||||
for test in data:
|
||||
print(" {0}{1} | {2}".format(test, " " * (l - len(test)), data[test]))
|
||||
print(" {0}{1} | {2}".format(test, " " * (length - len(test)), data[test]))
|
||||
proc.kill()
|
||||
else:
|
||||
print_usage()
|
||||
|
|
|
@ -183,7 +183,7 @@ def run_http_server():
|
|||
self.send_header("Last-Modified", self.date_time_string(fs.st_mtime))
|
||||
self.end_headers()
|
||||
return f
|
||||
except:
|
||||
except IOError:
|
||||
f.close()
|
||||
raise
|
||||
|
||||
|
@ -195,6 +195,7 @@ def run_http_server():
|
|||
sys.stdout.flush()
|
||||
server.handle_request()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) == 4:
|
||||
cmd = sys.argv[1]
|
||||
|
|
|
@ -134,10 +134,10 @@ def PowerParser(OutputDir, LayoutThreads):
|
|||
|
||||
TotalPower = PowerGen / float(ExperimentNum - 1)
|
||||
TotalTime = TimeGen / float(ExperimentNum - 1)
|
||||
ResultFile.write(str(layoutT) + " , " + str(TotalPower) + " , " +
|
||||
str(MaxPower) + " , " + str(MinPower) + " , " +
|
||||
str(TotalTime) + " , " + str(MaxTime) + " , " +
|
||||
str(MinTime) + "\n")
|
||||
ResultFile.write(str(layoutT) + " , " + str(TotalPower) + " , "
|
||||
+ str(MaxPower) + " , " + str(MinPower) + " , "
|
||||
+ str(TotalTime) + " , " + str(MaxTime) + " , "
|
||||
+ str(MinTime) + "\n")
|
||||
ResultFile.close()
|
||||
Opener = ResultFile = open(ResultTable, "r")
|
||||
for line in Opener:
|
||||
|
@ -180,5 +180,6 @@ def main():
|
|||
PowerCollector(OutputDir, Benchmarks, LayoutThreads, Renderer)
|
||||
PowerParser(OutputDir, LayoutThreads)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
|
@ -75,8 +75,8 @@ class ServoFormatter(base.BaseFormatter):
|
|||
def text_to_erase_display(self):
|
||||
if not self.interactive or not self.current_display:
|
||||
return ""
|
||||
return ((self.move_up + self.clear_eol) *
|
||||
self.current_display.count('\n'))
|
||||
return ((self.move_up + self.clear_eol)
|
||||
* self.current_display.count('\n'))
|
||||
|
||||
def generate_output(self, text=None, new_display=None, unexpected_in_test=None):
|
||||
if not self.interactive:
|
||||
|
|
|
@ -19,6 +19,7 @@ def wpt_path(*args):
|
|||
def servo_path(*args):
|
||||
return os.path.join(servo_root, *args)
|
||||
|
||||
|
||||
paths = {"include_manifest": wpt_path("include.ini"),
|
||||
"config": wpt_path("config.ini"),
|
||||
"ca-cert-path": wpt_path("web-platform-tests/tools/certs/cacert.pem"),
|
||||
|
@ -26,8 +27,8 @@ paths = {"include_manifest": wpt_path("include.ini"),
|
|||
"host-cert-path": wpt_path("web-platform-tests/tools/certs/web-platform.test.pem")}
|
||||
# Imports
|
||||
sys.path.append(wpt_path("web-platform-tests", "tools"))
|
||||
import localpaths # noqa: flake8
|
||||
from wptrunner import wptrunner, wptcommandline
|
||||
import localpaths # noqa: F401,E402
|
||||
from wptrunner import wptrunner, wptcommandline # noqa: E402
|
||||
|
||||
|
||||
def run_tests(**kwargs):
|
||||
|
@ -106,5 +107,6 @@ def main():
|
|||
kwargs = vars(parser.parse_args())
|
||||
return run_tests(**kwargs)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(0 if main() else 1)
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
import os
|
||||
import sys
|
||||
from wptrunner import wptcommandline
|
||||
from update import updatecommandline
|
||||
|
||||
here = os.path.split(__file__)[0]
|
||||
|
||||
|
@ -12,9 +13,6 @@ here = os.path.split(__file__)[0]
|
|||
def wpt_path(*args):
|
||||
return os.path.join(here, *args)
|
||||
|
||||
# Imports
|
||||
from update import updatecommandline
|
||||
|
||||
|
||||
def update_tests(**kwargs):
|
||||
import update
|
||||
|
@ -45,5 +43,6 @@ def main():
|
|||
kwargs = vars(parser.parse_args())
|
||||
return update_tests(**kwargs)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(0 if main() else 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue