Commits

Andriy Kornatskyy committed 45481a1

Introduced make target qa; fixed issues reported.

Comments (0)

Files changed (7)

-.SILENT: clean env po doctest-cover test doc release upload
-.PHONY: clean env po doctest-cover test doc release upload
+.SILENT: clean env po doctest-cover qa test doc release upload
+.PHONY: clean env po doctest-cover qa test doc release upload
 
 VERSION=2.7
 PYPI=http://pypi.python.org/simple
 		rotate --match=$(VERSION).egg --keep=1 --dist-dir=$(DIST_DIR) \
 		upload;
 
+qa:
+	if [ "$$(echo $(VERSION) | sed 's/\.//')" -eq 27 ]; then \
+		flake8 --max-complexity 10 doc src setup.py && \
+		pep8 doc src setup.py ; \
+	fi
+
 test:
 	$(PYTEST) -q -x --pep8 --doctest-modules \
 		src/wheezy/core
 # wheezy.core documentation build configuration file, created by
 # sphinx-quickstart on Fri Sep  9 20:36:50 2011.
 #
-# This file is execfile()d with the current directory set to its containing dir.
+# This file is execfile()d with the current directory set to its containing
+# dir.
 #
 # Note that not all possible configuration values are present in this
 # autogenerated file.
     os.path.abspath(os.path.join('..', 'src'))
 ])
 
-# -- General configuration -----------------------------------------------------
+# -- General configuration ---------------------------------------------------
 
 # If your documentation needs a minimal Sphinx version, state it here.
 #needs_sphinx = '1.0'
 
-# Add any Sphinx extension module names here, as strings. They can be extensions
-# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+# Add any Sphinx extension module names here, as strings. They can be
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
 extensions = [
     'sphinx.ext.autodoc', 'sphinx.ext.doctest',
     'sphinx.ext.coverage', 'sphinx.ext.viewcode'
 # directories to ignore when looking for source files.
 exclude_patterns = ['_build']
 
-# The reST default role (used for this markup: `text`) to use for all documents.
+# The reST default role (used for this markup: `text`) to use for all
+# documents.
 #default_role = None
 
 # If true, '()' will be appended to :func: etc. cross-reference text.
 #modindex_common_prefix = []
 
 
-# -- Options for HTML output ---------------------------------------------------
+# -- Options for HTML output -------------------------------------------------
 
 # The theme to use for HTML and HTML Help pages.  See the documentation for
 # a list of builtin themes.
 htmlhelp_basename = 'wheezy.coredoc'
 
 
-# -- Options for LaTeX output --------------------------------------------------
+# -- Options for LaTeX output ------------------------------------------------
 
 # The paper size ('letter' or 'a4').
 #latex_paper_size = 'letter'
 #latex_font_size = '10pt'
 
 # Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title, author, documentclass [howto/manual]).
+# (source start file, target name, title, author, documentclass
+# [howto/manual]).
 latex_documents = [
     ('index', 'wheezy.core.tex', 'wheezy.core Documentation',
      'Andriy Kornatskyy', 'manual'),
 ]
 
-# The name of an image file (relative to this directory) to place at the top of
-# the title page.
+# The name of an image file (relative to this directory) to place at the top
+# of the title page.
 #latex_logo = None
 
 # For 'manual' documents, if this is true, then toplevel headings are parts,
 #latex_domain_indices = True
 
 
-# -- Options for manual page output --------------------------------------------
+# -- Options for manual page output ------------------------------------------
 
 # One entry per manual page. List of tuples
 # (source start file, name, description, authors, manual section).
 try:
     from setuptools import setup
 except:
-    from distutils.core import setup
+    from distutils.core import setup  # noqa
 
 README = open(os.path.join(os.path.dirname(__file__), 'README')).read()
 
 install_requires = []
 try:
-    import uuid
-except:
+    import uuid  # noqa
+except ImportError:
     install_requires.append('uuid')
 
 setup(

src/wheezy/core/comp.py

     u = lambda s: s
 
 else:  # pragma: nocover
-    from Queue import Queue
+    from Queue import Queue  # noqa
     xrange = xrange
     str_type = unicode
 
-    def ntob(n, encoding):
+    def ntob(n, encoding):  # noqa
         """ Converts native string to bytes
         """
         return n
 
-    def bton(b, encoding):
+    def bton(b, encoding):  # noqa
         """ Converts bytes to native string
         """
         return b
             return 'defaultdict(%s, %s)' % (self.default_factory,
                                             dict.__repr__(self))
 
-
-if PY3:  # pragma: nocover
-    from urllib.parse import quote_plus
-    url_escape = quote_plus
-else:  # pragma: nocover
-    from urllib import quote_plus
-    url_escape = lambda s: quote_plus(b(s, 'utf-8'))
-
-
 try:  # pragma: nocover
     from email.utils import parsedate
 except ImportError:  # pragma: nocover
     import time
-    parsedate = lambda s: time.strptime(s, "%a, %d %b %Y %H:%M:%S GMT")
+    parsedate = lambda s: time.strptime(s, "%a, %d %b %Y %H:%M:%S GMT")  # noqa
 
 if PY3:  # pragma: nocover
     from urllib.parse import urlsplit
     from urllib.parse import urlunsplit
 else:  # pragma: nocover
-    from urlparse import urlsplit
-    from urlparse import urlunsplit
+    from urlparse import urlsplit  # noqa
+    from urlparse import urlunsplit  # noqa
 
 if PY3:  # pragma: nocover
     ref_gettext = lambda t: t.gettext
 else:  # pragma: nocover
-    ref_gettext = lambda t: t.ugettext
+    ref_gettext = lambda t: t.ugettext  # noqa
 
 if PY3 or PY2 and PY_MINOR >= 6:  # pragma: nocover
     m = __import__('json', None, None, ['JSONEncoder', 'dumps', 'loads'])
     try:
         from simplejson import JSONEncoder as SimpleJSONEncoder
         from simplejson import dumps
-        from simplejson import loads as json_loads
+        from simplejson import loads as json_loads  # noqa
 
-        def json_dumps(obj, **kw):
+        def json_dumps(obj, **kw):  # noqa
             return dumps(obj, use_decimal=False, **kw)
     except ImportError:
-        SimpleJSONEncoder = object
+        SimpleJSONEncoder = object  # noqa
 
-        def json_dumps(obj, **kw):
+        def json_dumps(obj, **kw):  # noqa
             raise NotImplementedError('JSON encoder is required.')
 
-        def json_loads(s, **kw):
+        def json_loads(s, **kw):  # noqa
             raise NotImplementedError('JSON decoder is required.')

src/wheezy/core/i18n.py

 """ ``i18n`` module.
 """
 
+import gettext
 import os
 import os.path
-import gettext
 
 from wheezy.core.comp import defaultdict
-from wheezy.core.comp import ref_gettext  # pyflakes:ignore
+from wheezy.core.comp import ref_gettext
 
 
+assert ref_gettext
 null_translations = gettext.NullTranslations()
 
 

src/wheezy/core/introspection.py

 import warnings
 
 from inspect import getargspec
-from inspect import isclass
 from inspect import isfunction
 
 from wheezy.core.comp import __import__
-from wheezy.core.descriptors import attribute
 
 
 def import_name(fullname):

src/wheezy/core/tests/test_introspection.py

 
             assert looks(Foo).like(IFoo, ignore_argspec='foo')
 
-        def test_decorator(self):
-            """ Tests if there any method decorators corresponds.
+        def test_property(self):
+            """ Tests if there any @property corresponds.
             """
             from wheezy.core.introspection import looks
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.