Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added compatibility with Windows OS's #1

Merged
merged 1 commit into from
Sep 25, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions python_validation.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import os.path
import re
import subprocess
#import sys

import sublime
import sublime_plugin


def find_binary(name):
#winDir = os.path.join(sys.prefix, "Scripts") # Why this is not working?
winDir = 'C:\Python27\Scripts'
dirs = ['/usr/local/sbin', '/usr/local/bin', '/usr/sbin',
'/usr/bin', '/sbin', '/bin']
'/usr/bin', '/sbin', '/bin', winDir]
for directory in dirs:
path = os.path.join(directory, name)
if os.path.exists(path):
Expand Down Expand Up @@ -92,7 +95,10 @@ class Pep8ValidateCommand(PythonValidateCommand):
The pep8 executable must be in your system's path for this to work.
"""
def validator(self):
return "pep8"
if os.name == 'nt':
return "pep8.exe"
else:
return "pep8"

def validate(self):
output = self.execute(['--repeat'])
Expand All @@ -111,7 +117,10 @@ class PylintValidateCommand(PythonValidateCommand):
The pylint executable must be in your system's path fro this to work.
"""
def validator(self):
return "pylint"
if os.name == 'nt':
return "pylint.exe"
else:
return "pylint"

def validate(self):
output = self.execute(['--reports=no', '--include-ids=yes'])
Expand Down