Bug 1177298. Add UA overrides for top Japan sites. r=Sebastian
[gecko.git] / .ycm_extra_conf.py
blobea98ca6a5c507a0555033b43d9011906a4084257
1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 import imp
6 import os
7 from StringIO import StringIO
8 import shlex
9 import sys
11 old_bytecode = sys.dont_write_bytecode
12 sys.dont_write_bytecode = True
14 path = os.path.join(os.path.dirname(__file__), 'mach')
16 if not os.path.exists(path):
17 path = os.path.join(os.path.dirname(__file__), 'config.status')
18 config = imp.load_module('_buildconfig', open(path), path, ('', 'r', imp.PY_SOURCE))
19 path = os.path.join(config.topsrcdir, 'mach')
20 mach_module = imp.load_module('_mach', open(path), path, ('', 'r', imp.PY_SOURCE))
22 sys.dont_write_bytecode = old_bytecode
24 def FlagsForFile(filename):
25 mach = mach_module.get_mach()
26 out = StringIO()
27 out.encoding = None
28 mach.run(['compileflags', filename], stdout=out, stderr=out)
30 flag_list = shlex.split(out.getvalue())
32 # This flag is added by Fennec for android build and causes ycmd to fail to parse the file.
33 # Removing this flag is a workaround until ycmd starts to handle this flag properly.
34 # https://github.com/Valloric/YouCompleteMe/issues/1490
35 final_flags = [x for x in flag_list if not x.startswith('-march=armv')]
37 return {
38 'flags': final_flags,
39 'do_cache': True