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

Side by Side Diff: Tools/Scripts/webkitpy/common/system/systemhost.py

Issue 23672050: Refactor print-layout-test-times and add unit tests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2011 Google Inc. All rights reserved. 1 # Copyright (c) 2011 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 25 matching lines...) Expand all
36 class SystemHost(object): 36 class SystemHost(object):
37 def __init__(self): 37 def __init__(self):
38 self.executive = executive.Executive() 38 self.executive = executive.Executive()
39 self.filesystem = filesystem.FileSystem() 39 self.filesystem = filesystem.FileSystem()
40 self.user = user.User() 40 self.user = user.User()
41 self.platform = platforminfo.PlatformInfo(sys, platform, self.executive) 41 self.platform = platforminfo.PlatformInfo(sys, platform, self.executive)
42 self.workspace = workspace.Workspace(self.filesystem, self.executive) 42 self.workspace = workspace.Workspace(self.filesystem, self.executive)
43 43
44 def copy_current_environment(self): 44 def copy_current_environment(self):
45 return environment.Environment(os.environ.copy()) 45 return environment.Environment(os.environ.copy())
46
47 def print_(self, *args, **kwargs):
Dirk Pranke 2013/09/19 23:50:56 Adding this wrapper allows us to capture stdout an
48 sep = kwargs.get('sep', ' ')
49 end = kwargs.get('end', '\n')
50 file = kwargs.get('file', None)
51 stderr = kwargs.get('stderr', False)
52
53 file = file or (sys.stderr if stderr else sys.stdout)
54 file.write(sep.join([str(arg) for arg in args]) + end)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698