Commits

Andriy Kornatskyy committed 2b9d4e8

Introduced make target qa; fixed issues reported.

Comments (0)

Files changed (6)

-.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:
 	$(PYTEST) -q -x --pep8 --doctest-modules \
 		src/wheezy/http
 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/http/__init__.py

 """ ``http`` package.
 """
 
+# flake8: noqa
+
 from wheezy.http.application import WSGIApplication
 from wheezy.http.authorization import secure
 from wheezy.http.cache import response_cache

src/wheezy/http/comp.py

     b = lambda s: s.encode('latin1')
 
 else:  # pragma: nocover
-    from cStringIO import StringIO as BytesIO
+    from cStringIO import StringIO as BytesIO  # noqa
     bytes_type = str
     str_type = unicode
 
-    def n(s, encoding='latin1'):
+    def n(s, encoding='latin1'):  # noqa
         if isinstance(s, bytes_type):
             return s
         return s.encode(encoding)
 
-    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
 if PY3:  # pragma: nocover
     from http.cookies import SimpleCookie
 else:  # pragma: nocover
-    from Cookie import SimpleCookie
+    from Cookie import SimpleCookie  # noqa
 
 
 if PY3:  # pragma: nocover
     def parse_qs(qs, encoding):
         return _parse_qs(qs, keep_blank_values=True, encoding=encoding)
 else:  # pragma: nocover
-    from urllib import urlencode
+    from urllib import urlencode  # noqa
     try:
         # Python 2.6+
-        from urlparse import parse_qs as _parse_qs
+        from urlparse import parse_qs as _parse_qs  # noqa
     except ImportError:  # pragma: nocover
         # Python 2.5, 2.4
-        from cgi import parse_qs as _parse_qs
+        from cgi import parse_qs as _parse_qs  # noqa
 
-    def parse_qs(qs, encoding):
+    def parse_qs(qs, encoding):  # noqa
         return _parse_qs(qs, keep_blank_values=True)
 
 

src/wheezy/http/functional.py

     if PY3:  # pragma: nocover
         from html.parser import HTMLParser
     else:  # pragma: nocover
-        from HTMLParser import HTMLParser
+        from HTMLParser import HTMLParser  # noqa
 
     class HTMLParserAdapter(HTMLParser):
 

src/wheezy/http/transforms.py

         if len(transforms) == 1:
             transform = transforms[0]
 
-            def strategy(request, *args, **kwargs):
+            def single(request, *args, **kwargs):
                 return transform(
                     request,
                     factory(request, *args, **kwargs))
+            return single
         else:
-            def strategy(request, *args, **kwargs):
+            def multi(request, *args, **kwargs):
                 response = factory(request, *args, **kwargs)
                 for transform in transforms:
                     response = transform(request, response)
                 return response
-        return strategy
+            return multi
     return decorate
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.