def main(): project = tracing_project.TracingProject() sys.path.append(os.path.join(project.tracing_third_party_path, "python_gflags")) sys.path.append(os.path.join(project.tracing_third_party_path, "closure_linter")) from closure_linter import fixjsstyle os.chdir(project.tracing_src_path) fixjsstyle.main()
def main(): project = trace_viewer_project.TraceViewerProject() sys.path.append(os.path.join( project.trace_viewer_third_party_path, 'python_gflags')) sys.path.append(os.path.join( project.trace_viewer_third_party_path, 'closure_linter')) from closure_linter import fixjsstyle os.chdir(project.src_path) fixjsstyle.main()
def main(): project = tracing_project.TracingProject() sys.path.append(os.path.join( project.tracing_third_party_path, 'python_gflags')) sys.path.append(os.path.join( project.tracing_third_party_path, 'closure_linter')) from closure_linter import fixjsstyle os.chdir(project.tracing_src_path) fixjsstyle.main()
#!/usr/bin/env python # snipped thanks to # http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder import os, sys, inspect def get_relative_path(*parts): return os.path.realpath(os.path.abspath(os.path.join( os.path.split(inspect.getfile(inspect.currentframe()))[0], *parts))) sys.path.insert(0, get_relative_path("closure-linter")) sys.path.insert(0, get_relative_path("gflags")) from closure_linter import fixjsstyle fixjsstyle.main()
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # Portions Copyright (C) Philipp Kewisch, 2012 from closure_linter import fixjsstyle import icaljs_errorrules if __name__ == '__main__': icaljs_errorrules.InjectErrorReporter() fixjsstyle.main()
def main(): os.chdir(src_dir) fixjsstyle.main()