Skip to content

Commit

Permalink
Rename pyflakes.scripts.pyflakes to pyflakes.api.
Browse files Browse the repository at this point in the history
  • Loading branch information
florentx committed Jan 25, 2013
1 parent 7c22aff commit 7bd964f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pyflakes/scripts/pyflakes.py → pyflakes/api.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
"""
Implementation of the command-line I{pyflakes} tool.
API for the command-line I{pyflakes} tool.
"""

from __future__ import absolute_import

import sys
import os
import _ast

from pyflakes import checker
from pyflakes import reporter as modReporter

__all__ = ['check', 'checkPath', 'checkRecursive', 'iterSourceCode', 'main']


def check(codeString, filename, reporter=None):
"""
Expand Down Expand Up @@ -74,7 +74,7 @@ def checkPath(filename, reporter=None):
except IOError:
msg = sys.exc_info()[1]
reporter.unexpectedError(filename, msg.args[1])
return 1
return 1


def iterSourceCode(paths):
Expand Down
7 changes: 6 additions & 1 deletion pyflakes/test/test_script.py → pyflakes/test/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

from pyflakes.messages import UnusedImport
from pyflakes.reporter import Reporter
from pyflakes.scripts.pyflakes import (
from pyflakes.api import (
checkPath,
checkRecursive,
iterSourceCode,
Expand Down Expand Up @@ -273,6 +273,11 @@ def getErrors(self, path):
return count, log


def test_legacyScript(self):
from pyflakes.scripts import pyflakes as script_pyflakes
self.assertIs(script_pyflakes.checkPath, checkPath)


def test_missingTrailingNewline(self):
"""
Source which doesn't end with a newline shouldn't cause any
Expand Down

0 comments on commit 7bd964f

Please sign in to comment.