From 1cb30e690a7ba97db212e7ec9002fd83f950b0bd Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 23 Apr 2016 02:45:04 -0700 Subject: Fix all the stinky linkie rot via `make linkcheck SPHINXBUILD=$VENV/bin/sphinx-build`, but don't bother with HISTORY.txt or whatsnew-xx --- docs/designdefense.rst | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) (limited to 'docs/designdefense.rst') diff --git a/docs/designdefense.rst b/docs/designdefense.rst index 5f3295305..3c1046b82 100644 --- a/docs/designdefense.rst +++ b/docs/designdefense.rst @@ -131,7 +131,7 @@ obvious. First, what's a "utility"? Well, for the purposes of this discussion, and for the purpose of the code above, it's just not very important. If you really want to know, you can read `this -`_. However, still, readers +`_. However, still, readers of such code need to understand the concept in order to parse it. This is problem number one. @@ -665,7 +665,7 @@ desktop GUI platforms by using similar terminology, and to provide some frame of reference for how various components in the common web framework might hang together. But in the opinion of the author, "MVC" doesn't match the web very well in general. Quoting from the `Model-View-Controller Wikipedia entry -`_: +`_: Though MVC comes in different flavors, control flow is generally as follows: @@ -847,9 +847,9 @@ Challenge +++++++++ :app:`Pyramid` performs automatic authorization checks only at :term:`view` -execution time. Zope 3 wraps context objects with a `security proxy -`_, which causes Zope 3 also -to do security checks during attribute access. I like this, because it means: +execution time. Zope 3 wraps context objects with a security proxy, which +causes Zope 3 also to do security checks during attribute access. I like this, +because it means: #) When I use the security proxy machinery, I can have a view that conditionally displays certain HTML elements (like form fields) or @@ -1006,16 +1006,18 @@ the following: Microframeworks have smaller Hello World programs ------------------------------------------------- -Self-described "microframeworks" exist. `Bottle `_ and -`Flask `_ are two that are becoming popular. `Bobo -`_ doesn't describe itself as a microframework, but -its intended user base is much the same. Many others exist. We've even (only as -a teaching tool, not as any sort of official project) `created one using -Pyramid `_. The videos use BFG, -a precursor to Pyramid, but the resulting code is `available for Pyramid too -`_). Microframeworks are small frameworks -with one common feature: each allows its users to create a fully functional -application that lives in a single Python file. +Self-described "microframeworks" exist. `Bottle +`_ and `Flask +`_ are two that are becoming popular. `Bobo +`_ doesn't describe itself as a +microframework, but its intended user base is much the same. Many others exist. +We've even (only as a teaching tool, not as any sort of official project) +`created one using Pyramid `_. +The videos use BFG, a precursor to Pyramid, but the resulting code is +`available for Pyramid too `_). +Microframeworks are small frameworks with one common feature: each allows its +users to create a fully functional application that lives in a single Python +file. Some developers and microframework authors point out that Pyramid's "hello world" single-file program is longer (by about five lines) than the equivalent @@ -1430,9 +1432,9 @@ object which *is not logically global*: # this is executed if the request method was GET or the # credentials were invalid -The `Pylons 1.X `_ web framework uses a similar -strategy. It calls these things "Stacked Object Proxies", so, for purposes -of this discussion, I'll do so as well. +The `Pylons 1.X `_ +web framework uses a similar strategy. It calls these things "Stacked Object +Proxies", so, for purposes of this discussion, I'll do so as well. Import statements in Python (``import foo``, ``from bar import baz``) are most frequently performed to obtain a reference to an object defined globally @@ -1701,5 +1703,6 @@ Other Challenges ---------------- Other challenges are encouraged to be sent to the `Pylons-devel -`_ maillist. We'll try to address -them by considering a design change, or at very least via exposition here. +`_ maillist. We'll try +to address them by considering a design change, or at very least via exposition +here. -- cgit v1.2.3 From f7d515de86ad1ceab1b330cf1d95257b712b2659 Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Wed, 27 Apr 2016 21:01:28 -0500 Subject: fix bugs in design defense code examples fixes #2287 --- docs/designdefense.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'docs/designdefense.rst') diff --git a/docs/designdefense.rst b/docs/designdefense.rst index 3c1046b82..70dbbe720 100644 --- a/docs/designdefense.rst +++ b/docs/designdefense.rst @@ -1297,12 +1297,12 @@ Consider the following simple `Groundhog from groundhog import Groundhog app = Groundhog('myapp', 'seekrit') - app.route('/admin') + @app.route('/admin') def admin(): return 'admin page' - app.route('/:action') - def action(): + @app.route('/:action') + def do_action(action): if action == 'add': return 'add' if action == 'delete': @@ -1322,15 +1322,15 @@ order of the function definitions in the file? from groundhog import Groundhog app = Groundhog('myapp', 'seekrit') - app.route('/:action') - def action(): + @app.route('/:action') + def do_action(action): if action == 'add': return 'add' if action == 'delete': return 'delete' return app.abort(404) - app.route('/admin') + @app.route('/admin') def admin(): return 'admin page' -- cgit v1.2.3 From 1ce7fe71a238a2a735d49597232bc1fc240f5eeb Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 7 May 2016 02:03:38 -0700 Subject: fix typo --- docs/designdefense.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/designdefense.rst') diff --git a/docs/designdefense.rst b/docs/designdefense.rst index 70dbbe720..51c3c5bd8 100644 --- a/docs/designdefense.rst +++ b/docs/designdefense.rst @@ -608,7 +608,7 @@ pyramid/scaffolds/ 133KB -pyramid/ (except for ``pyramd/tests`` and ``pyramid/scaffolds``) +pyramid/ (except for ``pyramid/tests`` and ``pyramid/scaffolds``) 812KB -- cgit v1.2.3 From 2b50258d4f7771b4a52a0170733186b3fc4e9b7b Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sun, 8 May 2016 12:27:24 -0700 Subject: pylons != pyramid --- docs/designdefense.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs/designdefense.rst') diff --git a/docs/designdefense.rst b/docs/designdefense.rst index 51c3c5bd8..e759c0e2a 100644 --- a/docs/designdefense.rst +++ b/docs/designdefense.rst @@ -1432,7 +1432,8 @@ object which *is not logically global*: # this is executed if the request method was GET or the # credentials were invalid -The `Pylons 1.X `_ +The `Pylons 1.X +`_ web framework uses a similar strategy. It calls these things "Stacked Object Proxies", so, for purposes of this discussion, I'll do so as well. -- cgit v1.2.3 From 8eb4e184c05ac1822a0ce1986bde1ad4410a9322 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 14 May 2016 23:58:11 -0700 Subject: fix IRC link and page count --- docs/designdefense.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'docs/designdefense.rst') diff --git a/docs/designdefense.rst b/docs/designdefense.rst index e759c0e2a..dbdb53b8d 100644 --- a/docs/designdefense.rst +++ b/docs/designdefense.rst @@ -1653,10 +1653,11 @@ If you can understand this hello world program, you can use Pyramid: server = make_server('0.0.0.0', 8080, app) server.serve_forever() -Pyramid has ~ 700 pages of documentation (printed), covering topics from the -very basic to the most advanced. *Nothing* is left undocumented, quite +Pyramid has about 800 pages of documentation (printed), covering topics from +the very basic to the most advanced. *Nothing* is left undocumented, quite literally. It also has an *awesome*, very helpful community. Visit the -#pyramid IRC channel on freenode.net (irc://freenode.net#pyramid) and see. +`#pyramid IRC channel on freenode.net +`_ and see. Hate Zope +++++++++ -- cgit v1.2.3 From b8dd44f39d4372abfff503904cda94f2030128d7 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sun, 15 May 2016 03:01:16 -0700 Subject: fix page count --- docs/designdefense.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/designdefense.rst') diff --git a/docs/designdefense.rst b/docs/designdefense.rst index dbdb53b8d..f42582e47 100644 --- a/docs/designdefense.rst +++ b/docs/designdefense.rst @@ -1653,7 +1653,7 @@ If you can understand this hello world program, you can use Pyramid: server = make_server('0.0.0.0', 8080, app) server.serve_forever() -Pyramid has about 800 pages of documentation (printed), covering topics from +Pyramid has over 1200 pages of documentation (printed), covering topics from the very basic to the most advanced. *Nothing* is left undocumented, quite literally. It also has an *awesome*, very helpful community. Visit the `#pyramid IRC channel on freenode.net -- cgit v1.2.3