10 |
11 |
--------------------------------------------------------------------------------
/apps/welcome_legacy/LICENSE:
--------------------------------------------------------------------------------
1 | The web2py welcome app is licensed under public domain
2 | (except for the css and js files that it includes, which have their own third party licenses).
3 |
4 | You can modify this license when you add your own code.
5 |
--------------------------------------------------------------------------------
/apps/admin/ABOUT:
--------------------------------------------------------------------------------
1 | web2py is an open source full-stack framework for agile development
2 | of secure database-driven web-based applications, written and programmable in
3 | Python.
4 |
5 | Created by Massimo Di Pierro
6 |
7 |
--------------------------------------------------------------------------------
/apps/admin/views/default/delete.html:
--------------------------------------------------------------------------------
1 | {{extend 'layout.html'}}
2 |
3 | {{block sectionclass}}delete{{end}}
4 |
5 |
{{=T('Are you sure you want to delete file "%s"?', filename)}}
{{=T('ATTENTION:')}} {{=T('This is an experimental feature and it needs more testing. If you decide to upgrade you do it at your own risk')}}
8 | {{=T('If start the upgrade, be patient, it may take a while to download')}}
9 |
10 |
--------------------------------------------------------------------------------
/apps/admin/views/generic.html:
--------------------------------------------------------------------------------
1 | {{extend 'layout.html'}}
2 | {{"""
3 |
4 | You should not modify this file.
5 | It is used as default when a view is not provided for your controllers
6 |
7 | """}}
8 |
{{=' '.join(x.capitalize() for x in request.function.split('_'))}}
9 | {{if len(response._vars)==1:}}
10 | {{=BEAUTIFY(response._vars.values()[0])}}
11 | {{elif len(response._vars)>1:}}
12 | {{=BEAUTIFY(response._vars)}}
13 | {{pass}}
14 | {{if request.is_local:}}
15 | {{=response.toolbar()}}
16 | {{pass}}
17 |
--------------------------------------------------------------------------------
/apps/welcome_legacy/views/generic.html:
--------------------------------------------------------------------------------
1 | {{extend 'layout.html'}}
2 | {{"""
3 |
4 | You should not modify this file.
5 | It is used as default when a view is not provided for your controllers
6 |
7 | """}}
8 |
{{=' '.join(x.capitalize() for x in request.function.split('_'))}}
{{=T('ATTENTION:')}} {{=T('This is an experimental feature and it needs more testing. If you decide to upgrade you do it at your own risk')}}
8 | {{=T('If start the upgrade, be patient, it may take a while to download')}}
14 |
15 |
--------------------------------------------------------------------------------
/contrib/plural_rules/hi.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding: utf8 -*-
3 | # Plural-Forms for he (Hindi)
4 |
5 | nplurals=2 # Hindi has 2 forms:
6 | # 1 singular and 1 plural
7 |
8 | # Determine plural_id for number *n* as sequence of positive
9 | # integers: 0,1,...
10 | # NOTE! For singular form ALWAYS return plural_id = 0
11 | get_plural_id = lambda n: int(n != 1)
12 |
13 | # Construct and return plural form of *word* using
14 | # *plural_id* (which ALWAYS>0). This function will be executed
15 | # for words (or phrases) not found in plural_dict dictionary
16 | # construct_plural_form = lambda word, plural_id: (word + 'suffix')
17 |
18 |
--------------------------------------------------------------------------------
/apps/admin/views/default.mobile/downgrade_web2py.html:
--------------------------------------------------------------------------------
1 | {{extend 'default.mobile/layout.html'}}
2 |
3 | {{block sectionclass}}upgrade{{end}}
4 |
5 |
{{=T('web2py downgrade')}}
6 |
7 |
{{=T('ATTENTION:')}} {{=T('This is an experimental feature and it needs more testing. If you decide to downgrade you do it at your own risk')}}
8 | {{=T('If start the downgrade, be patient, it may take a while to rollback')}}
5 |
6 | {{if request.is_https or request.is_local:}}
7 |
8 |
16 |
17 | {{else:}}
18 |
{{=T('ATTENTION: Login requires a secure (HTTPS) connection or running on localhost.')}}
19 | {{pass}}
20 |
--------------------------------------------------------------------------------
/contrib/plural_rules/ru.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding: utf8 -*-
3 | # Plural-Forms for ru (Russian)
4 |
5 | nplurals=3 # Russian language has 3 forms:
6 | # 1 singular and 2 plurals
7 |
8 | # Determine plural_id for number *n* as sequence of positive
9 | # integers: 0,1,...
10 | # NOTE! For singular form ALWAYS return plural_id = 0
11 | get_plural_id = lambda n: (0 if n % 10 == 1 and n % 100 != 11 else
12 | 1 if n % 10 >= 2 and n % 10 <= 4 and
13 | (n % 100 < 10 or n % 100 >= 20) else
14 | 2)
15 |
16 | # construct_plural_form() is not used now because of complex
17 | # rules of Russian language. Default version of
18 | # this function is used to simple insert new words into
19 | # plural_dict dictionary)
20 | # construct_plural_form = lambda word, plural_id: word
21 |
--------------------------------------------------------------------------------
/contrib/plural_rules/sk.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding: utf8 -*-
3 | # Plural-Forms for sk (Slovak (Slovakia))
4 |
5 | nplurals=3 # Slovak language has 3 forms:
6 | # 1 singular and 2 plurals
7 |
8 | # Determine plural_id for number *n* as sequence of positive
9 | # integers: 0,1,...
10 | # NOTE! For singular form ALWAYS return plural_id = 0
11 | get_plural_id = lambda n: (0 if n % 10 == 1 and n % 100 != 11 else
12 | 1 if n % 10 >= 2 and n % 10 <= 4 and
13 | (n % 100 < 10 or n % 100 >= 20) else
14 | 2)
15 |
16 | # construct_plural_form() is not used now because of complex
17 | # rules of Slovak language. Default version of this function
18 | # is used to simple insert new words into plural_dict dictionary)
19 | # construct_plural_form = lambda word, plural_id: word
20 |
21 |
--------------------------------------------------------------------------------
/contrib/plural_rules/uk.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding: utf8 -*-
3 | # Plural-Forms for uk (Ukrainian)
4 |
5 | nplurals=3 # Ukrainian language has 3 forms:
6 | # 1 singular and 2 plurals
7 |
8 | # Determine plural_id for number *n* as sequence of positive
9 | # integers: 0,1,...
10 | # NOTE! For singular form ALWAYS return plural_id = 0
11 | get_plural_id = lambda n: (0 if n % 10 == 1 and n % 100 != 11 else
12 | 1 if n % 10 >= 2 and n % 10 <= 4 and
13 | (n % 100 < 10 or n % 100 >= 20) else
14 | 2)
15 |
16 | # construct_plural_form() is not used now because of complex
17 | # rules of Ukrainian language. Default version of
18 | # this function is used to simple insert new words into
19 | # plural_dict dictionary)
20 | # construct_plural_form = lambda word, plural_id: word
21 |
22 |
--------------------------------------------------------------------------------
/apps/admin/views/mercurial/commit.html:
--------------------------------------------------------------------------------
1 | {{extend 'layout.html'}}
2 | {{import time}}
3 |
4 |
Mercurial Version Control System Interface
5 | for application "{{=request.args[0]}}"
6 |
7 | {{for controller in sorted(controllers):}}
8 |
9 |
Testing controller "{{=controller}}"...
10 |
11 |
12 |
15 | {{pass}}
16 |
17 |
{{=T("""If the report above contains a ticket number it indicates a failure in executing the controller, before any attempt to execute the doctests. This is usually due to an indentation error or an error outside function code.
18 | A green title indicates that all tests (if defined) passed. In this case test results are not shown.""")}}
19 |
{{=T('Functions with no doctests will result in [passed] tests.')}}
20 |
{{=T('ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.')}}
6 |
7 | {{for controller in sorted(controllers):}}
8 |
9 |
Testing controller "{{=controller}}"...
10 |
11 |
12 |
15 | {{pass}}
16 |
17 |
{{=T("""If the report above contains a ticket number it indicates a failure in executing the controller, before any attempt to execute the doctests. This is usually due to an indentation error or an error outside function code.
18 | A green title indicates that all tests (if defined) passed. In this case test results are not shown.""")}}
19 |
{{=T('Functions with no doctests will result in [passed] tests.')}}
20 |
{{=T('ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.')}}
21 |
22 |
--------------------------------------------------------------------------------
/apps/admin/static/codemirror/theme/cobalt.css:
--------------------------------------------------------------------------------
1 | .cm-s-cobalt { background: #002240; color: white; }
2 | .cm-s-cobalt div.CodeMirror-selected { background: #b36539 !important; }
3 | .cm-s-cobalt .CodeMirror-gutter { background: #002240; border-right: 1px solid #aaa; }
4 | .cm-s-cobalt .CodeMirror-gutter-text { color: #d0d0d0; }
5 | .cm-s-cobalt .CodeMirror-cursor { border-left: 1px solid white !important; }
6 |
7 | .cm-s-cobalt span.cm-comment { color: #08f; }
8 | .cm-s-cobalt span.cm-atom { color: #845dc4; }
9 | .cm-s-cobalt span.cm-number, .cm-s-cobalt span.cm-attribute { color: #ff80e1; }
10 | .cm-s-cobalt span.cm-keyword { color: #ffee80; }
11 | .cm-s-cobalt span.cm-string { color: #3ad900; }
12 | .cm-s-cobalt span.cm-meta { color: #ff9d00; }
13 | .cm-s-cobalt span.cm-variable-2, .cm-s-cobalt span.cm-tag { color: #9effff; }
14 | .cm-s-cobalt span.cm-variable-3, .cm-s-cobalt span.cm-def { color: white; }
15 | .cm-s-cobalt span.cm-error { color: #9d1e15; }
16 | .cm-s-cobalt span.cm-bracket { color: #d8d8d8; }
17 | .cm-s-cobalt span.cm-builtin, .cm-s-cobalt span.cm-special { color: #ff9e59; }
18 | .cm-s-cobalt span.cm-link { color: #845dc4; }
19 |
--------------------------------------------------------------------------------
/gluon/settings.py:
--------------------------------------------------------------------------------
1 | """
2 | This file is part of the web2py Web Framework
3 | Copyrighted by Massimo Di Pierro
4 | License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
5 | """
6 |
7 | import os
8 | import sys
9 | import socket
10 | import platform
11 | from web3py.storage import Storage
12 |
13 | global_settings = Storage()
14 | settings = global_settings # legacy compatibility
15 |
16 | if not hasattr(os, 'mkdir'):
17 | global_settings.db_sessions = True
18 |
19 | if global_settings.db_sessions is not True:
20 | global_settings.db_sessions = set()
21 |
22 | global_settings.gluon_parent = \
23 | os.environ.get('web2py_path', os.getcwd())
24 |
25 | global_settings.applications_parent = global_settings.gluon_parent
26 |
27 | global_settings.app_folders = set()
28 |
29 | global_settings.debugging = False
30 |
31 | global_settings.is_pypy = \
32 | hasattr(platform, 'python_implementation') and \
33 | platform.python_implementation() == 'PyPy'
34 |
35 | global_settings.is_jython = \
36 | 'java' in sys.platform.lower() or \
37 | hasattr(sys, 'JYTHON_JAR') or \
38 | str(sys.copyright).find('Jython') > 0
39 |
--------------------------------------------------------------------------------
/apps/admin/static/codemirror/theme/eclipse.css:
--------------------------------------------------------------------------------
1 | .cm-s-eclipse span.cm-meta {color: #FF1717;}
2 | .cm-s-eclipse span.cm-keyword { line-height: 1em; font-weight: bold; color: #7F0055; }
3 | .cm-s-eclipse span.cm-atom {color: #219;}
4 | .cm-s-eclipse span.cm-number {color: #164;}
5 | .cm-s-eclipse span.cm-def {color: #00f;}
6 | .cm-s-eclipse span.cm-variable {color: black;}
7 | .cm-s-eclipse span.cm-variable-2 {color: #0000C0;}
8 | .cm-s-eclipse span.cm-variable-3 {color: #0000C0;}
9 | .cm-s-eclipse span.cm-property {color: black;}
10 | .cm-s-eclipse span.cm-operator {color: black;}
11 | .cm-s-eclipse span.cm-comment {color: #3F7F5F;}
12 | .cm-s-eclipse span.cm-string {color: #2A00FF;}
13 | .cm-s-eclipse span.cm-string-2 {color: #f50;}
14 | .cm-s-eclipse span.cm-error {color: #f00;}
15 | .cm-s-eclipse span.cm-qualifier {color: #555;}
16 | .cm-s-eclipse span.cm-builtin {color: #30a;}
17 | .cm-s-eclipse span.cm-bracket {color: #cc7;}
18 | .cm-s-eclipse span.cm-tag {color: #170;}
19 | .cm-s-eclipse span.cm-attribute {color: #00c;}
20 | .cm-s-eclipse span.cm-link {color: #219;}
21 |
22 | .cm-s-eclipse .CodeMirror-matchingbracket {
23 | border:1px solid grey;
24 | color:black !important;;
25 | }
26 |
--------------------------------------------------------------------------------
/apps/admin/static/codemirror/mode/python/LICENSE.txt:
--------------------------------------------------------------------------------
1 | The MIT License
2 |
3 | Copyright (c) 2010 Timothy Farrell
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
--------------------------------------------------------------------------------
/apps/admin/static/codemirror/theme/night.css:
--------------------------------------------------------------------------------
1 | /* Loosely based on the Midnight Textmate theme */
2 |
3 | .cm-s-night { background: #0a001f; color: #f8f8f8; }
4 | .cm-s-night div.CodeMirror-selected { background: #447 !important; }
5 | .cm-s-night .CodeMirror-gutter { background: #0a001f; border-right: 1px solid #aaa; }
6 | .cm-s-night .CodeMirror-gutter-text { color: #f8f8f8; }
7 | .cm-s-night .CodeMirror-cursor { border-left: 1px solid white !important; }
8 |
9 | .cm-s-night span.cm-comment { color: #6900a1; }
10 | .cm-s-night span.cm-atom { color: #845dc4; }
11 | .cm-s-night span.cm-number, .cm-s-night span.cm-attribute { color: #ffd500; }
12 | .cm-s-night span.cm-keyword { color: #599eff; }
13 | .cm-s-night span.cm-string { color: #37f14a; }
14 | .cm-s-night span.cm-meta { color: #7678e2; }
15 | .cm-s-night span.cm-variable-2, .cm-s-night span.cm-tag { color: #99b2ff; }
16 | .cm-s-night span.cm-variable-3, .cm-s-night span.cm-def { color: white; }
17 | .cm-s-night span.cm-error { color: #9d1e15; }
18 | .cm-s-night span.cm-bracket { color: #8da6ce; }
19 | .cm-s-night span.cm-comment { color: #6900a1; }
20 | .cm-s-night span.cm-builtin, .cm-s-night span.cm-special { color: #ff9e59; }
21 | .cm-s-night span.cm-link { color: #845dc4; }
22 |
--------------------------------------------------------------------------------
/vars/5cd9e04ae2d4909a949f3cb327bc76f5_error.table:
--------------------------------------------------------------------------------
1 | (dp1
2 | S'remote_addr'
3 | p2
4 | (dp3
5 | S'length'
6 | p4
7 | I512
8 | sS'unique'
9 | p5
10 | I00
11 | sS'sortable'
12 | p6
13 | I4
14 | sS'sql'
15 | p7
16 | S'CHAR(512)'
17 | p8
18 | sS'notnull'
19 | p9
20 | I00
21 | sS'type'
22 | p10
23 | S'string'
24 | p11
25 | ssS'app'
26 | p12
27 | (dp13
28 | g4
29 | I512
30 | sg5
31 | I00
32 | sg6
33 | I2
34 | sg7
35 | S'CHAR(512)'
36 | p14
37 | sg9
38 | I00
39 | sg10
40 | g11
41 | ssS'traceback'
42 | p15
43 | (dp16
44 | g4
45 | I512
46 | sg5
47 | I00
48 | sg6
49 | I5
50 | sg7
51 | S'CHAR(512)'
52 | p17
53 | sg9
54 | I00
55 | sg10
56 | g11
57 | ssS'frames'
58 | p18
59 | (dp19
60 | g4
61 | I32768
62 | sg5
63 | I00
64 | sg6
65 | I6
66 | sg7
67 | S'TEXT'
68 | p20
69 | sg9
70 | I00
71 | sg10
72 | S'text'
73 | p21
74 | ssS'error_timestamp'
75 | p22
76 | (dp23
77 | g4
78 | I512
79 | sg5
80 | I00
81 | sg6
82 | I3
83 | sg7
84 | S'CHAR(512)'
85 | p24
86 | sg9
87 | I00
88 | sg10
89 | g11
90 | ssS'id'
91 | p25
92 | (dp26
93 | g4
94 | I512
95 | sg5
96 | I00
97 | sg6
98 | I1
99 | sg7
100 | S'INTEGER PRIMARY KEY AUTOINCREMENT'
101 | p27
102 | sg9
103 | I00
104 | sg10
105 | g25
106 | ss.
--------------------------------------------------------------------------------
/apps/admin/static/codemirror/mode/coffeescript/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License
2 |
3 | Copyright (c) 2011 Jeff Pickhardt
4 | Modified from the Python CodeMirror mode, Copyright (c) 2010 Timothy Farrell
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
--------------------------------------------------------------------------------
/apps/admin/static/codemirror/theme/monokai.css:
--------------------------------------------------------------------------------
1 | /* Based on Sublime Text's Monokai theme */
2 |
3 | .cm-s-monokai {background: #272822; color: #f8f8f2;}
4 | .cm-s-monokai div.CodeMirror-selected {background: #49483E !important;}
5 | .cm-s-monokai .CodeMirror-gutter {background: #272822; border-right: 0px;}
6 | .cm-s-monokai .CodeMirror-gutter-text {color: #d0d0d0;}
7 | .cm-s-monokai .CodeMirror-cursor {border-left: 1px solid #f8f8f0 !important;}
8 |
9 | .cm-s-monokai span.cm-comment {color: #75715e;}
10 | .cm-s-monokai span.cm-atom {color: #ae81ff;}
11 | .cm-s-monokai span.cm-number {color: #ae81ff;}
12 |
13 | .cm-s-monokai span.cm-property, .cm-s-monokai span.cm-attribute {color: #a6e22e;}
14 | .cm-s-monokai span.cm-keyword {color: #f92672;}
15 | .cm-s-monokai span.cm-string {color: #e6db74;}
16 |
17 | .cm-s-monokai span.cm-variable {color: #a6e22e;}
18 | .cm-s-monokai span.cm-variable-2 {color: #9effff;}
19 | .cm-s-monokai span.cm-def {color: #fd971f;}
20 | .cm-s-monokai span.cm-error {background: #f92672; color: #f8f8f0;}
21 | .cm-s-monokai span.cm-bracket {color: #f8f8f2;}
22 | .cm-s-monokai span.cm-tag {color: #f92672;}
23 | .cm-s-monokai span.cm-link {color: #ae81ff;}
24 |
25 | .cm-s-monokai .CodeMirror-matchingbracket {
26 | text-decoration: underline;
27 | color: white !important;
28 | }
29 |
--------------------------------------------------------------------------------
/apps/admin/static/codemirror/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (C) 2012 by Marijn Haverbeke
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
21 | Please note that some subdirectories of the CodeMirror distribution
22 | include their own LICENSE files, and are released under different
23 | licences.
24 |
--------------------------------------------------------------------------------
/apps/admin/static/codemirror/theme/erlang-dark.css:
--------------------------------------------------------------------------------
1 | .cm-s-erlang-dark { background: #002240; color: white; }
2 | .cm-s-erlang-dark div.CodeMirror-selected { background: #b36539 !important; }
3 | .cm-s-erlang-dark .CodeMirror-gutter { background: #002240; border-right: 1px solid #aaa; }
4 | .cm-s-erlang-dark .CodeMirror-gutter-text { color: #d0d0d0; }
5 | .cm-s-erlang-dark .CodeMirror-cursor { border-left: 1px solid white !important; }
6 |
7 | .cm-s-erlang-dark span.cm-atom { color: #845dc4; }
8 | .cm-s-erlang-dark span.cm-attribute { color: #ff80e1; }
9 | .cm-s-erlang-dark span.cm-bracket { color: #ff9d00; }
10 | .cm-s-erlang-dark span.cm-builtin { color: #eeaaaa; }
11 | .cm-s-erlang-dark span.cm-comment { color: #7777ff; }
12 | .cm-s-erlang-dark span.cm-def { color: #ee77aa; }
13 | .cm-s-erlang-dark span.cm-error { color: #9d1e15; }
14 | .cm-s-erlang-dark span.cm-keyword { color: #ffee80; }
15 | .cm-s-erlang-dark span.cm-meta { color: #50fefe; }
16 | .cm-s-erlang-dark span.cm-number { color: #ffd0d0; }
17 | .cm-s-erlang-dark span.cm-operator { color: #dd1111; }
18 | .cm-s-erlang-dark span.cm-string { color: #3ad900; }
19 | .cm-s-erlang-dark span.cm-tag { color: #9effff; }
20 | .cm-s-erlang-dark span.cm-variable { color: #50fe50; }
21 | .cm-s-erlang-dark span.cm-variable-2 { color: #ee00ee; }
22 |
--------------------------------------------------------------------------------
/apps/admin/models/buttons.py:
--------------------------------------------------------------------------------
1 | # Template helpers
2 |
3 | import os
4 |
5 |
6 | def A_button(*a, **b):
7 | b['_data-role'] = 'button'
8 | b['_data-inline'] = 'true'
9 | return A(*a, **b)
10 |
11 |
12 | def button(href, label):
13 | if is_mobile:
14 | ret = A_button(SPAN(label), _href=href)
15 | else:
16 | ret = A(SPAN(label), _class='button', _href=href)
17 | return ret
18 |
19 |
20 | def button_enable(href, app):
21 | if os.path.exists(os.path.join(apath(app, r=request), 'DISABLED')):
22 | label = SPAN(T('Enable'), _style='color:red')
23 | else:
24 | label = SPAN(T('Disable'), _style='color:green')
25 | id = 'enable_' + app
26 | return A(label, _class='button', _id=id, callback=href, target=id)
27 |
28 |
29 | def sp_button(href, label):
30 | if False: #request.user_agent().is_mobile:
31 | ret = A_button(SPAN(label), _href=href)
32 | else:
33 | ret = A(SPAN(label), _class='button special', _href=href)
34 | return ret
35 |
36 |
37 | def helpicon():
38 | return IMG(_src=URL('static', 'images/help.png'), _alt='help')
39 |
40 |
41 | def searchbox(elementid):
42 | return TAG[''](LABEL(IMG(_id="search_start", _src=URL('static', 'images/search.png'), _alt=T('filter')), _class='icon', _for=elementid), ' ', INPUT(_id=elementid, _type='text', _size=12))
43 |
--------------------------------------------------------------------------------
/apps/admin/static/codemirror/theme/blackboard.css:
--------------------------------------------------------------------------------
1 | /* Port of TextMate's Blackboard theme */
2 |
3 | .cm-s-blackboard { background: #0C1021; color: #F8F8F8; }
4 | .cm-s-blackboard .CodeMirror-selected { background: #253B76 !important; }
5 | .cm-s-blackboard .CodeMirror-gutter { background: #0C1021; border-right: 0; }
6 | .cm-s-blackboard .CodeMirror-gutter-text { color: #888; }
7 | .cm-s-blackboard .CodeMirror-cursor { border-left: 1px solid #A7A7A7 !important; }
8 |
9 | .cm-s-blackboard .cm-keyword { color: #FBDE2D; }
10 | .cm-s-blackboard .cm-atom { color: #D8FA3C; }
11 | .cm-s-blackboard .cm-number { color: #D8FA3C; }
12 | .cm-s-blackboard .cm-def { color: #8DA6CE; }
13 | .cm-s-blackboard .cm-variable { color: #FF6400; }
14 | .cm-s-blackboard .cm-operator { color: #FBDE2D;}
15 | .cm-s-blackboard .cm-comment { color: #AEAEAE; }
16 | .cm-s-blackboard .cm-string { color: #61CE3C; }
17 | .cm-s-blackboard .cm-string-2 { color: #61CE3C; }
18 | .cm-s-blackboard .cm-meta { color: #D8FA3C; }
19 | .cm-s-blackboard .cm-error { background: #9D1E15; color: #F8F8F8; }
20 | .cm-s-blackboard .cm-builtin { color: #8DA6CE; }
21 | .cm-s-blackboard .cm-tag { color: #8DA6CE; }
22 | .cm-s-blackboard .cm-attribute { color: #8DA6CE; }
23 | .cm-s-blackboard .cm-header { color: #FF6400; }
24 | .cm-s-blackboard .cm-hr { color: #AEAEAE; }
25 | .cm-s-blackboard .cm-link { color: #8DA6CE; }
26 |
--------------------------------------------------------------------------------
/apps/admin/static/codemirror/mode/css/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CodeMirror: CSS mode
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
{{=T("This page can upload your application to the Google App Engine computing cloud. Mind that you must first create indexes locally and this is done by installing the Google appserver and running the app locally with it once, or there will be errors when selecting records. Attention: deployment may take long time, depending on the network speed. Attention: it will overwrite your app.yaml. DO NOT SUBMIT TWICE.")}}
{{=T("This page can commit your changes to an openshift app repo and push them to your cloud instance. This assumes that you've already created the application instance using the web2py skeleton and have that repo somewhere on a filesystem that this web2py instance can access. This functionality requires GitPython installed and on the python path of the runtime that web2py is operating in.")}}
18 |
19 |
{{=T("Note: If you receive an error with github status code of 128, ensure the system and account you are deploying from has a cooresponding ssh key configured in the openshift account.")}}
{{=XML(T('You visited the url %s', A(request.env.path_info,_href=request.env.path_info)))}}
11 |
{{=XML(T('Which called the function %s located in the file %s',
12 | (A(request.function+'()',_href='#'),
13 | A('web2py/applications/%(application)s/controllers/%(controller)s.py'%request,
14 | _href=URL('admin','default','peek', args=(request.application,'controllers',request.controller+'.py'))))))}}
15 |
{{=XML(T('The output of the file is a dictionary that was rendered by the view %s',
16 | A('web2py/applications/%(application)s/views/%(controller)s/index.html'%request,
17 | _href=URL('admin','default','peek',args=(request.application,'views',request.controller,'index.html')))))}}
18 |
{{=T('You can modify this application and adapt it to your needs')}}
The XML mode supports two configuration parameters:
33 |
34 |
htmlMode (boolean)
35 |
This switches the mode to parse HTML instead of XML. This
36 | means attributes do not have to be quoted, and some elements
37 | (such as br) do not require a closing tag.
38 |
alignCDATA (boolean)
39 |
Setting this to true will force the opening tag of CDATA
40 | blocks to not be indented.
19 |
20 | """}}
21 |
22 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/web3py/http.py:
--------------------------------------------------------------------------------
1 |
2 | __all__ = ['HTTP']
3 |
4 | # http interface
5 |
6 | class HTTP(Exception):
7 | status_codes = {
8 | 200: 'OK',
9 | 201: 'CREATED',
10 | 202: 'ACCEPTED',
11 | 203: 'NON-AUTHORITATIVE INFORMATION',
12 | 204: 'NO CONTENT',
13 | 205: 'RESET CONTENT',
14 | 206: 'PARTIAL CONTENT',
15 | 301: 'MOVED PERMANENTLY',
16 | 302: 'FOUND',
17 | 303: 'SEE OTHER',
18 | 304: 'NOT MODIFIED',
19 | 305: 'USE PROXY',
20 | 307: 'TEMPORARY REDIRECT',
21 | 400: 'BAD REQUEST',
22 | 401: 'UNAUTHORIZED',
23 | 403: 'FORBIDDEN',
24 | 404: 'NOT FOUND',
25 | 405: 'METHOD NOT ALLOWED',
26 | 406: 'NOT ACCEPTABLE',
27 | 407: 'PROXY AUTHENTICATION REQUIRED',
28 | 408: 'REQUEST TIMEOUT',
29 | 409: 'CONFLICT',
30 | 410: 'GONE',
31 | 411: 'LENGTH REQUIRED',
32 | 412: 'PRECONDITION FAILED',
33 | 413: 'REQUEST ENTITY TOO LARGE',
34 | 414: 'REQUEST-URI TOO LONG',
35 | 415: 'UNSUPPORTED MEDIA TYPE',
36 | 416: 'REQUESTED RANGE NOT SATISFIABLE',
37 | 417: 'EXPECTATION FAILED',
38 | 422: 'UNPROCESSABLE ENTITY',
39 | 500: 'INTERNAL SERVER ERROR',
40 | 501: 'NOT IMPLEMENTED',
41 | 502: 'BAD GATEWAY',
42 | 503: 'SERVICE UNAVAILABLE',
43 | 504: 'GATEWAY TIMEOUT',
44 | 505: 'HTTP VERSION NOT SUPPORTED',
45 | }
46 |
47 | def __init__(self, status_code, body='', headers=None, cookies=None):
48 | self.status_code = status_code
49 | self.status_name = HTTP.status_codes.get(status_code, status_code)
50 | self.body = body
51 | self.headers = headers.items() if headers else []
52 | if cookies:
53 | self.headers += HTTP.cookies2header(cookies)
54 | if status_code != 200:
55 | if str(status_code)[0] == '4' and len(self.body) < 512:
56 | self.body += '' % ('x' * 512) # trick IE
57 |
58 | def to(self, environ, start_response):
59 | start_response(
60 | "%s %s" % (self.status_code, self.status_name), self.headers)
61 | if environ.get('REQUEST_METHOD', '') == 'HEAD':
62 | return ['']
63 | elif isinstance(self.body,str):
64 | return [self.body]
65 | else:
66 | return self.body
67 |
68 | @staticmethod
69 | def cookies2header(cookies):
70 | headers = []
71 | for cookie in cookies.values():
72 | headers.append(('Set-Cookie', str(cookie)[11:]))
73 | return headers
74 |
75 | @staticmethod
76 | def redirect(location, status_code=303):
77 | location = location.replace('\r', '%0D').replace('\n', '%0A')
78 | raise HTTP(status_code, headers=dict(Location=location))
79 |
80 | class stream(object):
81 | def __init__(self, filename, version = None, headers = None):
82 | self.filename = filename
83 | self.version = version
84 | self.headers = headers or dict()
85 |
--------------------------------------------------------------------------------
/apps/admin/models/0.py:
--------------------------------------------------------------------------------
1 | EXPIRATION = 60 * 60 # logout after 60 minutes of inactivity
2 | CHECK_VERSION = True
3 | WEB2PY_URL = 'http://web2py.com'
4 | WEB2PY_VERSION_URL = WEB2PY_URL + '/examples/default/version'
5 |
6 | ###########################################################################
7 | # Preferences for EditArea
8 | # the user-interface feature that allows you to edit files in your web
9 | # browser.
10 |
11 | ## Default editor (to change editor you need web2py.admin.editors.zip)
12 | TEXT_EDITOR = 'codemirror' or 'ace' or 'edit_area' or 'amy'
13 |
14 | ## Editor Color scheme (only for ace)
15 | TEXT_EDITOR_THEME = (
16 | "chrome", "clouds", "clouds_midnight", "cobalt", "crimson_editor", "dawn",
17 | "dreamweaver", "eclipse", "idle_fingers", "kr_theme", "merbivore",
18 | "merbivore_soft", "monokai", "mono_industrial", "pastel_on_dark",
19 | "solarized_dark", "solarized_light", "textmate", "tomorrow",
20 | "tomorrow_night", "tomorrow_night_blue", "tomorrow_night_bright",
21 | "tomorrow_night_eighties", "twilight", "vibrant_ink")[0]
22 |
23 | ## Editor Keyboard bindings (only for ace and codemirror)
24 | TEXT_EDITOR_KEYBINDING = '' # 'emacs' or 'vi'
25 |
26 | ### edit_area only
27 | # The default font size, measured in 'points'. The value must be an integer > 0
28 | FONT_SIZE = 10
29 |
30 | # Displays the editor in full screen mode. The value must be 'true' or 'false'
31 | FULL_SCREEN = 'false'
32 |
33 | # Display a check box under the editor to allow the user to switch
34 | # between the editor and a simple
35 | # HTML text area. The value must be 'true' or 'false'
36 | ALLOW_TOGGLE = 'true'
37 |
38 | # Replaces tab characters with space characters.
39 | # The value can be 'false' (meaning that tabs are not replaced),
40 | # or an integer > 0 that specifies the number of spaces to replace a tab with.
41 | REPLACE_TAB_BY_SPACES = 4
42 |
43 | # Toggle on/off the code editor instead of textarea on startup
44 | DISPLAY = "onload" or "later"
45 |
46 | # if demo mode is True then admin works readonly and does not require login
47 | DEMO_MODE = False
48 |
49 | # if visible_apps is not empty only listed apps will be accessible
50 | FILTER_APPS = []
51 |
52 | # To upload on google app engine this has to point to the proper appengine
53 | # config file
54 | import os
55 | # extract google_appengine_x.x.x.zip to web2py root directory
56 | #GAE_APPCFG = os.path.abspath(os.path.join('appcfg.py'))
57 | # extract google_appengine_x.x.x.zip to applications/admin/private/
58 | GAE_APPCFG = os.path.abspath(os.path.join('/usr/local/bin/appcfg.py'))
59 |
60 | # To use web2py as a teaching tool, set MULTI_USER_MODE to True
61 | MULTI_USER_MODE = False
62 | EMAIL_SERVER = 'localhost'
63 | EMAIL_SENDER = 'professor@example.com'
64 | EMAIL_LOGIN = None
65 |
66 | # configurable twitterbox, set to None/False to suppress
67 | TWITTER_HASH = "web2py"
68 |
69 | # parameter for downloading LAYOUTS
70 | LAYOUTS_APP = 'http://web2py.com/layouts'
71 | #LAYOUTS_APP = 'http://127.0.0.1:8000/layouts'
72 |
73 |
74 | # parameter for downloading PLUGINS
75 | PLUGINS_APP = 'http://web2py.com/plugins'
76 | #PLUGINS_APP = 'http://127.0.0.1:8000/plugins'
77 |
78 | # set the language
79 | if 'adminLanguage' in request.cookies and not (request.cookies['adminLanguage'] is None):
80 | T.force(request.cookies['adminLanguage'].value)
81 |
--------------------------------------------------------------------------------
/apps/admin/static/codemirror/mode/htmlmixed/htmlmixed.js:
--------------------------------------------------------------------------------
1 | CodeMirror.defineMode("htmlmixed", function(config, parserConfig) {
2 | var htmlMode = CodeMirror.getMode(config, {name: "xml", htmlMode: true});
3 | var jsMode = CodeMirror.getMode(config, "javascript");
4 | var cssMode = CodeMirror.getMode(config, "css");
5 |
6 | function html(stream, state) {
7 | var style = htmlMode.token(stream, state.htmlState);
8 | if (style == "tag" && stream.current() == ">" && state.htmlState.context) {
9 | if (/^script$/i.test(state.htmlState.context.tagName)) {
10 | state.token = javascript;
11 | state.localState = jsMode.startState(htmlMode.indent(state.htmlState, ""));
12 | state.mode = "javascript";
13 | }
14 | else if (/^style$/i.test(state.htmlState.context.tagName)) {
15 | state.token = css;
16 | state.localState = cssMode.startState(htmlMode.indent(state.htmlState, ""));
17 | state.mode = "css";
18 | }
19 | }
20 | return style;
21 | }
22 | function maybeBackup(stream, pat, style) {
23 | var cur = stream.current();
24 | var close = cur.search(pat);
25 | if (close > -1) stream.backUp(cur.length - close);
26 | return style;
27 | }
28 | function javascript(stream, state) {
29 | if (stream.match(/^<\/\s*script\s*>/i, false)) {
30 | state.token = html;
31 | state.localState = null;
32 | state.mode = "html";
33 | return html(stream, state);
34 | }
35 | return maybeBackup(stream, /<\/\s*script\s*>/,
36 | jsMode.token(stream, state.localState));
37 | }
38 | function css(stream, state) {
39 | if (stream.match(/^<\/\s*style\s*>/i, false)) {
40 | state.token = html;
41 | state.localState = null;
42 | state.mode = "html";
43 | return html(stream, state);
44 | }
45 | return maybeBackup(stream, /<\/\s*style\s*>/,
46 | cssMode.token(stream, state.localState));
47 | }
48 |
49 | return {
50 | startState: function() {
51 | var state = htmlMode.startState();
52 | return {token: html, localState: null, mode: "html", htmlState: state};
53 | },
54 |
55 | copyState: function(state) {
56 | if (state.localState)
57 | var local = CodeMirror.copyState(state.token == css ? cssMode : jsMode, state.localState);
58 | return {token: state.token, localState: local, mode: state.mode,
59 | htmlState: CodeMirror.copyState(htmlMode, state.htmlState)};
60 | },
61 |
62 | token: function(stream, state) {
63 | return state.token(stream, state);
64 | },
65 |
66 | indent: function(state, textAfter) {
67 | if (state.token == html || /^\s*<\//.test(textAfter))
68 | return htmlMode.indent(state.htmlState, textAfter);
69 | else if (state.token == javascript)
70 | return jsMode.indent(state.localState, textAfter);
71 | else
72 | return cssMode.indent(state.localState, textAfter);
73 | },
74 |
75 | compareStates: function(a, b) {
76 | if (a.mode != b.mode) return false;
77 | if (a.localState) return CodeMirror.Pass;
78 | return htmlMode.compareStates(a.htmlState, b.htmlState);
79 | },
80 |
81 | electricChars: "/{}:"
82 | };
83 | }, "xml", "javascript", "css");
84 |
85 | CodeMirror.defineMIME("text/html", "htmlmixed");
86 |
--------------------------------------------------------------------------------
/apps/admin/views/debug/breakpoints.html:
--------------------------------------------------------------------------------
1 | {{extend 'layout.html'}}
2 |
3 | {{block sectionclass}}debug{{end}}
4 |
5 |
22 |
23 |
38 |
39 |
40 |
41 |
42 |
{{=T("Breakpoints")}}
43 |
44 |
45 |
87 |
88 |
89 |
90 |
91 |
92 |
{{=T("You can also set and remove breakpoint in the edit window, using the Toggle Breakpoint button")}}
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
{{=T("Add breakpoint")}}
107 |
108 | {{=form}}
109 |
110 |
111 |
112 |
113 |
114 |
115 |
--------------------------------------------------------------------------------
/apps/admin/static/codemirror/lib/util/multiplex.js:
--------------------------------------------------------------------------------
1 | CodeMirror.multiplexingMode = function(outer /*, others */) {
2 | // Others should be {open, close, mode [, delimStyle]} objects
3 | var others = Array.prototype.slice.call(arguments, 1);
4 | var n_others = others.length;
5 |
6 | function indexOf(string, pattern, from) {
7 | if (typeof pattern == "string") return string.indexOf(pattern, from);
8 | var m = pattern.exec(from ? string.slice(from) : string);
9 | return m ? m.index + from : -1;
10 | }
11 |
12 | return {
13 | startState: function() {
14 | return {
15 | outer: CodeMirror.startState(outer),
16 | innerActive: null,
17 | inner: null
18 | };
19 | },
20 |
21 | copyState: function(state) {
22 | return {
23 | outer: CodeMirror.copyState(outer, state.outer),
24 | innerActive: state.innerActive,
25 | inner: state.innerActive && CodeMirror.copyState(state.innerActive.mode, state.inner)
26 | };
27 | },
28 |
29 | token: function(stream, state) {
30 | if (!state.innerActive) {
31 | var cutOff = Infinity, oldContent = stream.string;
32 | for (var i = 0; i < n_others; ++i) {
33 | var other = others[i];
34 | var found = indexOf(oldContent, other.open, stream.pos);
35 | if (found == stream.pos) {
36 | stream.match(other.open);
37 | state.innerActive = other;
38 | state.inner = CodeMirror.startState(other.mode, outer.indent ? outer.indent(state.outer, "") : 0);
39 | return other.delimStyle;
40 | } else if (found != -1 && found < cutOff) {
41 | cutOff = found;
42 | }
43 | }
44 | if (cutOff != Infinity) stream.string = oldContent.slice(0, cutOff);
45 | var outerToken = outer.token(stream, state.outer);
46 | if (cutOff != Infinity) stream.string = oldContent;
47 | return outerToken;
48 | } else {
49 | var curInner = state.innerActive, oldContent = stream.string;
50 | var found = indexOf(oldContent, curInner.close, stream.pos);
51 | if (found == stream.pos) {
52 | stream.match(curInner.close);
53 | state.innerActive = state.inner = null;
54 | return curInner.delimStyle;
55 | }
56 | if (found > -1) stream.string = oldContent.slice(0, found);
57 | var innerToken = curInner.mode.token(stream, state.inner);
58 | if (found > -1) stream.string = oldContent;
59 | var cur = stream.current(), found = cur.indexOf(curInner.close);
60 | if (found > -1) stream.backUp(cur.length - found);
61 | return innerToken;
62 | }
63 | },
64 |
65 | indent: function(state, textAfter) {
66 | var mode = state.innerActive ? state.innerActive.mode : outer;
67 | if (!mode.indent) return CodeMirror.Pass;
68 | return mode.indent(state.innerActive ? state.inner : state.outer, textAfter);
69 | },
70 |
71 | compareStates: function(a, b) {
72 | if (a.innerActive != b.innerActive) return false;
73 | var mode = a.innerActive || outer;
74 | if (!mode.compareStates) return CodeMirror.Pass;
75 | return mode.compareStates(a.innerActive ? a.inner : a.outer,
76 | b.innerActive ? b.inner : b.outer);
77 | },
78 |
79 | electricChars: outer.electricChars
80 | };
81 | };
82 |
--------------------------------------------------------------------------------
/web3py/menu.py:
--------------------------------------------------------------------------------
1 | from .helpers import TAG, tag, cat
2 |
3 | __all__ = ['MENU']
4 |
5 | class MENU(TAG):
6 | """
7 | Used to build menus
8 |
9 | Optional arguments
10 | _class: defaults to 'web2py-menu web2py-menu-vertical'
11 | ul_class: defaults to 'web2py-menu-vertical'
12 | li_class: defaults to 'web2py-menu-expand'
13 |
14 | Example:
15 | menu = MENU([['name', False, URL(...), [submenu]], ...])
16 | {{=menu}}
17 | """
18 |
19 | def __init__(self, data, **args):
20 | TAG.__init__(self, 'UL')
21 | self.data = data
22 | self.attributes = args
23 | self.components = []
24 | if not '_class' in self.attributes:
25 | self['_class'] = 'web2py-menu web2py-menu-vertical'
26 | if not 'ul_class' in self.attributes:
27 | self['ul_class'] = 'web2py-menu-vertical'
28 | if not 'li_class' in self.attributes:
29 | self['li_class'] = 'web2py-menu-expand'
30 | if not 'li_active' in self.attributes:
31 | self['li_active'] = 'web2py-menu-active'
32 | if not 'mobile' in self.attributes:
33 | self['mobile'] = False
34 |
35 | def serialize(self, data, level=0):
36 | if level == 0:
37 | ul = tag.UL(**self.attributes)
38 | else:
39 | ul = tag.UL(_class=self['ul_class'])
40 | for item in data:
41 | (name, active, link) = item[:3]
42 | if isinstance(link, TAG):
43 | li = tag.LI(link)
44 | elif 'no_link_url' in self.attributes and self['no_link_url'] == link:
45 | li = tag.LI(tag.DIV(name))
46 | elif link:
47 | li = tag.LI(tag.A(name, _href=link))
48 | elif not link and isinstance(name, TAG) and name.name.lower()=='a':
49 | li = tag.LI(name)
50 | else:
51 | li = tag.LI(tag.A(name, _href='#',
52 | _onclick='javascript:void(0);return false;'))
53 | if len(item) > 3 and item[3]:
54 | li['_class'] = self['li_class']
55 | li.append(self.serialize(item[3], level + 1))
56 | if active or ('active_url' in self.attributes and self['active_url'] == link):
57 | if li['_class']:
58 | li['_class'] = li['_class'] + ' ' + self['li_active']
59 | else:
60 | li['_class'] = self['li_active']
61 | if len(item) <= 4 or item[4] == True:
62 | ul.append(li)
63 | return ul
64 |
65 | def serialize_mobile(self, data, select=None, prefix=''):
66 | if not select:
67 | select = tag.SELECT(**self.attributes)
68 | for item in data:
69 | if len(item) <= 4 or item[4] == True:
70 | select.append(tag.OPTION(cat(prefix, item[0]),
71 | _value=item[2], _selected=item[1]))
72 | if len(item) > 3 and len(item[3]):
73 | self.serialize_mobile(
74 | item[3], select, prefix=cat(prefix, item[0], '/'))
75 | select['_onchange'] = 'window.location=this.value'
76 | return select
77 |
78 | def xml(self):
79 | if self['mobile']:
80 | return self.serialize_mobile(self.data, 0).xml()
81 | else:
82 | return self.serialize(self.data, 0).xml()
83 |
--------------------------------------------------------------------------------
/apps/admin/static/codemirror/mode/python/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CodeMirror: Python mode
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
CodeMirror: Python mode
14 |
15 |
104 |
115 |
Configuration Options:
116 |
117 |
version - 2/3 - The version of Python to recognize. Default is 2.
118 |
singleLineStringErrors - true/false - If you have a single-line string that is not terminated at the end of the line, this will show subsequent lines as errors if true, otherwise it will consider the newline as the end of the string. Default is false.