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

Side by Side Diff: sky/tools/webkitpy/common/checksvnconfigfile.py

Issue 675343003: Prune a bunch of webkitpy. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « no previous file | sky/tools/webkitpy/style/__init__.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright (C) 2012 Balazs Ankes (bank@inf.u-szeged.hu) University of Szeged
2 #
3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions
5 # are met:
6 # 1. Redistributions of source code must retain the above copyright
7 # notice, this list of conditions and the following disclaimer.
8 # 2. Redistributions in binary form must reproduce the above copyright
9 # notice, this list of conditions and the following disclaimer in the
10 # documentation and/or other materials provided with the distribution.
11 #
12 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
13 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
14 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
15 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
16 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
18 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
24 # This file is used by:
25 # webkitpy/style/checkers/png.py
26
27 import os
28 import re
29
30
31 def check(host, fs):
32 """
33 check the svn config file
34 return with three logical value:
35 is svn config file missing, is auto-props missing, is the svn:mime-type for png missing
36 """
37
38 cfg_file_path = config_file_path(host, fs)
39
40 try:
41 config_file = fs.read_text_file(cfg_file_path)
42 except IOError:
43 return (True, True, True)
44
45 errorcode_autoprop = not re.search("^\s*enable-auto-props\s*=\s*yes", config _file, re.MULTILINE)
46 errorcode_png = not re.search("^\s*\*\.png\s*=\s*svn:mime-type=image/png", c onfig_file, re.MULTILINE)
47
48 return (False, errorcode_autoprop, errorcode_png)
49
50
51 def config_file_path(host, fs):
52 if host.platform.is_win():
53 config_file_path = fs.join(os.environ['APPDATA'], "Subversion", "config" )
54 else:
55 config_file_path = fs.join(fs.expanduser("~"), ".subversion", "config")
56 return config_file_path
57
58
59 def errorstr_autoprop(config_file_path):
60 return 'Have to enable auto props in the subversion config file (%s "enable- auto-props = yes"). ' % config_file_path
61
62
63 def errorstr_png(config_file_path):
64 return 'Have to set the svn:mime-type in the subversion config file (%s "*.p ng = svn:mime-type=image/png").' % config_file_path
OLDNEW
« no previous file with comments | « no previous file | sky/tools/webkitpy/style/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698