diff options
| author | Sviatoslav Sydorenko <wk@sydorenko.org.ua> | 2016-09-08 13:52:21 +0300 |
|---|---|---|
| committer | Sviatoslav Sydorenko <wk@sydorenko.org.ua> | 2016-09-08 13:52:21 +0300 |
| commit | 836617a45a97a881775c10477f8bc72c553338ae (patch) | |
| tree | 85b0307127b3c5ca45cdb065a9661886ef971915 /cherrypy/tutorial | |
| parent | c06aa3ff9cd0dd7a2c7eb994c7ae27b54851babb (diff) | |
| download | cherrypy-git-836617a45a97a881775c10477f8bc72c553338ae.tar.gz | |
Finally fix E402 for tutorial/tut*.py
Diffstat (limited to 'cherrypy/tutorial')
| -rw-r--r-- | cherrypy/tutorial/tut01_helloworld.py | 3 | ||||
| -rw-r--r-- | cherrypy/tutorial/tut02_expose_methods.py | 3 | ||||
| -rw-r--r-- | cherrypy/tutorial/tut03_get_and_post.py | 3 | ||||
| -rw-r--r-- | cherrypy/tutorial/tut04_complex_site.py | 3 | ||||
| -rw-r--r-- | cherrypy/tutorial/tut05_derived_objects.py | 3 | ||||
| -rw-r--r-- | cherrypy/tutorial/tut06_default_method.py | 3 | ||||
| -rw-r--r-- | cherrypy/tutorial/tut07_sessions.py | 3 | ||||
| -rw-r--r-- | cherrypy/tutorial/tut08_generators_and_yield.py | 3 | ||||
| -rw-r--r-- | cherrypy/tutorial/tut09_files.py | 7 | ||||
| -rw-r--r-- | cherrypy/tutorial/tut10_http_errors.py | 7 |
10 files changed, 24 insertions, 14 deletions
diff --git a/cherrypy/tutorial/tut01_helloworld.py b/cherrypy/tutorial/tut01_helloworld.py index aaf89fd9..9ee427b3 100644 --- a/cherrypy/tutorial/tut01_helloworld.py +++ b/cherrypy/tutorial/tut01_helloworld.py @@ -4,6 +4,8 @@ Tutorial - Hello World The most basic (working) CherryPy application possible. """ +import os.path + # Import CherryPy global namespace import cherrypy @@ -23,7 +25,6 @@ class HelloWorld: return "Hello world!" -import os.path tutconf = os.path.join(os.path.dirname(__file__), 'tutorial.conf') if __name__ == '__main__': diff --git a/cherrypy/tutorial/tut02_expose_methods.py b/cherrypy/tutorial/tut02_expose_methods.py index d9e07cbf..2b4a8649 100644 --- a/cherrypy/tutorial/tut02_expose_methods.py +++ b/cherrypy/tutorial/tut02_expose_methods.py @@ -5,6 +5,8 @@ This tutorial shows you how to link to other methods of your request handler. """ +import os.path + import cherrypy @@ -20,7 +22,6 @@ class HelloWorld: # Here's the important message! return "Hello world!" -import os.path tutconf = os.path.join(os.path.dirname(__file__), 'tutorial.conf') if __name__ == '__main__': diff --git a/cherrypy/tutorial/tut03_get_and_post.py b/cherrypy/tutorial/tut03_get_and_post.py index 38b42e6b..0b3d4613 100644 --- a/cherrypy/tutorial/tut03_get_and_post.py +++ b/cherrypy/tutorial/tut03_get_and_post.py @@ -4,6 +4,8 @@ Tutorial - Passing variables This tutorial shows you how to pass GET/POST variables to methods. """ +import os.path + import cherrypy @@ -40,7 +42,6 @@ class WelcomePage: return 'No, really, enter your name <a href="./">here</a>.' -import os.path tutconf = os.path.join(os.path.dirname(__file__), 'tutorial.conf') if __name__ == '__main__': diff --git a/cherrypy/tutorial/tut04_complex_site.py b/cherrypy/tutorial/tut04_complex_site.py index 6f8654af..3caa1775 100644 --- a/cherrypy/tutorial/tut04_complex_site.py +++ b/cherrypy/tutorial/tut04_complex_site.py @@ -5,6 +5,8 @@ This tutorial shows you how to create a site structure through multiple possibly nested request handler objects. """ +import os.path + import cherrypy @@ -92,7 +94,6 @@ root.links = LinksPage() # creating all contained request handler objects. -import os.path tutconf = os.path.join(os.path.dirname(__file__), 'tutorial.conf') if __name__ == '__main__': diff --git a/cherrypy/tutorial/tut05_derived_objects.py b/cherrypy/tutorial/tut05_derived_objects.py index 647fac56..f626e03f 100644 --- a/cherrypy/tutorial/tut05_derived_objects.py +++ b/cherrypy/tutorial/tut05_derived_objects.py @@ -7,6 +7,8 @@ want to create a central base class used for all your pages, which takes care of things like printing a common page header and footer. """ +import os.path + import cherrypy @@ -69,7 +71,6 @@ class AnotherPage(Page): ''' + self.footer() -import os.path tutconf = os.path.join(os.path.dirname(__file__), 'tutorial.conf') if __name__ == '__main__': diff --git a/cherrypy/tutorial/tut06_default_method.py b/cherrypy/tutorial/tut06_default_method.py index 24f839d7..8188d84c 100644 --- a/cherrypy/tutorial/tut06_default_method.py +++ b/cherrypy/tutorial/tut06_default_method.py @@ -16,6 +16,8 @@ like /users/<username>. Since the <username> bit will not be found (as there are no matching methods), it is handled by the default method. """ +import os.path + import cherrypy @@ -50,7 +52,6 @@ class UsersPage: return '%s (<a href="./">back</a>)' % out -import os.path tutconf = os.path.join(os.path.dirname(__file__), 'tutorial.conf') if __name__ == '__main__': diff --git a/cherrypy/tutorial/tut07_sessions.py b/cherrypy/tutorial/tut07_sessions.py index e6d31540..204322b5 100644 --- a/cherrypy/tutorial/tut07_sessions.py +++ b/cherrypy/tutorial/tut07_sessions.py @@ -8,6 +8,8 @@ any kind of object into that dictionary; otherwise, you are limited to objects that can be pickled. """ +import os.path + import cherrypy @@ -30,7 +32,6 @@ class HitCounter: ''' % count -import os.path tutconf = os.path.join(os.path.dirname(__file__), 'tutorial.conf') if __name__ == '__main__': diff --git a/cherrypy/tutorial/tut08_generators_and_yield.py b/cherrypy/tutorial/tut08_generators_and_yield.py index 8c4fe839..709051dd 100644 --- a/cherrypy/tutorial/tut08_generators_and_yield.py +++ b/cherrypy/tutorial/tut08_generators_and_yield.py @@ -7,6 +7,8 @@ in situations where using a template package like CherryPy or Cheetah would be overkill, and messy string concatenation too uncool. ;-) """ +import os.path + import cherrypy @@ -33,7 +35,6 @@ class GeneratorDemo: yield self.footer() -import os.path tutconf = os.path.join(os.path.dirname(__file__), 'tutorial.conf') if __name__ == '__main__': diff --git a/cherrypy/tutorial/tut09_files.py b/cherrypy/tutorial/tut09_files.py index f76c1c65..0694f614 100644 --- a/cherrypy/tutorial/tut09_files.py +++ b/cherrypy/tutorial/tut09_files.py @@ -41,12 +41,14 @@ popular browsers. """ import os -localDir = os.path.dirname(__file__) -absDir = os.path.join(os.getcwd(), localDir) +import os.path import cherrypy from cherrypy.lib import static +localDir = os.path.dirname(__file__) +absDir = os.path.join(os.getcwd(), localDir) + class FileDemo(object): @@ -94,7 +96,6 @@ class FileDemo(object): "attachment", os.path.basename(path)) -import os.path tutconf = os.path.join(os.path.dirname(__file__), 'tutorial.conf') if __name__ == '__main__': diff --git a/cherrypy/tutorial/tut10_http_errors.py b/cherrypy/tutorial/tut10_http_errors.py index c1158ce6..fcc6d733 100644 --- a/cherrypy/tutorial/tut10_http_errors.py +++ b/cherrypy/tutorial/tut10_http_errors.py @@ -9,11 +9,13 @@ logged, displayed, and formatted. """ import os -localDir = os.path.dirname(__file__) -curpath = os.path.normpath(os.path.join(os.getcwd(), localDir)) +import os.path import cherrypy +localDir = os.path.dirname(__file__) +curpath = os.path.normpath(os.path.join(os.getcwd(), localDir)) + class HTTPErrorDemo(object): @@ -73,7 +75,6 @@ class HTTPErrorDemo(object): raise cherrypy.HTTPError(500, message=message) -import os.path tutconf = os.path.join(os.path.dirname(__file__), 'tutorial.conf') if __name__ == '__main__': |
