Skip to content

Instantly share code, notes, and snippets.

@tommynyquist
Last active August 29, 2015 14:17
Show Gist options
  • Save tommynyquist/24a78a3c14dab69f2a20 to your computer and use it in GitHub Desktop.
Save tommynyquist/24a78a3c14dab69f2a20 to your computer and use it in GitHub Desktop.
"""Wrapper to fake the version info for pylama.exe on Windows.
This still requires a patch to linter-pylama for the regexp
to include \r\n."""
import sys
import subprocess
PYLAMA_PATH = 'C:/Python27/ArcGIS10.2/Scripts/pylama.exe'
def main(args):
"""Main method to wrap pylama.exe."""
if len(sys.argv) > 1:
if sys.argv[1] == "--version":
version_args = [PYLAMA_PATH, '--version']
output = subprocess.check_output(version_args,
stderr=subprocess.STDOUT)
version = output.strip().split(' ')[1]
print("pylama %s" % (version))
exit(0)
new_args = [PYLAMA_PATH] + sys.argv[1:]
sys.exit(subprocess.call(new_args))
if __name__ == "__main__":
sys.exit(main(sys.argv))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment