Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(12)  |  Call(8)  |  Derive(0)  |  Import(4)
Check whether or not a cli tool exists in a node_modules/.bin
dir in os.cwd

@return boolean

        def npm_exists(name):
    """
    Check whether or not a cli tool exists in a node_modules/.bin
    dir in os.cwd

    @return boolean
    """
    cwd = os.getcwd()
    path = os.path.join(cwd, 'node_modules', '.bin', name)
    return os.path.exists(path)
        


src/l/i/lint-review-HEAD/lintreview/tools/csslint.py   lint-review(Download)
from lintreview.tools import run_command
from lintreview.utils import in_path
from lintreview.utils import npm_exists
 
log = logging.getLogger(__name__)
    def check_dependencies(self):
        """
        See if csslint is on the system path.
        """
        return in_path('csslint') or npm_exists('csslint')
        log.debug('Processing %s files with %s', files, self.name)
        cmd = 'csslint'
        if npm_exists('csslint'):
            cmd = os.path.join(os.getcwd(), 'node_modules', '.bin', 'csslint')
        command = [cmd, '--format=checkstyle-xml']

src/l/i/lint-review-HEAD/lintreview/tools/jshint.py   lint-review(Download)
from lintreview.tools import run_command
from lintreview.utils import in_path
from lintreview.utils import npm_exists
 
log = logging.getLogger(__name__)
    def check_dependencies(self):
        """
        See if jshint is on the system path.
        """
        return in_path('jshint') or npm_exists('jshint')
    def create_command(self, files):
        cmd = 'jshint'
        if npm_exists('jshint'):
            cmd = os.path.join(os.getcwd(), 'node_modules', '.bin', 'jshint')
        command = [cmd, '--checkstyle-reporter']

src/l/i/lint-review-HEAD/tests/tools/test_jshint.py   lint-review(Download)
from lintreview.review import Problems
from lintreview.review import Comment
from lintreview.tools.jshint import Jshint
from lintreview.utils import in_path
from lintreview.utils import npm_exists
from unittest import TestCase
from unittest import skipIf
from nose.tools import eq_
 
jshint_missing = not(in_path('jshint') or npm_exists('jshint'))

src/l/i/lint-review-HEAD/tests/tools/test_csslint.py   lint-review(Download)
from lintreview.review import Problems
from lintreview.review import Comment
from lintreview.utils import in_path
from lintreview.utils import npm_exists
from lintreview.tools.csslint import Csslint
from unittest import TestCase
from unittest import skipIf
from nose.tools import eq_
 
csslint_missing = not(in_path('csslint') or npm_exists('csslint'))

src/l/i/lint-review-HEAD/tests/test_utils.py   lint-review(Download)
def test_npm_exists():
    assert utils.npm_exists('jshint'), 'Should be there.'
    assert not utils.npm_exists('not there'), 'Should not be there.'