Skip to content

Commit

Permalink
Merge pull request #1 from rodrigorega/windows_compatibility
Browse files Browse the repository at this point in the history
Added compatibility with Windows OS's
  • Loading branch information
rodrigorega committed Sep 25, 2014
2 parents 4c07d2e + 30c6d72 commit 87dafa1
Showing 1 changed file with 12 additions and 3 deletions.
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

0 comments on commit 87dafa1

Please sign in to comment.