Fix typo in 9b54bd30006c008b4a951331b273613d5bac3abf
[pm.git] / .ycm_extra_conf.py
blob332911ab744e7bfd6d93df8f611ef845cb732156
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
10 path = os.path.join(os.path.dirname(__file__), 'mach')
12 if not os.path.exists(path):
13 path = os.path.join(os.path.dirname(__file__), 'config.status')
14 config = imp.load_module('_buildconfig', open(path), path, ('', 'r', imp.PY_SOURCE))
15 path = os.path.join(config.topsrcdir, 'mach')
16 mach_module = imp.load_module('_mach', open(path), path, ('', 'r', imp.PY_SOURCE))
18 def FlagsForFile(filename):
19 mach = mach_module.get_mach()
20 out = StringIO()
21 out.encoding = None
22 mach.run(['compileflags', filename], stdout=out, stderr=out)
24 return {
25 'flags': shlex.split(out.getvalue()),
26 'do_cache': True