From 24daa335b6f8e312aab2d0c83b182914e74dbaf5 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Mon, 11 Mar 2013 08:50:01 -0500 Subject: [PATCH] examples uses cookie based sessions --- VERSION | 2 +- applications/examples/controllers/global.py | 4 ---- applications/examples/controllers/simple_examples.py | 8 -------- applications/examples/controllers/spreadsheet.py | 1 - applications/examples/views/default/download.html | 4 ++-- applications/examples/views/default/examples.html | 1 - applications/examples/views/default/index.html | 4 ++-- applications/examples/views/global/vars.html | 6 +++--- applications/examples/views/spreadsheet/index.html | 6 +++++- 9 files changed, 13 insertions(+), 23 deletions(-) diff --git a/VERSION b/VERSION index a56f167b..d9e6bd40 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.4.2-stable+timestamp.2013.03.11.08.24.51 +Version 2.4.2-stable+timestamp.2013.03.11.08.49.11 diff --git a/applications/examples/controllers/global.py b/applications/examples/controllers/global.py index eaf16d21..7e56902c 100644 --- a/applications/examples/controllers/global.py +++ b/applications/examples/controllers/global.py @@ -1,9 +1,5 @@ session.forget() -response.menu = [['home', False, '/%s/default/index' - % request.application], ['docs', True, - '/%s/global/vars' % request.application]] - def get(args): if args[0].startswith('__'): return None diff --git a/applications/examples/controllers/simple_examples.py b/applications/examples/controllers/simple_examples.py index 046652e3..425470ff 100644 --- a/applications/examples/controllers/simple_examples.py +++ b/applications/examples/controllers/simple_examples.py @@ -54,13 +54,6 @@ def raisehttp(): raise HTTP(400, 'internal error') -def raiseexception(): - """ generates an exeption, logs the event and returns a ticket number """ - - 1 / 0 - return 'oops' - - def servejs(): """ serves a js document """ @@ -69,7 +62,6 @@ def servejs(): gluon.contenttype.contenttype('.js') return 'alert("This is a Javascript document, it is not supposed to run!");' - def makejson(): import gluon.contrib.simplejson as sj return sj.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}]) diff --git a/applications/examples/controllers/spreadsheet.py b/applications/examples/controllers/spreadsheet.py index f46df702..90868c99 100644 --- a/applications/examples/controllers/spreadsheet.py +++ b/applications/examples/controllers/spreadsheet.py @@ -1,6 +1,5 @@ from gluon.contrib.spreadsheet import Sheet - def callback(): return cache.ram('sheet1', lambda: None, None).process(request) diff --git a/applications/examples/views/default/download.html b/applications/examples/views/default/download.html index a6cef5e5..0b96db05 100644 --- a/applications/examples/views/default/download.html +++ b/applications/examples/views/default/download.html @@ -25,12 +25,12 @@ Source Code Source Code - Source Code Docs + Epydoc + Manual Change Log Report a Bug - diff --git a/applications/examples/views/default/examples.html b/applications/examples/views/default/examples.html index 778b68dc..adbb4840 100644 --- a/applications/examples/views/default/examples.html +++ b/applications/examples/views/default/examples.html @@ -119,7 +119,6 @@ def raiseexception(): return 'oops' """.strip(),language='web2py',link=URL('global','vars'),_class='boxCode')}}

If an exception occurs (other than HTTP) a ticket is generated and the event is logged for the administrator. These tickets and logs can be accessed, reviewed and deleted at any later time. -
Try it here: raiseexception

Example {{=c}}{{c+=1}}

In controller: simple_examples.py {{=CODE(""" diff --git a/applications/examples/views/default/index.html b/applications/examples/views/default/index.html index 4d32a63f..7fa52397 100644 --- a/applications/examples/views/default/index.html +++ b/applications/examples/views/default/index.html @@ -17,7 +17,7 @@ random.shuffle(quotes)

web2pyTM Web Framework

-

Free open source full-stack framework for rapid development of fast, scalable, secure and portable database-driven web-based applications. Written and programmable in Python. LGPLv3 License.

+

Free open source full-stack framework for rapid development of fast, scalable, secure and portable database-driven web-based applications. Written and programmable in Python.

@@ -37,7 +37,7 @@ random.shuffle(quotes)
-

Current version: {{=request.env.web2py_version}}

+

Current version: {{=request.env.web2py_version}} (LGPLv3 License)


diff --git a/applications/examples/views/global/vars.html b/applications/examples/views/global/vars.html index f0806fe6..10c4ec94 100644 --- a/applications/examples/views/global/vars.html +++ b/applications/examples/views/global/vars.html @@ -19,7 +19,7 @@
{{pass}} - {{if doc:}}

{{=CODE(str(doc),language=None,counter=None,_class='boxCode')}}{{pass}} + {{if doc:}}

{{=MARKMIN(doc)}}{{pass}}

{{if attributes:}} @@ -32,7 +32,7 @@ {{if key.count('.')<2:}} - {{=A(key,_href=URL(args=key.split('.')))}} + {{=A(key,_rel="nofollow",_href=URL(args=key.split('.')))}} {{else:}} {{=key}} {{pass}} @@ -43,7 +43,7 @@ {{if c1:}} belongs to class {{=c1}}{{pass}}
{{pass}} - {{if doc1:}}{{=XML(cgi.escape(str(doc1)).replace(chr(13),'
'))}}{{pass}} + {{if doc1:}}{{=MARKMIN(doc1)}}{{pass}}
diff --git a/applications/examples/views/spreadsheet/index.html b/applications/examples/views/spreadsheet/index.html index c1fb8560..dc7e2e6f 100644 --- a/applications/examples/views/spreadsheet/index.html +++ b/applications/examples/views/spreadsheet/index.html @@ -1,5 +1,9 @@ {{extend 'layout.html'}} - +

Excel-like spreadsheet widget

Try insert "=r0c1+1" in cell r0c0 and "2" in r0c1. Formulas start with "=" as in Excel. You can use a subset of python commands and math function, and reference cells by r[row]c[col]. All computations are performed serverside via Ajax (input is validated for security). Cell values and formulas can be set and locked serverside. The shape of the spreadsheet can be modifed serverside and does not need to be tabular (think of it as a graph of css-friendly widgets you can place where you want). Cells can be given arbistrary names. This example is distributed with web2py so look at the source code of the example to learn more.