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

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

Issue 546613003: Add a new 'format-webkitpy' command that will reformat code to the style guide. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove hack from test/main.py Created 6 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 self.user = MockUser() 44 self.user = MockUser()
45 self.platform = MockPlatformInfo() 45 self.platform = MockPlatformInfo()
46 if os_name: 46 if os_name:
47 self.platform.os_name = os_name 47 self.platform.os_name = os_name
48 if os_version: 48 if os_version:
49 self.platform.os_version = os_version 49 self.platform.os_version = os_version
50 50
51 # FIXME: Should this take pointers to the filesystem and the executive? 51 # FIXME: Should this take pointers to the filesystem and the executive?
52 self.workspace = MockWorkspace() 52 self.workspace = MockWorkspace()
53 53
54 self.stdin = StringIO()
54 self.stdout = StringIO() 55 self.stdout = StringIO()
55 self.stderr = StringIO() 56 self.stderr = StringIO()
56 57
57 def copy_current_environment(self): 58 def copy_current_environment(self):
58 return Environment({"MOCK_ENVIRON_COPY": '1'}) 59 return Environment({"MOCK_ENVIRON_COPY": '1'})
59 60
60 def print_(self, *args, **kwargs): 61 def print_(self, *args, **kwargs):
61 sep = kwargs.get('sep', ' ') 62 sep = kwargs.get('sep', ' ')
62 end = kwargs.get('end', '\n') 63 end = kwargs.get('end', '\n')
63 file = kwargs.get('file', None) 64 stream = kwargs.get('stream', self.stdout)
64 stderr = kwargs.get('stderr', False) 65 stream.write(sep.join([str(arg) for arg in args]) + end)
65
66 file = file or (self.stderr if stderr else self.stdout)
67 file.write(sep.join([str(arg) for arg in args]) + end)
OLDNEW
« no previous file with comments | « Tools/Scripts/webkitpy/common/system/systemhost.py ('k') | Tools/Scripts/webkitpy/formatter/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698