Andriy Kornatskyy avatar Andriy Kornatskyy committed 330dcb5

Introduced make target qa; fixed issues reported.

Comments (0)

Files changed (9)

-.SILENT: clean env doctest-cover test doc release upload
-.PHONY: clean env doctest-cover test doc release upload
+.SILENT: clean env doctest-cover qa test doc release upload
+.PHONY: clean env 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 demos doc src setup.py && \
+		pep8 demos doc src setup.py ; \
+	fi
+
 test:
 	if [ "$$(echo $(VERSION) | sed 's/\.//')" -lt 30 ]; then \
 		$(PYTEST) -q -x --pep8 --doctest-modules \

demos/time/config.py

 """
 
 from wheezy.routing import PathRouter
-from wheezy.routing import url
 
 
 router = PathRouter()

demos/time/urls.py

 """ ``urls`` module.
 """
 
-from config import url
+from wheezy.routing import url
 from views import welcome, server_time, not_found
 
 server_urls = [
 # wheezy.routing 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.
 # All configuration values have a default; values that are commented out
 # serve to show the default.
 
-import sys, os
+import os
+import sys
 
 # If extensions (or modules to document with autodoc) are in another directory,
 # add these directories to sys.path here. If the directory is relative to the
 # documentation root, use os.path.abspath to make it absolute, like shown here.
 #sys.path.insert(0, os.path.abspath('.'))
 sys.path.insert(
-	0,
-	os.path.abspath(os.path.join('..', 'src'))
+    0,
+    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.
     'codetextcolor': '#060',
     'bodyfont': 'Georgia, serif',
     'headfont': 'Calibri, sans-serif',
-	'stickysidebar': True,
-	'externalrefs': True
+    'stickysidebar': True,
+    'externalrefs': True
 }
 
 # Add any paths that contain custom themes here, relative to this directory.
 htmlhelp_basename = 'wheezy.routingdoc'
 
 
-# -- 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.routing.tex', u'wheezy.routing Documentation',
-   u'Andriy Kornatskyy', 'manual'),
+    ('index', 'wheezy.routing.tex', u'wheezy.routing Documentation',
+     u'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).
 
 Server `time`_ application consists of two screens. The first one has a link
 to the second that shows the time on server. The second page will be mapped
-as a separate application with its own routing. The disign used in this
-sample is moular. Let's start with ``config`` module. The only thing we
-need here is an instance of ``Route``.
+as a separate application with its own routing. The design used in this
+sample is modular. Let's start with ``config`` module. The only thing we
+need here is an instance of ``PathRouter``.
 
 .. literalinclude:: ../demos/time/config.py
-   :lines: 5-9
+   :lines: 5-8
 
 ``view`` module is pretty straight: a ``welcome`` view with a link to
 ``server_time`` view. The server time page returns server time. And finally
 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()
 

src/wheezy/routing/__init__.py

 """ ``routing`` package.
 """
 
+# flake8: noqa
+
 from wheezy.routing.router import PathRouter
 from wheezy.routing.router import url

src/wheezy/routing/comp.py

 else:  # pragma: nocover
     basestring = basestring
 
-    def ntob(n, encoding):
+    def ntob(n, encoding):  # noqa
         """ Converts native string to bytes
         """
         return n

src/wheezy/routing/config.py

 from wheezy.routing.curly import patterns as curly_patterns
 from wheezy.routing.curly import default_pattern as curly_default_pattern
 
+assert curly_default_pattern
+assert curly_patterns
+
 route_builders = [
     try_build_plain_route,
     try_build_curly_route,
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.