├── apps ├── __init__.py ├── admin │ ├── __init__.py │ ├── private │ │ └── hosts.deny │ ├── modules │ │ └── __init__.py │ ├── cron │ │ ├── crontab │ │ └── expire_sessions.py │ ├── static │ │ ├── images │ │ │ ├── help.png │ │ │ ├── menu.png │ │ │ ├── folder.png │ │ │ ├── search.png │ │ │ ├── start.png │ │ │ ├── embossed.png │ │ │ ├── folder_sm.png │ │ │ ├── header_bg.png │ │ │ ├── save_icon.png │ │ │ ├── spinner.gif │ │ │ ├── test_icon.png │ │ │ ├── delete_icon.png │ │ │ ├── dim_bullet.gif │ │ │ ├── red_bullet.gif │ │ │ ├── folder_locked.png │ │ │ ├── header_shadow.png │ │ │ ├── section_bullet.png │ │ │ ├── sidebar_bullet.gif │ │ │ ├── small_button.png │ │ │ ├── ticket_section.png │ │ │ ├── sidebar_background.jpg │ │ │ └── small_special_button.png │ │ ├── plugin_multiselect │ │ │ ├── switch.png │ │ │ ├── start.js │ │ │ └── multi-select.css │ │ ├── plugin_jqmobile │ │ │ └── images │ │ │ │ ├── iphone.jpg │ │ │ │ ├── ajax-loader.png │ │ │ │ ├── icons-18-black.png │ │ │ │ ├── icons-18-white.png │ │ │ │ ├── icons-36-black.png │ │ │ │ └── icons-36-white.png │ │ ├── codemirror │ │ │ ├── lib │ │ │ │ └── util │ │ │ │ │ ├── simple-hint.css │ │ │ │ │ ├── dialog.css │ │ │ │ │ ├── match-highlighter.js │ │ │ │ │ ├── runmode.js │ │ │ │ │ ├── loadmode.js │ │ │ │ │ ├── overlay.js │ │ │ │ │ ├── dialog.js │ │ │ │ │ └── multiplex.js │ │ │ ├── README.md │ │ │ ├── theme │ │ │ │ ├── neat.css │ │ │ │ ├── elegant.css │ │ │ │ ├── cobalt.css │ │ │ │ ├── eclipse.css │ │ │ │ ├── night.css │ │ │ │ ├── monokai.css │ │ │ │ ├── erlang-dark.css │ │ │ │ ├── blackboard.css │ │ │ │ ├── rubyblue.css │ │ │ │ ├── vibrant-ink.css │ │ │ │ ├── web2py.css │ │ │ │ ├── lesser-dark.css │ │ │ │ └── xq-dark.css │ │ │ ├── mode │ │ │ │ ├── python │ │ │ │ │ ├── LICENSE.txt │ │ │ │ │ └── index.html │ │ │ │ ├── coffeescript │ │ │ │ │ └── LICENSE │ │ │ │ ├── css │ │ │ │ │ └── index.html │ │ │ │ ├── htmlmixed │ │ │ │ │ ├── index.html │ │ │ │ │ └── htmlmixed.js │ │ │ │ ├── xml │ │ │ │ │ └── index.html │ │ │ │ └── javascript │ │ │ │ │ └── index.html │ │ │ ├── LICENSE │ │ │ └── keymap │ │ │ │ └── emacs.js │ │ ├── css │ │ │ ├── jqueryMultiSelect.css │ │ │ └── calendar.css │ │ └── js │ │ │ └── autoscroll.js │ ├── views │ │ ├── default │ │ │ ├── bulk_register.html │ │ │ ├── manage_students.html │ │ │ ├── git_pull.html │ │ │ ├── git_push.html │ │ │ ├── uninstall.html │ │ │ ├── change_password.html │ │ │ ├── delete.html │ │ │ ├── delete_plugin.html │ │ │ ├── edit_plurals.html │ │ │ ├── upgrade_web2py.html │ │ │ ├── peek.html │ │ │ ├── twitter.load │ │ │ ├── user.html │ │ │ ├── edit_language.html │ │ │ ├── resolve.html │ │ │ ├── about.html │ │ │ ├── index.html │ │ │ ├── test.html │ │ │ └── amy_ajax.html │ │ ├── default.mobile │ │ │ ├── change_password.html │ │ │ ├── delete_plugin.html │ │ │ ├── uninstall.html │ │ │ ├── about.html │ │ │ ├── edit_language.html │ │ │ ├── peek.html │ │ │ ├── delete.html │ │ │ ├── upgrade_web2py.html │ │ │ ├── downgrade_web2py.html │ │ │ ├── user.html │ │ │ ├── resolve.html │ │ │ ├── index.html │ │ │ ├── test.html │ │ │ ├── site.html │ │ │ ├── amy_ajax.html │ │ │ └── edit.html │ │ ├── mercurial │ │ │ ├── revision.html │ │ │ └── commit.html │ │ ├── generic.html │ │ ├── wizard │ │ │ └── generated.html │ │ ├── web2py_ajax.html │ │ ├── toolbar │ │ │ └── index.html │ │ ├── plugin_jqmobile │ │ │ ├── index.html │ │ │ └── about.html │ │ ├── gae │ │ │ └── deploy.html │ │ ├── openshift │ │ │ └── deploy.html │ │ ├── layout.html │ │ └── debug │ │ │ └── breakpoints.html │ ├── languages │ │ ├── plural-en.py │ │ ├── plural-ru.py │ │ └── plural-uk.py │ ├── controllers │ │ ├── plugin_jqmobile.py │ │ ├── toolbar.py │ │ ├── shell.py │ │ ├── openshift.py │ │ └── mercurial.py │ ├── ABOUT │ ├── main.py │ └── models │ │ ├── plugin_multiselect.py │ │ ├── 0_imports.py │ │ ├── buttons.py │ │ ├── menu.py │ │ ├── db.py │ │ └── 0.py ├── welcome │ ├── __init__.py │ ├── cron │ │ └── crontab │ ├── static │ │ ├── images │ │ │ ├── favicon.ico │ │ │ ├── favicon.png │ │ │ ├── twitter.png │ │ │ ├── facebook.png │ │ │ ├── gplus-32.png │ │ │ ├── glyphicons-halflings.png │ │ │ └── glyphicons-halflings-white.png │ │ ├── js │ │ │ ├── web2py_bootstrap.js │ │ │ └── share.js │ │ └── css │ │ │ └── calendar.css │ ├── templates │ │ └── index.html │ ├── languages │ │ ├── plural-en.py │ │ ├── plural-ru.py │ │ └── plural-uk.py │ └── main.py └── welcome_legacy │ ├── __init__.py │ ├── views │ ├── __init__.py │ ├── generic.json │ ├── generic.xml │ ├── generic.pdf │ ├── generic.rss │ ├── generic.html │ ├── generic.jsonp │ ├── generic.ics │ ├── web2py_ajax.html │ ├── default │ │ ├── user.html │ │ └── index.html │ ├── generic.load │ └── generic.map │ ├── cron │ └── crontab.example │ ├── modules │ └── __init__.py │ ├── ABOUT │ ├── static │ ├── images │ │ ├── favicon.ico │ │ ├── favicon.png │ │ ├── twitter.png │ │ ├── facebook.png │ │ ├── gplus-32.png │ │ ├── glyphicons-halflings.png │ │ └── glyphicons-halflings-white.png │ ├── js │ │ ├── web2py_bootstrap.js │ │ └── share.js │ └── css │ │ └── calendar.css │ ├── LICENSE │ ├── main.py │ ├── languages │ ├── plural-en.py │ ├── plural-ru.py │ └── plural-uk.py │ ├── routes.example.py │ └── controllers │ └── default.py ├── gluon ├── __init__.py └── settings.py ├── contrib ├── __init__.py └── plural_rules │ ├── __init__.py │ ├── ja.py │ ├── tr.py │ ├── zh.py │ ├── hi.py │ ├── pt.py │ ├── ro.py │ ├── de.py │ ├── es.py │ ├── fr.py │ ├── he.py │ ├── it.py │ ├── bg.py │ ├── hu.py │ ├── af.py │ ├── pl.py │ ├── cs.py │ ├── en.py │ ├── lt.py │ ├── sl.py │ ├── ru.py │ ├── sk.py │ └── uk.py ├── vars ├── errors.db ├── storage.test ├── sql.log ├── b2e8f4c6053e432ccd0380a37b4d9aaf_person.table └── 5cd9e04ae2d4909a949f3cb327bc76f5_error.table ├── runme.py ├── Makefile ├── TODO └── web3py ├── __init__.py ├── session.py ├── storage.py ├── fancy_pickle.py ├── cfs.py ├── cleaners.py ├── http.py └── menu.py /apps/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /gluon/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /apps/admin/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /contrib/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /apps/admin/private/hosts.deny: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apps/welcome/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /apps/welcome/cron/crontab: -------------------------------------------------------------------------------- 1 | #crontab -------------------------------------------------------------------------------- /apps/admin/modules/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /apps/welcome_legacy/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /contrib/plural_rules/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /apps/welcome_legacy/views/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /apps/welcome_legacy/cron/crontab.example: -------------------------------------------------------------------------------- 1 | #crontab -------------------------------------------------------------------------------- /apps/welcome_legacy/modules/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /vars/errors.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/vars/errors.db -------------------------------------------------------------------------------- /apps/welcome_legacy/ABOUT: -------------------------------------------------------------------------------- 1 | Write something about this app. 2 | Developed with web2py. 3 | -------------------------------------------------------------------------------- /vars/storage.test: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/vars/storage.test -------------------------------------------------------------------------------- /apps/admin/cron/crontab: -------------------------------------------------------------------------------- 1 | 10 * * * * root **applications/admin/cron/expire_sessions.py 2 | 3 | -------------------------------------------------------------------------------- /apps/welcome_legacy/views/generic.json: -------------------------------------------------------------------------------- 1 | {{from gluon.serializers import json}}{{=XML(json(response._vars))}} 2 | -------------------------------------------------------------------------------- /apps/admin/static/images/help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/admin/static/images/help.png -------------------------------------------------------------------------------- /apps/admin/static/images/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/admin/static/images/menu.png -------------------------------------------------------------------------------- /apps/admin/static/images/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/admin/static/images/folder.png -------------------------------------------------------------------------------- /apps/admin/static/images/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/admin/static/images/search.png -------------------------------------------------------------------------------- /apps/admin/static/images/start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/admin/static/images/start.png -------------------------------------------------------------------------------- /runme.py: -------------------------------------------------------------------------------- 1 | import logging 2 | from web3py import run 3 | 4 | logging.basicConfig(level=logging.INFO) 5 | 6 | run() 7 | -------------------------------------------------------------------------------- /apps/admin/static/images/embossed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/admin/static/images/embossed.png -------------------------------------------------------------------------------- /apps/admin/static/images/folder_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/admin/static/images/folder_sm.png -------------------------------------------------------------------------------- /apps/admin/static/images/header_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/admin/static/images/header_bg.png -------------------------------------------------------------------------------- /apps/admin/static/images/save_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/admin/static/images/save_icon.png -------------------------------------------------------------------------------- /apps/admin/static/images/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/admin/static/images/spinner.gif -------------------------------------------------------------------------------- /apps/admin/static/images/test_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/admin/static/images/test_icon.png -------------------------------------------------------------------------------- /apps/welcome/static/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/welcome/static/images/favicon.ico -------------------------------------------------------------------------------- /apps/welcome/static/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/welcome/static/images/favicon.png -------------------------------------------------------------------------------- /apps/welcome/static/images/twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/welcome/static/images/twitter.png -------------------------------------------------------------------------------- /apps/admin/static/images/delete_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/admin/static/images/delete_icon.png -------------------------------------------------------------------------------- /apps/admin/static/images/dim_bullet.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/admin/static/images/dim_bullet.gif -------------------------------------------------------------------------------- /apps/admin/static/images/red_bullet.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/admin/static/images/red_bullet.gif -------------------------------------------------------------------------------- /apps/welcome/static/images/facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/welcome/static/images/facebook.png -------------------------------------------------------------------------------- /apps/welcome/static/images/gplus-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/welcome/static/images/gplus-32.png -------------------------------------------------------------------------------- /apps/admin/static/images/folder_locked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/admin/static/images/folder_locked.png -------------------------------------------------------------------------------- /apps/admin/static/images/header_shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/admin/static/images/header_shadow.png -------------------------------------------------------------------------------- /apps/admin/static/images/section_bullet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/admin/static/images/section_bullet.png -------------------------------------------------------------------------------- /apps/admin/static/images/sidebar_bullet.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/admin/static/images/sidebar_bullet.gif -------------------------------------------------------------------------------- /apps/admin/static/images/small_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/admin/static/images/small_button.png -------------------------------------------------------------------------------- /apps/admin/static/images/ticket_section.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/admin/static/images/ticket_section.png -------------------------------------------------------------------------------- /apps/welcome_legacy/static/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/welcome_legacy/static/images/favicon.ico -------------------------------------------------------------------------------- /apps/welcome_legacy/static/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/welcome_legacy/static/images/favicon.png -------------------------------------------------------------------------------- /apps/welcome_legacy/static/images/twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/welcome_legacy/static/images/twitter.png -------------------------------------------------------------------------------- /apps/admin/static/images/sidebar_background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/admin/static/images/sidebar_background.jpg -------------------------------------------------------------------------------- /apps/admin/static/plugin_multiselect/switch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/admin/static/plugin_multiselect/switch.png -------------------------------------------------------------------------------- /apps/admin/views/default/bulk_register.html: -------------------------------------------------------------------------------- 1 | {{extend 'layout.html'}} 2 | 3 |

{{=T('Bulk Student Registration')}}

4 | 5 | {{=form}} 6 | -------------------------------------------------------------------------------- /apps/welcome_legacy/static/images/facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/welcome_legacy/static/images/facebook.png -------------------------------------------------------------------------------- /apps/welcome_legacy/static/images/gplus-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/welcome_legacy/static/images/gplus-32.png -------------------------------------------------------------------------------- /apps/admin/static/images/small_special_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/admin/static/images/small_special_button.png -------------------------------------------------------------------------------- /apps/admin/views/default/manage_students.html: -------------------------------------------------------------------------------- 1 | {{extend 'layout.html'}} 2 | 3 |

{{=T('Manage Admin Users/Students')}}

4 | 5 | {{=grid}} 6 | -------------------------------------------------------------------------------- /apps/welcome/templates/index.html: -------------------------------------------------------------------------------- 1 | {{extend 'layout.html'}} 2 | 3 |

{{=current.T('Hello World')}}

4 | 5 | {{=message}} 6 | 7 | {{=form}} 8 | -------------------------------------------------------------------------------- /apps/admin/static/plugin_jqmobile/images/iphone.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/admin/static/plugin_jqmobile/images/iphone.jpg -------------------------------------------------------------------------------- /apps/welcome/static/images/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/welcome/static/images/glyphicons-halflings.png -------------------------------------------------------------------------------- /apps/welcome_legacy/views/generic.xml: -------------------------------------------------------------------------------- 1 | {{from gluon.serializers import xml}}{{=XML(xml(response._vars,quote=False))}} 2 | -------------------------------------------------------------------------------- /apps/admin/static/plugin_jqmobile/images/ajax-loader.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/admin/static/plugin_jqmobile/images/ajax-loader.png -------------------------------------------------------------------------------- /apps/welcome/static/images/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/welcome/static/images/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /apps/welcome_legacy/static/images/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/welcome_legacy/static/images/glyphicons-halflings.png -------------------------------------------------------------------------------- /apps/admin/static/plugin_jqmobile/images/icons-18-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/admin/static/plugin_jqmobile/images/icons-18-black.png -------------------------------------------------------------------------------- /apps/admin/static/plugin_jqmobile/images/icons-18-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/admin/static/plugin_jqmobile/images/icons-18-white.png -------------------------------------------------------------------------------- /apps/admin/static/plugin_jqmobile/images/icons-36-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/admin/static/plugin_jqmobile/images/icons-36-black.png -------------------------------------------------------------------------------- /apps/admin/static/plugin_jqmobile/images/icons-36-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/admin/static/plugin_jqmobile/images/icons-36-white.png -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | cleanup: 2 | find ./ -name '*~' -exec rm {} \; 3 | find ./ -name '#*' -exec rm {} \; 4 | find ./ -name '*.bak' -exec rm {} \; 5 | find ./ -name '*.pyc' -exec rm {} \; -------------------------------------------------------------------------------- /apps/admin/languages/plural-en.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | { 3 | # "singular form (0)": ["first plural form (1)", "second plural form (2)", ...], 4 | 'file': ['files'], 5 | } 6 | -------------------------------------------------------------------------------- /apps/welcome_legacy/static/images/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdipierro/web3py/HEAD/apps/welcome_legacy/static/images/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /apps/admin/languages/plural-ru.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | { 3 | # "singular form (0)": ["first plural form (1)", "second plural form (2)", ...], 4 | 'файл': ['файла','файлов'], 5 | } 6 | -------------------------------------------------------------------------------- /apps/admin/languages/plural-uk.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | { 3 | # "singular form (0)": ["first plural form (1)", "second plural form (2)", ...], 4 | 'файл': ['файли','файлів'], 5 | } 6 | -------------------------------------------------------------------------------- /apps/admin/static/plugin_multiselect/start.js: -------------------------------------------------------------------------------- 1 | jQuery(document).ready(function(){jQuery('[multiple]').multiSelect({selectableHeader:'Options',selectedHeader:'Selected'});}); 2 | -------------------------------------------------------------------------------- /apps/admin/views/default/git_pull.html: -------------------------------------------------------------------------------- 1 | {{extend 'layout.html'}} 2 | 3 |
4 |

{{=T('This will pull changes from the remote repo for application "%s"?', app)}}

5 | {{=dialog}} 6 | -------------------------------------------------------------------------------- /apps/admin/views/default/git_push.html: -------------------------------------------------------------------------------- 1 | {{extend 'layout.html'}} 2 | 3 |

{{=T('This will push changes to the remote repo for application "%s".', app)}}

4 |
5 | {{=form}} 6 |
7 | -------------------------------------------------------------------------------- /apps/admin/views/default/uninstall.html: -------------------------------------------------------------------------------- 1 | {{extend 'layout.html'}} 2 | 3 |

{{=T('Are you sure you want to uninstall application "%s"?', app)}}

4 |
5 | {{=dialog}} 6 |
7 | 8 | -------------------------------------------------------------------------------- /apps/admin/controllers/plugin_jqmobile.py: -------------------------------------------------------------------------------- 1 | response.files = response.files[:3] 2 | response.menu = [] 3 | 4 | 5 | def index(): 6 | return locals() 7 | 8 | 9 | def about(): 10 | return locals() 11 | -------------------------------------------------------------------------------- /apps/admin/views/default/change_password.html: -------------------------------------------------------------------------------- 1 | {{extend 'layout.html'}} 2 | 3 | {{block sectionclass}}change_password{{end}} 4 | 5 |

Change Admin Password

6 | 7 |
8 | {{=form}} 9 |
10 | 11 | -------------------------------------------------------------------------------- /apps/admin/views/default.mobile/change_password.html: -------------------------------------------------------------------------------- 1 | {{extend 'default.mobile/layout.html'}} 2 | 3 | {{block sectionclass}}change_password{{end}} 4 | 5 |

Change Admin Password

6 | 7 |
8 | {{=form}} 9 |
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)}}

6 |
7 | {{=dialog}} 8 |
9 | 10 | -------------------------------------------------------------------------------- /apps/admin/views/default/delete_plugin.html: -------------------------------------------------------------------------------- 1 | {{extend 'layout.html'}} 2 | 3 | {{block sectionclass}}delete_plugin{{end}} 4 | 5 |

{{=T('Are you sure you want to delete plugin "%s"?', plugin)}}

6 |
7 | {{=dialog}} 8 |
9 | 10 | -------------------------------------------------------------------------------- /apps/admin/main.py: -------------------------------------------------------------------------------- 1 | from web3py.expose import expose 2 | from web3py.web2py import web2py_handler 3 | from web3py.session import SessionCookieManager 4 | 5 | @expose(path='/(.*)', cleaners = [SessionCookieManager('test')]) 6 | def handler(): 7 | return web2py_handler() 8 | -------------------------------------------------------------------------------- /apps/admin/models/plugin_multiselect.py: -------------------------------------------------------------------------------- 1 | response.files.append( 2 | URL('static', 'plugin_multiselect/jquery.multi-select.js')) 3 | response.files.append(URL('static', 'plugin_multiselect/multi-select.css')) 4 | response.files.append(URL('static', 'plugin_multiselect/start.js')) 5 | -------------------------------------------------------------------------------- /apps/welcome_legacy/main.py: -------------------------------------------------------------------------------- 1 | from web3py.expose import expose 2 | from web3py.web2py import web2py_handler 3 | from web3py.session import SessionCookieManager 4 | 5 | @expose(path='/(.*)', cleaners = [SessionCookieManager('test')]) 6 | def handler(): 7 | return web2py_handler() 8 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | BEAUTIFY and MENU 2 | sessions 3 | reloading of module 4 | serializars 5 | markmin and autolinks 6 | tools 7 | admin and appadmin 8 | 9 | problem: 10 | INFO:root: exposing 'test.main.index' as '/junk' 11 | INFO:root: exposing 'welcome.main.index' as '/welcome/index(\.\w+)?' 12 | -------------------------------------------------------------------------------- /web3py/__init__.py: -------------------------------------------------------------------------------- 1 | from .wsgi import run 2 | from .expose import expose, url 3 | from .http import HTTP 4 | from .helpers import tag, cat, safe 5 | from .forms import Form, DALForm 6 | from .cache import cache 7 | from .dal import DAL, Field 8 | from .current import current 9 | from .cleaners import Cleaner 10 | -------------------------------------------------------------------------------- /apps/admin/views/mercurial/revision.html: -------------------------------------------------------------------------------- 1 | {{extend 'layout.html'}} 2 | 3 |

Revision {{=rev}}

4 | 5 | {{=form}} 6 | 7 |

8 |

Changelog

9 | 10 | {{=desc}} 11 | 12 |

13 |

Files added

14 | 15 | {{=TABLE(*[TR(f) for f in files])}} 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /apps/welcome_legacy/views/generic.pdf: -------------------------------------------------------------------------------- 1 | {{ 2 | import os 3 | from gluon.contrib.generics import pdf_from_html 4 | filename = '%s/%s.html' % (request.controller,request.function) 5 | if os.path.exists(os.path.join(request.folder,'views',filename)): 6 | html=response.render(filename) 7 | else: 8 | html=BODY(BEAUTIFY(response._vars)).xml() 9 | pass 10 | =pdf_from_html(html) 11 | }} 12 | -------------------------------------------------------------------------------- /apps/admin/views/default.mobile/delete_plugin.html: -------------------------------------------------------------------------------- 1 | {{extend 'default.mobile/layout.html'}} 2 | 3 | {{block sectionclass}}delete_plugin{{end}} 4 | 5 |
6 |

{{=T('Are you sure you want to delete plugin "%s"?', plugin)}}

7 |

{{=FORM(INPUT(_type='submit',_name='nodelete',_value=T('NO')))}}

8 |

{{=FORM(INPUT(_type='submit',_name='delete',_value=T('YES')))}}

9 |
10 | 11 | -------------------------------------------------------------------------------- /apps/admin/views/default.mobile/uninstall.html: -------------------------------------------------------------------------------- 1 | {{extend 'default.mobile/layout.html'}} 2 | 3 |
4 |

{{=T('Are you sure you want to uninstall application "%s"?', app)}}

5 | 6 | 7 | 8 |
{{=FORM(INPUT(_type='submit',_name='nodelete',_value=T('Abort')))}}{{=FORM(INPUT(_type='submit',_name='delete',_value=T('Uninstall')))}}
9 |
10 | 11 | -------------------------------------------------------------------------------- /apps/welcome/languages/plural-en.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | { 3 | # "singular form (0)": ["first plural form (1)", "second plural form (2)", ...], 4 | 'account': ['accounts'], 5 | 'book': ['books'], 6 | 'is': ['are'], 7 | 'man': ['men'], 8 | 'miss': ['misses'], 9 | 'person': ['people'], 10 | 'quark': ['quarks'], 11 | 'shop': ['shops'], 12 | 'this': ['these'], 13 | 'was': ['were'], 14 | 'woman': ['women'], 15 | } 16 | -------------------------------------------------------------------------------- /apps/welcome_legacy/languages/plural-en.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | { 3 | # "singular form (0)": ["first plural form (1)", "second plural form (2)", ...], 4 | 'account': ['accounts'], 5 | 'book': ['books'], 6 | 'is': ['are'], 7 | 'man': ['men'], 8 | 'miss': ['misses'], 9 | 'person': ['people'], 10 | 'quark': ['quarks'], 11 | 'shop': ['shops'], 12 | 'this': ['these'], 13 | 'was': ['were'], 14 | 'woman': ['women'], 15 | } 16 | -------------------------------------------------------------------------------- /apps/admin/views/default/edit_plurals.html: -------------------------------------------------------------------------------- 1 | {{extend 'layout.html'}} 2 | 9 | 10 | {{block sectionclass}}edit_language{{end}} 11 | 12 |

{{=T("Editing Plural Forms File")}} "{{=filename}}"

13 |
14 | {{=form}} 15 |
16 | 17 | -------------------------------------------------------------------------------- /apps/welcome_legacy/views/generic.rss: -------------------------------------------------------------------------------- 1 | {{ 2 | ### 3 | # response._vars contains the dictionary returned by the controller action 4 | # for this to work the action must return something like 5 | # 6 | # dict(title=...,link=...,description=...,created_on='...',items=...) 7 | # 8 | # items is a list of dictionaries each with title, link, description, pub_date. 9 | ### 10 | from gluon.serializers import rss}}{{=XML(rss(response._vars))}} 11 | -------------------------------------------------------------------------------- /vars/sql.log: -------------------------------------------------------------------------------- 1 | timestamp: 2012-10-26T15:35:31.033385 2 | CREATE TABLE error( 3 | id INTEGER PRIMARY KEY AUTOINCREMENT, 4 | app CHAR(512), 5 | error_timestamp CHAR(512), 6 | remote_addr CHAR(512), 7 | traceback CHAR(512), 8 | frames TEXT 9 | ); 10 | success! 11 | timestamp: 2012-10-26T15:35:31.038146 12 | CREATE TABLE person( 13 | id INTEGER PRIMARY KEY AUTOINCREMENT, 14 | name CHAR(512) 15 | ); 16 | success! 17 | -------------------------------------------------------------------------------- /apps/admin/views/default.mobile/about.html: -------------------------------------------------------------------------------- 1 | {{extend 'default.mobile/layout.html'}} 2 | 3 | {{block sectionclass}}about{{end}} 4 | 5 |

{{=T("About application")}} "{{=app}}"

6 |

{{=T("About")}} {{=app}}

7 |

{{=button(URL('edit/%s/ABOUT' % (app)), T('Edit'))}}

8 |
{{=about}}
9 |

{{=T('License for')}} {{=app}}

10 |

{{=button(URL('edit/%s/LICENSE' % (app)), T('Edit'))}}

11 |
{{=license}}
12 | 13 | 14 | -------------------------------------------------------------------------------- /apps/admin/static/codemirror/lib/util/simple-hint.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-completions { 2 | position: absolute; 3 | z-index: 10; 4 | overflow: hidden; 5 | -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 6 | -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 7 | box-shadow: 2px 3px 5px rgba(0,0,0,.2); 8 | } 9 | .CodeMirror-completions select { 10 | background: #fafafa; 11 | outline: none; 12 | border: none; 13 | padding: 0; 14 | margin: 0; 15 | font-family: monospace; 16 | } 17 | -------------------------------------------------------------------------------- /contrib/plural_rules/ja.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf8 -*- 3 | # Plural-Forms for ja (Japanese) 4 | 5 | nplurals=1 # Japanese language has ONE form! 6 | 7 | # Always returns 0: 8 | get_plural_id = lambda n: 0 9 | 10 | # Construct and return plural form of *word* using 11 | # *plural_id* (which ALWAYS>0). This function will be executed 12 | # for words (or phrases) not found in plural_dict dictionary 13 | # construct_plural_form = lambda word, plural_id: word 14 | 15 | -------------------------------------------------------------------------------- /contrib/plural_rules/tr.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf8 -*- 3 | # Plural-Forms for tr (Turkish) 4 | 5 | nplurals=1 # Turkish language has ONE form! 6 | 7 | # Always returns 0: 8 | get_plural_id = lambda n: 0 9 | 10 | # Construct and return plural form of *word* using 11 | # *plural_id* (which ALWAYS>0). This function will be executed 12 | # for words (or phrases) not found in plural_dict dictionary 13 | # construct_plural_form = lambda word, plural_id: word 14 | 15 | -------------------------------------------------------------------------------- /contrib/plural_rules/zh.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf8 -*- 3 | # Plural-Forms for zh (Chinese) 4 | 5 | nplurals=1 # Chinese language has ONE form! 6 | 7 | # Always returns 0: 8 | get_plural_id = lambda n: 0 9 | 10 | # Construct and return plural form of *word* using 11 | # *plural_id* (which ALWAYS>0). This function will be executed 12 | # for words (or phrases) not found in plural_dict dictionary 13 | # construct_plural_form = lambda word, plural_id: word 14 | 15 | -------------------------------------------------------------------------------- /vars/b2e8f4c6053e432ccd0380a37b4d9aaf_person.table: -------------------------------------------------------------------------------- 1 | (dp1 2 | S'id' 3 | p2 4 | (dp3 5 | S'length' 6 | p4 7 | I512 8 | sS'unique' 9 | p5 10 | I00 11 | sS'sortable' 12 | p6 13 | I1 14 | sS'sql' 15 | p7 16 | S'INTEGER PRIMARY KEY AUTOINCREMENT' 17 | p8 18 | sS'notnull' 19 | p9 20 | I00 21 | sS'type' 22 | p10 23 | g2 24 | ssS'name' 25 | p11 26 | (dp12 27 | g4 28 | I512 29 | sg5 30 | I00 31 | sg6 32 | I2 33 | sg7 34 | S'CHAR(512)' 35 | p13 36 | sg9 37 | I00 38 | sg10 39 | S'string' 40 | p14 41 | ss. -------------------------------------------------------------------------------- /apps/admin/static/codemirror/README.md: -------------------------------------------------------------------------------- 1 | # CodeMirror [![Build Status](https://secure.travis-ci.org/marijnh/CodeMirror.png?branch=master)](http://travis-ci.org/marijnh/CodeMirror) 2 | 3 | CodeMirror is a JavaScript component that provides a code editor in 4 | the browser. When a mode is available for the language you are coding 5 | in, it will color your code, and optionally help with indentation. 6 | 7 | The project page is http://codemirror.net 8 | The manual is at http://codemirror.net/doc/manual.html 9 | -------------------------------------------------------------------------------- /apps/admin/views/default.mobile/edit_language.html: -------------------------------------------------------------------------------- 1 | {{extend 'default.mobile/layout.html'}} 2 | 10 | 11 | {{block sectionclass}}edit_language{{end}} 12 | 13 |

{{=T('Editing Language file')}} "{{=filename}}"

14 | 15 |
16 | {{=form}} 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /apps/admin/views/default.mobile/peek.html: -------------------------------------------------------------------------------- 1 | {{extend 'default.mobile/layout.html'}} 2 | 3 | {{block sectionclass}}peek{{end}} 4 | 5 |

{{=T("Peeking at file")}} "{{=filename}}"

6 | 7 |

8 | {{=button(URL('design',args=request.args[0]), T('back'))}} 9 | {{=button(URL('edit',args=request.args), T('Edit'))}} 10 |

11 | 12 | {{ 13 | if filename[-3:]=='.py': language='python' 14 | else: language='html' 15 | }} 16 | {{=CODE(data,language=language,link='/examples/global/vars/')}} 17 | 18 | -------------------------------------------------------------------------------- /apps/admin/views/default/upgrade_web2py.html: -------------------------------------------------------------------------------- 1 | {{extend 'layout.html'}} 2 | 3 | {{block sectionclass}}upgrade{{end}} 4 | 5 |

{{=T('web2py upgrade')}}

6 | 7 |

{{=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 |
11 | {{=dialog}} 12 |
13 | 14 | -------------------------------------------------------------------------------- /apps/admin/views/default.mobile/delete.html: -------------------------------------------------------------------------------- 1 | {{extend 'default.mobile/layout.html'}} 2 | 3 | {{block sectionclass}}delete{{end}} 4 | 5 |
6 |

{{=T('Are you sure you want to delete file "%s"?', filename)}}

7 |

{{=FORM(INPUT(_type='submit',_name='nodelete',_value=T('Abort')),INPUT(_type='hidden',_name='sender',_value=sender), _class="inline")}}{{=FORM(INPUT(_type='submit',_name='delete',_value=T('Delete')),INPUT(_type='hidden',_name='sender',_value=sender), _class="inline")}}

8 |
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('_'))}}

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/languages/plural-ru.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | { 3 | # "singular form (0)": ["first plural form (1)", "second plural form (2)", ...], 4 | 'выбрана': ['выбраны','выбрано'], 5 | 'запись': ['записи','записей'], 6 | 'изменена': ['изменены','изменено'], 7 | 'строка': ['строки','строк'], 8 | 'удалена': ['удалены','удалено'], 9 | 'день': ['дня', 'дней'], 10 | 'месяц': ['месяца','месяцев'], 11 | 'неделю': ['недели','недель'], 12 | 'год': ['года','лет'], 13 | 'час': ['часа','часов'], 14 | 'минуту': ['минуты','минут'], 15 | 'секунду': ['секунды','секунд'], 16 | } 17 | -------------------------------------------------------------------------------- /apps/admin/views/default/peek.html: -------------------------------------------------------------------------------- 1 | {{extend 'layout.html'}} 2 | 3 | {{block sectionclass}}peek{{end}} 4 | 5 |

{{=T("Peeking at file")}} "{{=filename}}"

6 | 7 |

8 | {{=button(URL('design',args=request.vars.app if request.vars.app else request.args[0], anchor=request.vars.id), T('back'))}} 9 | {{=button(URL('edit',args=request.args, vars=request.vars), T('Edit'))}} 10 |

11 | 12 | {{ 13 | if filename[-3:]=='.py': language='python' 14 | else: language='html' 15 | }} 16 | {{=CODE(data,language=language,link='/examples/global/vars/')}} 17 | 18 | -------------------------------------------------------------------------------- /apps/welcome_legacy/languages/plural-ru.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | { 3 | # "singular form (0)": ["first plural form (1)", "second plural form (2)", ...], 4 | 'выбрана': ['выбраны','выбрано'], 5 | 'запись': ['записи','записей'], 6 | 'изменена': ['изменены','изменено'], 7 | 'строка': ['строки','строк'], 8 | 'удалена': ['удалены','удалено'], 9 | 'день': ['дня', 'дней'], 10 | 'месяц': ['месяца','месяцев'], 11 | 'неделю': ['недели','недель'], 12 | 'год': ['года','лет'], 13 | 'час': ['часа','часов'], 14 | 'минуту': ['минуты','минут'], 15 | 'секунду': ['секунды','секунд'], 16 | } 17 | -------------------------------------------------------------------------------- /apps/admin/static/codemirror/theme/neat.css: -------------------------------------------------------------------------------- 1 | .cm-s-neat span.cm-comment { color: #a86; } 2 | .cm-s-neat span.cm-keyword { line-height: 1em; font-weight: bold; color: blue; } 3 | .cm-s-neat span.cm-string { color: #a22; } 4 | .cm-s-neat span.cm-builtin { line-height: 1em; font-weight: bold; color: #077; } 5 | .cm-s-neat span.cm-special { line-height: 1em; font-weight: bold; color: #0aa; } 6 | .cm-s-neat span.cm-variable { color: black; } 7 | .cm-s-neat span.cm-number, .cm-s-neat span.cm-atom { color: #3a3; } 8 | .cm-s-neat span.cm-meta {color: #555;} 9 | .cm-s-neat span.cm-link { color: #3a3; } 10 | -------------------------------------------------------------------------------- /apps/admin/static/codemirror/lib/util/dialog.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-dialog { 2 | position: relative; 3 | } 4 | 5 | .CodeMirror-dialog > div { 6 | position: absolute; 7 | top: 0; left: 0; right: 0; 8 | background: white; 9 | border-bottom: 1px solid #eee; 10 | z-index: 15; 11 | padding: .1em .8em; 12 | overflow: hidden; 13 | color: #333; 14 | } 15 | 16 | .CodeMirror-dialog input { 17 | border: none; 18 | outline: none; 19 | background: transparent; 20 | width: 20em; 21 | color: inherit; 22 | font-family: monospace; 23 | } 24 | 25 | .CodeMirror-dialog button { 26 | font-size: 70%; 27 | } -------------------------------------------------------------------------------- /apps/welcome_legacy/views/generic.jsonp: -------------------------------------------------------------------------------- 1 | {{ 2 | ### 3 | # response._vars contains the dictionary returned by the controller action 4 | ### 5 | try: 6 | from gluon.serializers import json 7 | result = "%s(%s)" % (request.vars['callback'], json(response._vars)) 8 | response.write(result, escape=False) 9 | response.headers['Content-Type'] = 'application/jsonp' 10 | except (TypeError, ValueError): 11 | raise HTTP(405, 'JSON serialization error') 12 | except ImportError: 13 | raise HTTP(405, 'JSON not available') 14 | except: 15 | raise HTTP(405, 'JSON error') 16 | }} -------------------------------------------------------------------------------- /apps/welcome_legacy/views/generic.ics: -------------------------------------------------------------------------------- 1 | {{ 2 | ### 3 | # response._vars contains the dictionary returned by the controller action 4 | # Assuming something like: 5 | # 6 | # db.define_table('event', 7 | # Field('title'), 8 | # Field('start_datetime','datetime'), 9 | # Field('stop_datetime','datetime')) 10 | # events = db(db.event).select() 11 | # 12 | # Aor this to work the action must return something like 13 | # 14 | # dict(events=events, title='title',link=URL('action'),timeshift=0) 15 | # 16 | ### 17 | from gluon.serializers import ics}}{{=XML(ics(**response._vars))}} 18 | -------------------------------------------------------------------------------- /apps/welcome/languages/plural-uk.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | { 3 | # "singular form (0)": ["first plural form (1)", "second plural form (2)", ...], 4 | 'байт': ['байти','байтів'], 5 | 'годину': ['години','годин'], 6 | 'елемент': ['елементи','елементів'], 7 | 'запис': ['записи','записів'], 8 | 'поцілювання': ['поцілювання','поцілювань'], 9 | 'рядок': ['рядки','рядків'], 10 | 'секунду': ['секунди','секунд'], 11 | 'схибнення': ['схибнення','схибнень'], 12 | 'хвилину': ['хвилини','хвилин'], 13 | 'день': ['дні', 'днів'], 14 | 'місяць': ['місяці','місяців'], 15 | 'тиждень': ['тижні','тижнів'], 16 | 'рік': ['роки','років'], 17 | } 18 | -------------------------------------------------------------------------------- /apps/welcome_legacy/languages/plural-uk.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | { 3 | # "singular form (0)": ["first plural form (1)", "second plural form (2)", ...], 4 | 'байт': ['байти','байтів'], 5 | 'годину': ['години','годин'], 6 | 'елемент': ['елементи','елементів'], 7 | 'запис': ['записи','записів'], 8 | 'поцілювання': ['поцілювання','поцілювань'], 9 | 'рядок': ['рядки','рядків'], 10 | 'секунду': ['секунди','секунд'], 11 | 'схибнення': ['схибнення','схибнень'], 12 | 'хвилину': ['хвилини','хвилин'], 13 | 'день': ['дні', 'днів'], 14 | 'місяць': ['місяці','місяців'], 15 | 'тиждень': ['тижні','тижнів'], 16 | 'рік': ['роки','років'], 17 | } 18 | -------------------------------------------------------------------------------- /apps/admin/views/default.mobile/upgrade_web2py.html: -------------------------------------------------------------------------------- 1 | {{extend 'default.mobile/layout.html'}} 2 | 3 | {{block sectionclass}}upgrade{{end}} 4 | 5 |

{{=T('web2py upgrade')}}

6 | 7 |

{{=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 |
11 | {{=FORM(INPUT(_type='submit',_name='noupgrade',_value=T('Cancel')), _class='inline')}} 12 | {{=FORM(INPUT(_type='submit',_name='upgrade',_value=T('Upgrade')), _class='inline')}} 13 |
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')}}

9 | 10 |
11 | {{=FORM(INPUT(_type='submit',_name='nodowngrade',_value=T('Cancel')), _class='inline')}} 12 | {{=FORM(INPUT(_type='submit',_name='downgrade',_value=T('Downgrade')), _class='inline')}} 13 |
14 | 15 | -------------------------------------------------------------------------------- /contrib/plural_rules/pt.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf8 -*- 3 | # Plural-Forms for pt (Portuguese) 4 | 5 | nplurals=2 # Portuguese 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 | -------------------------------------------------------------------------------- /contrib/plural_rules/ro.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf8 -*- 3 | # Plural-Forms for ro (Romanian) 4 | 5 | nplurals=2 # Romanian 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/static/codemirror/theme/elegant.css: -------------------------------------------------------------------------------- 1 | .cm-s-elegant span.cm-number, .cm-s-elegant span.cm-string, .cm-s-elegant span.cm-atom {color: #762;} 2 | .cm-s-elegant span.cm-comment {color: #262; font-style: italic; line-height: 1em;} 3 | .cm-s-elegant span.cm-meta {color: #555; font-style: italic; line-height: 1em;} 4 | .cm-s-elegant span.cm-variable {color: black;} 5 | .cm-s-elegant span.cm-variable-2 {color: #b11;} 6 | .cm-s-elegant span.cm-qualifier {color: #555;} 7 | .cm-s-elegant span.cm-keyword {color: #730;} 8 | .cm-s-elegant span.cm-builtin {color: #30a;} 9 | .cm-s-elegant span.cm-error {background-color: #fdd;} 10 | .cm-s-elegant span.cm-link {color: #762;} 11 | -------------------------------------------------------------------------------- /contrib/plural_rules/de.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf8 -*- 3 | # Plural-Forms for de (Deutsch) 4 | 5 | nplurals=2 # German language 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 | -------------------------------------------------------------------------------- /contrib/plural_rules/es.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf8 -*- 3 | # Plural-Forms for es (Spanish) 4 | 5 | nplurals=2 # Spanish language 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 | -------------------------------------------------------------------------------- /contrib/plural_rules/fr.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf8 -*- 3 | # Plural-Forms for fr (French)) 4 | 5 | nplurals=2 # French language 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 | -------------------------------------------------------------------------------- /contrib/plural_rules/he.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf8 -*- 3 | # Plural-Forms for he (Hebrew) 4 | 5 | nplurals=2 # Hebrew language 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 | -------------------------------------------------------------------------------- /contrib/plural_rules/it.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf8 -*- 3 | # Plural-Forms for it (Italian) 4 | 5 | nplurals=2 # Italian language 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 | -------------------------------------------------------------------------------- /contrib/plural_rules/bg.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf8 -*- 3 | # Plural-Forms for bg (Bulgarian) 4 | 5 | nplurals=2 # Bulgarian language 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 | -------------------------------------------------------------------------------- /contrib/plural_rules/hu.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf8 -*- 3 | # Plural-Forms for hu (Hungarian) 4 | 5 | nplurals=2 # Hungarian language 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 | -------------------------------------------------------------------------------- /contrib/plural_rules/af.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf8 -*- 3 | # Plural-Forms for af (Afrikaans (South Africa)) 4 | 5 | nplurals=2 # Afrikaans language 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/twitter.load: -------------------------------------------------------------------------------- 1 | {{response.headers['web2py-response-flash']=response.flash}} 2 | 3 | {{ 4 | """ 5 | Tweet attributes 6 | 7 | 'iso_language_code', 8 | 'to_user_name', 9 | 'to_user_id_str', 10 | 'profile_image_url_https', 11 | 'from_user_id_str', 12 | 'text', 13 | 'from_user_name', 14 | 'in_reply_to_status_id_str', 15 | 'profile_image_url', 16 | 'id', 17 | 'to_user', 18 | 'source', 19 | 'in_reply_to_status_id', 20 | 'id_str', 21 | 'from_user', 22 | 'from_user_id', 23 | 'to_user_id', 24 | 'geo', 25 | 'created_at', 26 | 'metadata' 27 | """ 28 | }} 29 | 30 | {{ for t in tweets: }} 31 | {{ =DIV(H5(t["from_user_name"])) }} 32 | {{ =DIV(t["text"]) }} 33 | {{ =BR() }} 34 | {{ pass }} 35 | -------------------------------------------------------------------------------- /apps/admin/views/default/user.html: -------------------------------------------------------------------------------- 1 | {{extend 'layout.html'}} 2 |

{{=T( request.args(0).replace('_',' ').capitalize() )}}

3 |
4 | {{=form}} 5 | {{if request.args(0)=='login':}} 6 | {{if not 'register' in auth.settings.actions_disabled:}} 7 |
register 8 | {{pass}} 9 | {{if not 'request_reset_password' in auth.settings.actions_disabled:}} 10 |
lost password 11 | {{pass}} 12 | {{pass}} 13 |
14 | 15 | 20 | 21 | -------------------------------------------------------------------------------- /apps/admin/views/default/edit_language.html: -------------------------------------------------------------------------------- 1 | {{extend 'layout.html'}} 2 | 13 | 14 | {{block sectionclass}}edit_language{{end}} 15 | 16 |

{{=T('Editing Language file')}} "{{=filename}}"

17 | 18 | {{=T('Hide/Show Translated strings')}} 19 | 20 |
21 | {{=form}} 22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /apps/admin/views/wizard/generated.html: -------------------------------------------------------------------------------- 1 | {{extend 'layout.html'}} 2 | 3 | {{block sectionclass}}generated{{end}} 4 | 5 | Open new app in new window 6 | Back to wizard 7 | Admin design page 8 | {{if have_mercurial:}} 9 | Admin versioning page 10 | {{pass}} 11 | Database administration 12 |

13 | 14 | 15 | -------------------------------------------------------------------------------- /apps/admin/views/default.mobile/user.html: -------------------------------------------------------------------------------- 1 | {{extend 'default.mobile/layout.html'}} 2 |

{{=T( request.args(0).replace('_',' ').capitalize() )}}

3 |
4 | {{=form}} 5 | {{if request.args(0)=='login':}} 6 | {{if not 'register' in auth.settings.actions_disabled:}} 7 |
register 8 | {{pass}} 9 | {{if not 'request_reset_password' in auth.settings.actions_disabled:}} 10 |
lost password 11 | {{pass}} 12 | {{pass}} 13 |
14 | 15 | 20 | 21 | -------------------------------------------------------------------------------- /apps/admin/views/web2py_ajax.html: -------------------------------------------------------------------------------- 1 | 7 | {{ 8 | response.files.insert(0,URL('static','js/jquery.js')) 9 | response.files.insert(1,URL('static','css/calendar.css')) 10 | response.files.insert(2,URL('static','js/calendar.js')) 11 | response.files.insert(3,URL('static','js/web2py.js')) 12 | response.include_meta() 13 | response.include_files() 14 | }} 15 | -------------------------------------------------------------------------------- /apps/welcome_legacy/views/web2py_ajax.html: -------------------------------------------------------------------------------- 1 | 7 | {{ 8 | response.files.insert(0,URL('static','js/jquery.js')) 9 | response.files.insert(1,URL('static','css/calendar.css')) 10 | response.files.insert(2,URL('static','js/calendar.js')) 11 | response.files.insert(3,URL('static','js/web2py.js')) 12 | response.include_meta() 13 | response.include_files() 14 | }} 15 | -------------------------------------------------------------------------------- /contrib/plural_rules/pl.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf8 -*- 3 | # Plural-Forms for pl (Polish) 4 | 5 | nplurals=3 # Polish 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==1 else 12 | 1 if 2<=n<=4 else 13 | 2) 14 | 15 | # Construct and return plural form of *word* using 16 | # *plural_id* (which ALWAYS>0). This function will be executed 17 | # for words (or phrases) not found in plural_dict dictionary 18 | # construct_plural_form = lambda word, plural_id: (word + 'suffix') 19 | 20 | -------------------------------------------------------------------------------- /contrib/plural_rules/cs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf8 -*- 3 | # Plural-Forms for cs (Czech) 4 | 5 | nplurals=3 # Czech 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==1 else 12 | 1 if 2<=n<=4 else 13 | 2 ) 14 | 15 | # Construct and return plural form of *word* using 16 | # *plural_id* (which ALWAYS>0). This function will be executed 17 | # for words (or phrases) not found in plural_dict dictionary 18 | # construct_plural_form = lambda word, plural_id: (word + 'suffix') 19 | 20 | -------------------------------------------------------------------------------- /apps/admin/views/default/resolve.html: -------------------------------------------------------------------------------- 1 | {{extend 'layout.html'}} 2 | 3 | {{block sectionclass}}resolve{{end}} 4 | 5 |

{{=T('Resolve Conflict file')}} "{{=filename}}"

6 | 7 | 12 | 13 |
14 | 15 | 16 | 17 |
18 | 19 |
20 |
21 | {{=diff}} 22 |
23 |
24 |
25 | 26 | -------------------------------------------------------------------------------- /apps/admin/views/toolbar/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{response.files.append(URL('static','js/jquery.js'))}} 4 | {{include 'web2py_ajax.html'}} 5 | 6 | 7 |
8 | URL: {{=URL(app,'default','index')}} 9 | 10 | 14 |
15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /contrib/plural_rules/en.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf8 -*- 3 | # Plural-Forms for en (English) 4 | 5 | nplurals=2 # English language 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 + 17 | ('es' if word[-1:] in ('s','x','o') or 18 | word[-2:] in ('sh','ch') 19 | else 's')) 20 | 21 | -------------------------------------------------------------------------------- /contrib/plural_rules/lt.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf8 -*- 3 | # Plural-Forms for lt (Lithuanian) 4 | 5 | nplurals=3 # Lithuanian 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 % 100 < 10 or n % 100 >= 20) else 13 | 2) 14 | 15 | # Construct and return plural form of *word* using 16 | # *plural_id* (which ALWAYS>0). This function will be executed 17 | # for words (or phrases) not found in plural_dict dictionary 18 | # construct_plural_form = lambda word, plural_id: (word + 'suffix') 19 | 20 | -------------------------------------------------------------------------------- /contrib/plural_rules/sl.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf8 -*- 3 | # Plural-Forms for sl (Slovenian) 4 | 5 | nplurals=4 # Slovenian language has 4 forms: 6 | # 1 singular and 3 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 % 100 == 1 else 12 | 1 if n % 100 == 2 else 13 | 2 if n % 100 in (3,4) else 14 | 3) 15 | 16 | # Construct and return plural form of *word* using 17 | # *plural_id* (which ALWAYS>0). This function will be executed 18 | # for words (or phrases) not found in plural_dict dictionary 19 | # construct_plural_form = lambda word, plural_id: (word + 'suffix') 20 | 21 | -------------------------------------------------------------------------------- /apps/admin/views/default.mobile/resolve.html: -------------------------------------------------------------------------------- 1 | {{extend 'default.mobile/layout.html'}} 2 | 3 | {{block sectionclass}}resolve{{end}} 4 | 5 |

{{=T('Resolve Conflict file')}} "{{=filename}}"

6 | 7 | 12 | 13 |
14 | 15 | 16 | 17 |
18 | 19 |
20 |
21 | {{=diff}} 22 |
23 |
24 |
25 | 26 | -------------------------------------------------------------------------------- /apps/admin/views/default.mobile/index.html: -------------------------------------------------------------------------------- 1 | {{extend 'default.mobile/layout.html'}} 2 | 3 |

web2py™ {{=T('Web Framework')}}

4 |

{{=T('Login to the Administrative Interface')}}

5 | 6 | {{if request.is_https or request.is_local:}} 7 |
8 |
9 |
10 | 11 | 12 | 13 |
{{=T('Administrator Password:')}}
14 | 15 |
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 |

Commit form

8 | {{=form}} 9 | 10 | 11 | {{if repo['.'].rev()>=0:}} 12 |

Last Revision

13 | 14 | 15 | 16 | 17 | 18 | 19 |
Revision:{{=repo['.'].rev()}}
Node:{{=repo['.']}}
Created by:{{=repo['.'].user()}}
Created on:{{=time.ctime(repo['.'].date()[0])}}
Description:{{=repo['.'].description()}}
20 | 21 |

Past revisions

22 |
23 | {{=changes}} 24 |
25 | 26 | {{if files:}} 27 |

Committed files

28 |
29 | {{=files}} 30 |
31 | {{pass}} 32 | 33 | {{pass}} 34 | 35 | -------------------------------------------------------------------------------- /web3py/session.py: -------------------------------------------------------------------------------- 1 | from .utils import secure_loads, secure_dumps 2 | from .cleaners import Cleaner 3 | from .current import current 4 | from .storage import Storage 5 | 6 | class SessionCookieManager(Cleaner): 7 | def __init__(self,key): 8 | self.key = key 9 | def on_start(self): 10 | request = current.request 11 | self.cookie_data_name = 'w3p_session_data_%s' % request.application 12 | if self.cookie_data_name in request.cookies: 13 | cookie_data = request.cookies[self.cookie_data_name].value 14 | current.session = secure_loads(cookie_data,self.key) 15 | if not current.session: 16 | current.session = Storage() 17 | def on_success(self): 18 | data = secure_dumps(current.session,self.key) 19 | current.response.cookies[self.cookie_data_name] = data 20 | def on_failure(self): 21 | pass 22 | -------------------------------------------------------------------------------- /apps/admin/models/0_imports.py: -------------------------------------------------------------------------------- 1 | import time 2 | import os 3 | import sys 4 | import re 5 | import urllib 6 | import cgi 7 | import difflib 8 | import shutil 9 | import stat 10 | import socket 11 | 12 | from textwrap import dedent 13 | 14 | try: 15 | from mercurial import ui, hg, cmdutil 16 | try: 17 | from mercurial.scmutil import addremove 18 | except: 19 | from mercurial.cmdutil import addremove 20 | have_mercurial = True 21 | except ImportError: 22 | have_mercurial = False 23 | 24 | 25 | #from gluon.utils import md5_hash 26 | from gluon.fileutils import listdir, cleanpath, up 27 | from gluon.fileutils import tar, tar_compiled, untar, fix_newlines 28 | #from gluon.languages import findT, update_all_languages 29 | #from gluon.myregex import * 30 | #from gluon.restricted import * 31 | #from gluon.compileapp import compile_application, remove_compiled_application 32 | -------------------------------------------------------------------------------- /apps/admin/controllers/toolbar.py: -------------------------------------------------------------------------------- 1 | import os 2 | from gluon.settings import global_settings, read_file 3 | # 4 | 5 | 6 | def index(): 7 | app = request.args(0) 8 | return dict(app=app) 9 | 10 | 11 | def profiler(): 12 | """ 13 | to use the profiler start web2py with -F profiler.log 14 | """ 15 | KEY = 'web2py_profiler_size' 16 | filename = global_settings.cmd_options.profiler_filename 17 | data = 'profiler disabled' 18 | if filename: 19 | if KEY in request.cookies: 20 | size = int(request.cookies[KEY].value) 21 | else: 22 | size = 0 23 | if os.path.exists(filename): 24 | data = read_file('profiler.log', 'rb') 25 | if size < len(data): 26 | data = data[size:] 27 | else: 28 | size = 0 29 | size += len(data) 30 | response.cookies[KEY] = size 31 | return data 32 | -------------------------------------------------------------------------------- /apps/admin/views/default/about.html: -------------------------------------------------------------------------------- 1 | {{extend 'layout.html'}} 2 | 3 | {{block sectionclass}}about{{end}} 4 | 5 |

{{=T("About application")}} "{{=app}}"

6 |

{{=T("About")}} {{=app}}

7 |

{{=button(URL('edit/%s/ABOUT' % (app)), T('Edit'))}}

8 |
{{=about}}
9 |

{{=T('License for')}} {{=app}}

10 |

{{=button(URL('edit/%s/LICENSE' % (app)), T('Edit'))}}

11 |
{{=license}}
12 | 13 | 14 | 15 | 16 |

{{=T('Project Progress')}}

17 |

18 |

19 |
20 |
21 | 24 |

25 | -------------------------------------------------------------------------------- /apps/admin/cron/expire_sessions.py: -------------------------------------------------------------------------------- 1 | EXPIRATION_MINUTES=60 2 | DIGITS=('0','1','2','3','4','5','6','7','8','9') 3 | import os, time, stat, cPickle, logging 4 | path=os.path.join(request.folder,'sessions') 5 | if not os.path.exists(path): 6 | os.mkdir(path) 7 | now=time.time() 8 | for filename in os.listdir(path): 9 | fullpath=os.path.join(path,filename) 10 | if os.path.isfile(fullpath) and filename.startswith(DIGITS): 11 | try: 12 | filetime = os.stat(fullpath)[stat.ST_MTIME] # get it before our io 13 | try: 14 | session_data = cPickle.load(open(fullpath, 'rb+')) 15 | expiration = session_data['auth']['expiration'] 16 | except: 17 | expiration = EXPIRATION_MINUTES * 60 18 | if (now - filetime) > expiration: 19 | os.unlink(fullpath) 20 | except: 21 | logging.exception('failure to check %s'%fullpath) 22 | -------------------------------------------------------------------------------- /apps/welcome_legacy/views/default/user.html: -------------------------------------------------------------------------------- 1 | {{extend 'layout.html'}} 2 |

{{=T( request.args(0).replace('_',' ').capitalize() )}}

3 |
4 | {{ 5 | if request.args(0)=='login': 6 | if not 'register' in auth.settings.actions_disabled: 7 | form.add_button(T('Register'),URL(args='register'),_class='btn') 8 | pass 9 | if not 'request_reset_password' in auth.settings.actions_disabled: 10 | form.add_button(T('Lost Password'),URL(args='request_reset_password'),_class='btn') 11 | pass 12 | pass 13 | =form 14 | }} 15 |
16 | 24 | -------------------------------------------------------------------------------- /apps/admin/views/default/index.html: -------------------------------------------------------------------------------- 1 | {{extend 'layout.html'}} 2 | 7 | 8 | {{block sectionclass}}login{{end}} 9 | 10 |

web2py™ {{=T('Web Framework')}}

11 |

{{=T('Login to the Administrative Interface')}}

12 | {{if request.is_https or request.is_local:}} 13 |
14 |
15 |
16 | 17 | 18 | 19 |
{{=T('Administrator Password:')}}
20 |
21 |
22 | {{else:}} 23 |

{{=T('ATTENTION: Login requires a secure (HTTPS) connection or running on localhost.')}}

24 | {{pass}} 25 | 26 | 27 | -------------------------------------------------------------------------------- /apps/admin/static/css/jqueryMultiSelect.css: -------------------------------------------------------------------------------- 1 | .multiSelect { 2 | width: 200px; 3 | border: solid 1px #BBB; 4 | background: #FFF right center no-repeat; 5 | padding: 2px 4px; 6 | padding-right: 20px; 7 | display: inline; 8 | } 9 | 10 | .multiSelect.hover { 11 | background: right center no-repeat; 12 | } 13 | 14 | .multiSelect.active, 15 | .multiSelect.focus { 16 | border: inset 1px #000; 17 | } 18 | 19 | .multiSelect.active { 20 | background: right center no-repeat; 21 | } 22 | 23 | .multiSelectOptions { 24 | width: 500px; 25 | max-height: 150px; 26 | margin-top: -1px; 27 | overflow: auto; 28 | border: solid 1px #B2B2B2; 29 | background: #FFF; 30 | } 31 | 32 | .multiSelectOptions LABEL { 33 | padding: 2px 5px; 34 | display: block; 35 | } 36 | 37 | .multiSelectOptions LABEL.checked { 38 | background: #E6E6E6; 39 | } 40 | 41 | .multiSelectOptions LABEL.selectAll { 42 | border-bottom: dotted 1px #CCC; 43 | } 44 | 45 | .multiSelectOptions LABEL.hover { 46 | background: #CFCFCF; 47 | } 48 | -------------------------------------------------------------------------------- /apps/welcome_legacy/views/generic.load: -------------------------------------------------------------------------------- 1 | {{''' 2 | # License: Public Domain 3 | # Author: Iceberg at 21cn dot com 4 | 5 | With this generic.load file, you can use same function to serve two purposes. 6 | 7 | = regular action 8 | - ajax callback (when called with .load) 9 | 10 | Example modified from http://www.web2py.com/AlterEgo/default/show/252: 11 | 12 | def index(): 13 | return dict( 14 | part1='hello world', 15 | part2=LOAD(url=URL(r=request,f='auxiliary.load'),ajax=True)) 16 | 17 | def auxiliary(): 18 | form=SQLFORM.factory(Field('name')) 19 | if form.accepts(request.vars): 20 | response.flash = 'ok' 21 | return dict(message="Hello %s" % form.vars.name) 22 | return dict(form=form) 23 | 24 | Notice: 25 | 26 | - no need to set response.headers['web2py-response-flash'] 27 | - no need to return a string 28 | even if the function is called via ajax. 29 | 30 | '''}}{{if len(response._vars)==1:}}{{=response._vars.values()[0]}}{{else:}}{{=BEAUTIFY(response._vars)}}{{pass}} -------------------------------------------------------------------------------- /apps/admin/views/plugin_jqmobile/index.html: -------------------------------------------------------------------------------- 1 | {{extend 'plugin_jqmobile/layout.html'}} 2 | 3 | {{block header}} 4 | {{if 'auth' in globals():}} 5 | {{if not auth.user:}} 6 | Login 7 | {{else:}} 8 | Logout 9 | {{pass}} 10 | {{pass}} 11 | {{=T("Home")}} 12 | {{end}} 13 | 14 | 15 |
Search results for tag: {{='tag'}}
16 | 17 | 26 | 27 |
28 | {{for tag in ('dog','cat','mouse'):}} 29 | {{=tag}} 30 | {{pass}} 31 |
32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /apps/admin/views/default/test.html: -------------------------------------------------------------------------------- 1 | {{extend 'layout.html'}} 2 | 3 | {{block sectionclass}}test{{end}} 4 | 5 |

{{=T('Testing application')}} "{{=app}}"

6 | 7 | {{for controller in sorted(controllers):}} 8 |
9 |

Testing controller "{{=controller}}"... please wait!

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 | -------------------------------------------------------------------------------- /web3py/storage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | class Storage(dict): 5 | """ 6 | A Storage object is like a dictionary except `obj.foo` can be used 7 | in addition to `obj['foo']`, and setting obj.foo = None deletes item foo. 8 | 9 | >>> o = Storage(a=1) 10 | >>> print o.a 11 | 1 12 | 13 | >>> o['a'] 14 | 1 15 | 16 | >>> o.a = 2 17 | >>> print o['a'] 18 | 2 19 | 20 | >>> del o.a 21 | >>> print o.a 22 | None 23 | """ 24 | __slots__ = () 25 | __setattr__ = dict.__setitem__ 26 | __delattr__ = dict.__delitem__ 27 | __getitem__ = dict.get 28 | __getattr__ = dict.get 29 | __repr__ = lambda self: '' % dict.__repr__(self) 30 | # http://stackoverflow.com/questions/5247250/why-does-pickle-getstate-accept-as-a-return-value-the-very-instance-it-requi 31 | __getstate__ = lambda self: None 32 | __copy__ = lambda self: Storage(self) 33 | 34 | 35 | if __name__ == '__main__': 36 | import doctest 37 | doctest.testmod() 38 | -------------------------------------------------------------------------------- /apps/admin/views/default.mobile/test.html: -------------------------------------------------------------------------------- 1 | {{extend 'default.mobile/layout.html'}} 2 | 3 | {{block sectionclass}}test{{end}} 4 | 5 |

{{=T('Testing application')}} "{{=app}}"

6 | 7 | {{for controller in sorted(controllers):}} 8 |
9 |

Testing controller "{{=controller}}"... please wait!

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 |

CodeMirror: CSS mode

14 |
49 | 52 | 53 |

MIME types defined: text/css.

54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /apps/admin/static/codemirror/theme/rubyblue.css: -------------------------------------------------------------------------------- 1 | .cm-s-rubyblue { font:13px/1.4em Trebuchet, Verdana, sans-serif; } /* - customized editor font - */ 2 | 3 | .cm-s-rubyblue { background: #112435; color: white; } 4 | .cm-s-rubyblue div.CodeMirror-selected { background: #38566F !important; } 5 | .cm-s-rubyblue .CodeMirror-gutter { background: #1F4661; border-right: 7px solid #3E7087; min-width:2.5em; } 6 | .cm-s-rubyblue .CodeMirror-gutter-text { color: white; } 7 | .cm-s-rubyblue .CodeMirror-cursor { border-left: 1px solid white !important; } 8 | 9 | .cm-s-rubyblue span.cm-comment { color: #999; font-style:italic; line-height: 1em; } 10 | .cm-s-rubyblue span.cm-atom { color: #F4C20B; } 11 | .cm-s-rubyblue span.cm-number, .cm-s-rubyblue span.cm-attribute { color: #82C6E0; } 12 | .cm-s-rubyblue span.cm-keyword { color: #F0F; } 13 | .cm-s-rubyblue span.cm-string { color: #F08047; } 14 | .cm-s-rubyblue span.cm-meta { color: #F0F; } 15 | .cm-s-rubyblue span.cm-variable-2, .cm-s-rubyblue span.cm-tag { color: #7BD827; } 16 | .cm-s-rubyblue span.cm-variable-3, .cm-s-rubyblue span.cm-def { color: white; } 17 | .cm-s-rubyblue span.cm-error { color: #AF2018; } 18 | .cm-s-rubyblue span.cm-bracket { color: #F0F; } 19 | .cm-s-rubyblue span.cm-link { color: #F4C20B; } 20 | .cm-s-rubyblue span.CodeMirror-matchingbracket { color:#F0F !important; } 21 | .cm-s-rubyblue span.cm-builtin, .cm-s-rubyblue span.cm-special { color: #FF9D00; } 22 | -------------------------------------------------------------------------------- /apps/welcome/static/js/web2py_bootstrap.js: -------------------------------------------------------------------------------- 1 | // this code improves bootstrap menus and adds dropdown support 2 | jQuery(function(){ 3 | jQuery('.nav>li>a').each(function(){ 4 | if(jQuery(this).parent().find('ul').length) 5 | jQuery(this).attr({'class':'dropdown-toggle','data-toggle':'dropdown'}).append(''); 6 | }); 7 | jQuery('.nav li li').each(function(){ 8 | if(jQuery(this).find('ul').length) 9 | jQuery(this).addClass('dropdown-submenu'); 10 | }); 11 | function hoverMenu(){ 12 | var wid = document.documentElement.clientWidth; //faster than $(window).width() and cross browser 13 | if (wid>=980){ 14 | jQuery('ul.nav a.dropdown-toggle').parent().hover(function(){ 15 | mi = jQuery(this).addClass('open'); 16 | mi.children('.dropdown-menu').stop(true, true).delay(200).fadeIn(400); 17 | }, function(){ 18 | mi = jQuery(this); 19 | mi.children('.dropdown-menu').stop(true, true).delay(200).fadeOut(function(){mi.removeClass('open')}); 20 | }); 21 | }; 22 | } 23 | hoverMenu(); // first page load 24 | jQuery(window).resize(hoverMenu); // on resize event 25 | jQuery('ul.nav li.dropdown a').click(function(){window.location=jQuery(this).attr('href');}); 26 | // make all buttons bootstrap buttons 27 | jQuery('button, form input[type="submit"], form input[type="button"]').addClass('btn'); 28 | }); 29 | -------------------------------------------------------------------------------- /web3py/fancy_pickle.py: -------------------------------------------------------------------------------- 1 | try: 2 | from cStringIO import StringIO # python 3 3 | from cPickle import Pickler, Unpickler, UnpicklingError 4 | except ImportError: 5 | from io import StringIO # python 2 6 | from pickle import Pickler, Unpickler, UnpicklingError 7 | long, str, unicode = int, bytes, str 8 | 9 | __all__ = ['load','loads','dump','dumps'] 10 | 11 | KEY = 'unpickled-object:' 12 | 13 | def persistent_id(obj): 14 | if not isinstance(obj,(int,long,str,unicode,list,tuple,dict)): 15 | return KEY + repr(obj) 16 | else: 17 | return None 18 | 19 | def persistent_load(persid): 20 | if persid.startswith(KEY): 21 | value = persid[len(KEY):] 22 | return value 23 | else: 24 | raise UnpicklingError('Invalid persistent id') 25 | 26 | def dump(data,stream): 27 | p = Pickler(stream) 28 | p.persistent_id = persistent_id 29 | p.dump(data) 30 | 31 | def dumps(data): 32 | stream = StringIO() 33 | dump(data,stream) 34 | return stream.getvalue() 35 | 36 | def load(stream): 37 | p = Unpickler(stream) 38 | p.persistent_load = persistent_load 39 | return p.load() 40 | 41 | def loads(s): 42 | return load(StringIO(s)) 43 | 44 | def check(): 45 | a = {'this':'is', 'a':lambda: 'test'} 46 | s = dumps(a) 47 | b = loads(s) 48 | assert "{'this': 'is', 'a': ' at 0x" in repr(b) 49 | 50 | check() 51 | -------------------------------------------------------------------------------- /apps/welcome_legacy/static/js/web2py_bootstrap.js: -------------------------------------------------------------------------------- 1 | // this code improves bootstrap menus and adds dropdown support 2 | jQuery(function(){ 3 | jQuery('.nav>li>a').each(function(){ 4 | if(jQuery(this).parent().find('ul').length) 5 | jQuery(this).attr({'class':'dropdown-toggle','data-toggle':'dropdown'}).append(''); 6 | }); 7 | jQuery('.nav li li').each(function(){ 8 | if(jQuery(this).find('ul').length) 9 | jQuery(this).addClass('dropdown-submenu'); 10 | }); 11 | function hoverMenu(){ 12 | var wid = document.documentElement.clientWidth; //faster than $(window).width() and cross browser 13 | if (wid>=980){ 14 | jQuery('ul.nav a.dropdown-toggle').parent().hover(function(){ 15 | mi = jQuery(this).addClass('open'); 16 | mi.children('.dropdown-menu').stop(true, true).delay(200).fadeIn(400); 17 | }, function(){ 18 | mi = jQuery(this); 19 | mi.children('.dropdown-menu').stop(true, true).delay(200).fadeOut(function(){mi.removeClass('open')}); 20 | }); 21 | }; 22 | } 23 | hoverMenu(); // first page load 24 | jQuery(window).resize(hoverMenu); // on resize event 25 | jQuery('ul.nav li.dropdown a').click(function(){window.location=jQuery(this).attr('href');}); 26 | // make all buttons bootstrap buttons 27 | jQuery('button, form input[type="submit"], form input[type="button"]').addClass('btn'); 28 | }); 29 | -------------------------------------------------------------------------------- /apps/admin/static/codemirror/keymap/emacs.js: -------------------------------------------------------------------------------- 1 | // TODO number prefixes 2 | (function() { 3 | // Really primitive kill-ring implementation. 4 | var killRing = []; 5 | function addToRing(str) { 6 | killRing.push(str); 7 | if (killRing.length > 50) killRing.shift(); 8 | } 9 | function getFromRing() { return killRing[killRing.length - 1] || ""; } 10 | function popFromRing() { if (killRing.length > 1) killRing.pop(); return getFromRing(); } 11 | 12 | CodeMirror.keyMap.emacs = { 13 | "Ctrl-X": function(cm) {cm.setOption("keyMap", "emacs-Ctrl-X");}, 14 | "Ctrl-W": function(cm) {addToRing(cm.getSelection()); cm.replaceSelection("");}, 15 | "Ctrl-Alt-W": function(cm) {addToRing(cm.getSelection()); cm.replaceSelection("");}, 16 | "Alt-W": function(cm) {addToRing(cm.getSelection());}, 17 | "Ctrl-Y": function(cm) {cm.replaceSelection(getFromRing());}, 18 | "Alt-Y": function(cm) {cm.replaceSelection(popFromRing());}, 19 | "Ctrl-/": "undo", "Shift-Ctrl--": "undo", "Shift-Alt-,": "goDocStart", "Shift-Alt-.": "goDocEnd", 20 | "Ctrl-S": "findNext", "Ctrl-R": "findPrev", "Ctrl-G": "clearSearch", "Shift-Alt-5": "replace", 21 | "Ctrl-Z": "undo", "Cmd-Z": "undo", "Alt-/": "autocomplete", 22 | fallthrough: ["basic", "emacsy"] 23 | }; 24 | 25 | CodeMirror.keyMap["emacs-Ctrl-X"] = { 26 | "Ctrl-S": "save", "Ctrl-W": "save", "S": "saveAll", "F": "open", "U": "undo", "K": "close", 27 | auto: "emacs", nofallthrough: true 28 | }; 29 | })(); 30 | -------------------------------------------------------------------------------- /apps/admin/views/gae/deploy.html: -------------------------------------------------------------------------------- 1 | {{extend 'layout.html'}} 2 | 3 | 4 | 5 | 14 | 15 |

{{=T("Google App Engine Deployment Interface")}}

16 | 17 |

{{=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.")}}

18 | 19 | {{if command:}} 20 |

Command

21 | 22 | {{=CODE(command)}} 23 |

{{=T("GAE Output")}}

24 |

25 | {{else:}}
26 | 

{{=T("Deployment form")}}

27 |
28 | {{=form}} 29 |
30 | {{pass}} 31 | 32 | -------------------------------------------------------------------------------- /apps/admin/static/codemirror/theme/vibrant-ink.css: -------------------------------------------------------------------------------- 1 | /* Taken from the popular Visual Studio Vibrant Ink Schema */ 2 | 3 | .cm-s-vibrant-ink { background: black; color: white; } 4 | .cm-s-vibrant-ink .CodeMirror-selected { background: #35493c !important; } 5 | 6 | .cm-s-vibrant-ink .CodeMirror-gutter { background: #002240; border-right: 1px solid #aaa; } 7 | .cm-s-vibrant-ink .CodeMirror-gutter-text { color: #d0d0d0; } 8 | .cm-s-vibrant-ink .CodeMirror-cursor { border-left: 1px solid white !important; } 9 | 10 | .cm-s-vibrant-ink .cm-keyword { color: #CC7832; } 11 | .cm-s-vibrant-ink .cm-atom { color: #FC0; } 12 | .cm-s-vibrant-ink .cm-number { color: #FFEE98; } 13 | .cm-s-vibrant-ink .cm-def { color: #8DA6CE; } 14 | .cm-s-vibrant-ink span.cm-variable-2, .cm-s-cobalt span.cm-tag { color: #FFC66D } 15 | .cm-s-vibrant-ink span.cm-variable-3, .cm-s-cobalt span.cm-def { color: #FFC66D } 16 | .cm-s-vibrant-ink .cm-operator { color: #888; } 17 | .cm-s-vibrant-ink .cm-comment { color: gray; font-weight: bold; } 18 | .cm-s-vibrant-ink .cm-string { color: #A5C25C } 19 | .cm-s-vibrant-ink .cm-string-2 { color: red } 20 | .cm-s-vibrant-ink .cm-meta { color: #D8FA3C; } 21 | .cm-s-vibrant-ink .cm-error { border-bottom: 1px solid red; } 22 | .cm-s-vibrant-ink .cm-builtin { color: #8DA6CE; } 23 | .cm-s-vibrant-ink .cm-tag { color: #8DA6CE; } 24 | .cm-s-vibrant-ink .cm-attribute { color: #8DA6CE; } 25 | .cm-s-vibrant-ink .cm-header { color: #FF6400; } 26 | .cm-s-vibrant-ink .cm-hr { color: #AEAEAE; } 27 | .cm-s-vibrant-ink .cm-link { color: blue; } 28 | -------------------------------------------------------------------------------- /apps/admin/controllers/shell.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import cStringIO 3 | import gluon.contrib.shell 4 | import code 5 | import thread 6 | from gluon.shell import env 7 | 8 | if DEMO_MODE or MULTI_USER_MODE: 9 | session.flash = T('disabled in demo mode') 10 | redirect(URL('default', 'site')) 11 | 12 | FE = 10 ** 9 13 | 14 | 15 | def index(): 16 | app = request.args(0) or 'admin' 17 | reset() 18 | return dict(app=app) 19 | 20 | 21 | def callback(): 22 | app = request.args[0] 23 | command = request.vars.statement 24 | escape = command[:1] != '!' 25 | history = session['history:' + app] = session.get( 26 | 'history:' + app, gluon.contrib.shell.History()) 27 | if not escape: 28 | command = command[1:] 29 | if command == '%reset': 30 | reset() 31 | return '*** reset ***' 32 | elif command[0] == '%': 33 | try: 34 | command = session['commands:' + app][int(command[1:])] 35 | except ValueError: 36 | return '' 37 | session['commands:' + app].append(command) 38 | environ = env(app, True) 39 | output = gluon.contrib.shell.run(history, command, environ) 40 | k = len(session['commands:' + app]) - 1 41 | #output = PRE(output) 42 | #return TABLE(TR('In[%i]:'%k,PRE(command)),TR('Out[%i]:'%k,output)) 43 | return 'In [%i] : %s%s\n' % (k + 1, command, output) 44 | 45 | 46 | def reset(): 47 | app = request.args(0) or 'admin' 48 | session['commands:' + app] = [] 49 | session['history:' + app] = gluon.contrib.shell.History() 50 | return 'done' 51 | -------------------------------------------------------------------------------- /apps/admin/static/codemirror/theme/web2py.css: -------------------------------------------------------------------------------- 1 | .cm-s-web2py span.cm-meta {color: #FF1717;} 2 | .cm-s-web2py span.cm-keyword { line-height: 1em; font-weight: bold; color: #7F0055; } 3 | .cm-s-web2py span.cm-atom {color: #219;} 4 | .cm-s-web2py span.cm-number {color: #164;} 5 | .cm-s-web2py span.cm-def {color: #00f;} 6 | .cm-s-web2py span.cm-variable {color: black;} 7 | .cm-s-web2py span.cm-variable-2 {color: #0000C0;} 8 | .cm-s-web2py span.cm-variable-3 {color: #0000C0;} 9 | .cm-s-web2py span.cm-property {color: black;} 10 | .cm-s-web2py span.cm-operator {color: black;} 11 | .cm-s-web2py span.cm-comment {color: #3F7F5F;} 12 | .cm-s-web2py span.cm-string {color: #2A00FF;} 13 | .cm-s-web2py span.cm-string-2 {color: #f50;} 14 | .cm-s-web2py span.cm-error {color: #f00;} 15 | .cm-s-web2py span.cm-qualifier {color: #555;} 16 | .cm-s-web2py span.cm-builtin {color: #30a;} 17 | .cm-s-web2py span.cm-bracket {color: #cc7;} 18 | .cm-s-web2py span.cm-tag {color: #170;} 19 | .cm-s-web2py span.cm-attribute {color: #00c;} 20 | .cm-s-web2py span.cm-link {color: #219;} 21 | 22 | .cm-s-web2py .CodeMirror-matchingbracket { 23 | border:1px solid grey; 24 | color:black !important;; 25 | } 26 | 27 | /* Editor styling */ 28 | 29 | .cm-s-web2py { 30 | line-height: 1.40em; 31 | font-family: Monaco, Menlo,"Andale Mono","lucida console","Courier New",monospace !important; 32 | } 33 | 34 | /* Fullscreen mode and active line highlight */ 35 | 36 | .cm-s-web2py .CodeMirror-fullscreen { 37 | display: block; 38 | position: absolute; 39 | top: 0; 40 | left: 0; 41 | width: 100%; 42 | z-index: 9999; 43 | } 44 | 45 | .cm-s-web2py .activeline {background: #e8f2ff !important;} -------------------------------------------------------------------------------- /apps/welcome_legacy/routes.example.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | # This is an app-specific example router 5 | # 6 | # This simple router is used for setting languages from app/languages directory 7 | # as a part of the application path: app//controller/function 8 | # Language from default.py or 'en' (if the file is not found) is used as 9 | # a default_language 10 | # 11 | # See /router.example.py for parameter's detail 12 | #------------------------------------------------------------------------------------- 13 | # To enable this route file you must do the steps: 14 | # 15 | # 1. rename /router.example.py to routes.py 16 | # 2. rename this APP/routes.example.py to APP/routes.py 17 | # (where APP - is your application directory) 18 | # 3. restart web2py (or reload routes in web2py admin interfase) 19 | # 20 | # YOU CAN COPY THIS FILE TO ANY APLLICATION'S ROOT DIRECTORY WITHOUT CHANGES! 21 | 22 | from fileutils import abspath 23 | from languages import read_possible_languages 24 | 25 | possible_languages = read_possible_languages(abspath('applications', app)) 26 | #NOTE! app - is an application based router's parameter with name of an 27 | # application. E.g.'welcome' 28 | 29 | routers = { 30 | app: dict( 31 | default_language = possible_languages['default'][0], 32 | languages = [lang for lang in possible_languages 33 | if lang != 'default'] 34 | ) 35 | } 36 | 37 | #NOTE! To change language in your application using these rules add this line 38 | #in one of your models files: 39 | # if request.uri_language: T.force(request.uri_language) 40 | -------------------------------------------------------------------------------- /apps/admin/views/openshift/deploy.html: -------------------------------------------------------------------------------- 1 | {{extend 'layout.html'}} 2 | 3 | 4 | 5 | 14 | 15 |

{{=T("OpenShift Deployment Interface")}}

16 | 17 |

{{=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.")}}

20 | 21 | {{if command:}} 22 |

{{=T("Command")}}

23 | 24 | {{=CODE(command)}} 25 |

{{=T("OpenShift Output")}}

26 |

27 | {{else:}}
28 | 

{{=T("Deployment form")}}

29 |
30 | {{=form}} 31 |
32 | {{pass}} 33 | -------------------------------------------------------------------------------- /apps/welcome/main.py: -------------------------------------------------------------------------------- 1 | from web3py import DAL, Field, expose, tag, cat, safe, HTTP, url, Form, DALForm, current 2 | from web3py.session import SessionCookieManager 3 | from web3py.dal import Transact 4 | from web3py.validators import IS_NOT_EMPTY 5 | 6 | db = DAL('sqlite://storage.test') 7 | db.define_table('person',Field('name',requires=IS_NOT_EMPTY())) 8 | 9 | expose.common_cleaners = [SessionCookieManager('test'),Transact(db)] 10 | 11 | @expose() 12 | def index(): 13 | form = Form(Field('name',requires=IS_NOT_EMPTY()), 14 | Field('area','text'), 15 | Field('check','boolean',default=True), 16 | Field('age','integer',comment='Try type in a number!'), 17 | Field('weight','double'), 18 | Field('a','time'), 19 | Field('b','date'), 20 | Field('c','datetime')).process() 21 | message = form.vars.name or '' 22 | return locals() 23 | 24 | @expose() 25 | def error(): 26 | return 1/0 27 | 28 | @expose() 29 | def counter(): 30 | current.session.counter = (current.session.counter or 0)+1 31 | return current.session.counter 32 | 33 | @expose(template='index.html') 34 | def dal_form(): 35 | form = DALForm(db.person, record_id=1).process() 36 | db.commit() 37 | message = form.vars.name 38 | return locals() 39 | 40 | @expose(cache_expire=10) 41 | def timer(): 42 | import time 43 | return time.ctime() 44 | 45 | @expose() 46 | def try_redirect1(): 47 | HTTP.redirect(url('welcome.main.index')) 48 | 49 | @expose() 50 | def try_redirect2(): 51 | HTTP.redirect(url('.main.index')) 52 | 53 | @expose() 54 | def try_redirect3(): 55 | HTTP.redirect(url('index')) 56 | -------------------------------------------------------------------------------- /apps/admin/models/menu.py: -------------------------------------------------------------------------------- 1 | # ########################################################### 2 | # ## generate menu 3 | # ########################################################### 4 | 5 | _a = request.application 6 | _c = request.controller 7 | _f = request.function 8 | response.title = '%s %s' % (_f, '/'.join(request.args)) 9 | response.subtitle = 'admin' 10 | response.menu = [(T('Site'), _f == 'site', URL(_a, 'default', 'site'))] 11 | 12 | if request.vars.app or request.args: 13 | _t = request.vars.app or request.args[0] 14 | response.menu.append((T('Edit'), _c == 'default' and _f == 'design', 15 | URL(_a, 'default', 'design', args=_t))) 16 | response.menu.append((T('About'), _c == 'default' and _f == 'about', 17 | URL(_a, 'default', 'about', args=_t,))) 18 | response.menu.append((T('Errors'), _c == 'default' and _f == 'errors', 19 | URL(_a, 'default', 'errors', args=_t))) 20 | response.menu.append((T('Versioning'), 21 | _c == 'mercurial' and _f == 'commit', 22 | URL(_a, 'mercurial', 'commit', args=_t))) 23 | 24 | if not session.authorized: 25 | response.menu = [(T('Login'), True, URL('site'))] 26 | else: 27 | response.menu.append((T('Logout'), False, 28 | URL(_a, 'default', f='logout'))) 29 | response.menu.append((T('Debug'), False, 30 | URL(_a, 'debug', 'interact'))) 31 | 32 | if os.path.exists('applications/examples'): 33 | response.menu.append( 34 | (T('Help'), False, URL('examples', 'default', 'index'))) 35 | else: 36 | response.menu.append((T('Help'), False, 'http://web2py.com/examples')) 37 | -------------------------------------------------------------------------------- /apps/admin/models/db.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # this file is released under public domain and you can use without limitations 3 | 4 | if MULTI_USER_MODE: 5 | db = DAL('sqlite://storage.sqlite') # if not, use SQLite or other DB 6 | from gluon.tools import * 7 | auth = Auth( 8 | globals(), db) # authentication/authorization 9 | crud = Crud( 10 | globals(), db) # for CRUD helpers using auth 11 | service = Service( 12 | globals()) # for json, xml, jsonrpc, xmlrpc, amfrpc 13 | plugins = PluginManager() 14 | 15 | mail = auth.settings.mailer 16 | mail.settings.server = EMAIL_SERVER 17 | mail.settings.sender = EMAIL_SENDER 18 | mail.settings.login = EMAIL_LOGIN 19 | 20 | auth.settings.extra_fields['auth_user'] = \ 21 | [Field('is_manager', 'boolean', default=False, writable=False)] 22 | auth.define_tables() # creates all needed tables 23 | auth.settings.registration_requires_verification = False 24 | auth.settings.registration_requires_approval = True 25 | auth.settings.reset_password_requires_verification = True 26 | 27 | db.define_table('app', Field('name'), Field('owner', db.auth_user)) 28 | 29 | if not session.authorized and MULTI_USER_MODE: 30 | if auth.user and not request.function == 'user': 31 | session.authorized = True 32 | elif not request.function == 'user': 33 | redirect(URL('default', 'user/login')) 34 | 35 | 36 | def is_manager(): 37 | if not MULTI_USER_MODE: 38 | return True 39 | elif auth.user and (auth.user.id == 1 or auth.user.is_manager): 40 | return True 41 | else: 42 | return False 43 | -------------------------------------------------------------------------------- /apps/welcome_legacy/views/default/index.html: -------------------------------------------------------------------------------- 1 | {{left_sidebar_enabled,right_sidebar_enabled=False,('message' in globals())}} 2 | {{extend 'layout.html'}} 3 | 4 | {{if 'message' in globals():}} 5 |

{{=message}}

6 | 7 |

{{=T('How did you get here?')}}

8 |
    9 |
  1. {{=T('You are successfully running web2py')}}
  2. 10 |
  3. {{=XML(T('You visited the url %s', A(request.env.path_info,_href=request.env.path_info)))}}
  4. 11 |
  5. {{=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'))))))}}
  6. 15 |
  7. {{=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')))))}}
  8. 18 |
  9. {{=T('You can modify this application and adapt it to your needs')}}
  10. 19 |
20 | {{elif 'content' in globals():}} 21 | {{=content}} 22 | {{else:}} 23 | {{=BEAUTIFY(response._vars)}} 24 | {{pass}} 25 | 26 | {{block right_sidebar}} 27 | {{=A(T("Administrative Interface"), _href=URL('admin','default','index'), _class='btn', 28 | _style='margin-top: 1em;')}} 29 |
{{=T("Don't know what to do?")}}
30 | 35 | {{end}} 36 | -------------------------------------------------------------------------------- /web3py/cfs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ 5 | This file is part of the web2py Web Framework 6 | Copyrighted by Massimo Di Pierro 7 | License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) 8 | 9 | Functions required to execute app components 10 | ============================================ 11 | 12 | FOR INTERNAL USE ONLY 13 | """ 14 | 15 | from os import stat 16 | import thread 17 | 18 | cfs = {} # for speed-up 19 | cfs_lock = thread.allocate_lock() # and thread safety 20 | 21 | def read_file(filename, mode='r'): 22 | "returns content from filename, making sure to close the file explicitly on exit." 23 | with open(filename, mode) as f: 24 | return f.read() 25 | 26 | def getcfs(key, filename, filter=None): 27 | """ 28 | Caches the *filtered* file `filename` with `key` until the file is 29 | modified. 30 | 31 | :param key: the cache key 32 | :param filename: the file to cache 33 | :param filter: is the function used for filtering. Normally `filename` is a 34 | .py file and `filter` is a function that bytecode compiles the file. 35 | In this way the bytecode compiled file is cached. (Default = None) 36 | 37 | This is used on Google App Engine since pyc files cannot be saved. 38 | """ 39 | try: 40 | t = stat(filename).st_mtime 41 | except OSError: 42 | return filter() if callable(filter) else '' 43 | cfs_lock.acquire() 44 | item = cfs.get(key, None) 45 | cfs_lock.release() 46 | if item and item[0] == t: 47 | return item[1] 48 | if not callable(filter): 49 | data = read_file(filename) 50 | else: 51 | data = filter() 52 | cfs_lock.acquire() 53 | cfs[key] = (t, data) 54 | cfs_lock.release() 55 | return data 56 | -------------------------------------------------------------------------------- /apps/admin/static/codemirror/mode/htmlmixed/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CodeMirror: HTML mixed mode 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |

CodeMirror: HTML mixed mode

17 |
41 | 44 | 45 |

The HTML mixed mode depends on the XML, JavaScript, and CSS modes.

46 | 47 |

MIME types defined: text/html 48 | (redefined, only takes effect if you load this parser after the 49 | XML parser).

50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /apps/admin/static/codemirror/mode/xml/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CodeMirror: XML mode 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

CodeMirror: XML mode

14 |
26 | 32 |

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.
41 |
42 | 43 |

MIME types defined: application/xml, text/html.

44 | 45 | 46 | -------------------------------------------------------------------------------- /apps/admin/views/default.mobile/site.html: -------------------------------------------------------------------------------- 1 | {{extend 'default.mobile/layout.html'}} 2 | {{import os, glob}} 3 | {{block sectionclass}}site{{end}} 4 | 5 |

{{=T("Installed applications")}}

6 | 7 |
    8 | {{for a in apps:}} 9 |
  • 10 | {{if a==request.application:}} 11 |

    {{=a}} ({{=T('currently running')}})

    12 | {{else:}} 13 |

    {{=T("Application")}} {{=a}}

    14 | {{if MULTI_USER_MODE and db.app(name=a):}}

    created by {{="%(first_name)s %(last_name)s" % db.auth_user[db.app(name=a).owner]}}

    {{pass}} 15 | {{pass}} 16 |
      17 | {{if a!=request.application:}} 18 | {{=LI(A(T('Goto'),_rel="external",_href=URL(a,'default','index')))}} 19 | {{if not os.path.exists('applications/%s/compiled' % a):}} 20 | {{=LI(A(T('Edit'),_href=URL('design',args=a)))}} 21 | {{else:}} 22 | {{=LI(A(T('appadmin'),_rel="external",_href=URL(a,'appadmin','index')))}} 23 | {{pass}} 24 | {{=LI(A(T('About'),_href=URL('about',args=a)))}} 25 | {{pass}} 26 | {{=LI(A(T('Errors'),_href=URL('errors',args=a)))}} 27 | {{=LI(A(T('Clean'),_href=URL('cleanup',args=a)))}} 28 | {{if not os.path.exists('applications/%s/compiled' % a):}} 29 | {{=LI(A(T('Compile'),_href=URL('compile_app',args=a)))}} 30 | {{else:}} 31 | {{=LI(A(T('Pack compiled'),_href=URL('pack',args=(a, 'compiled'))))}} 32 | {{if glob.glob('applications/%s/controllers/*.py' % a):}} 33 | {{=LI(A(T('Remove compiled'),_href=URL('remove_compiled_app',args=a)))}} 34 | {{pass}} 35 | {{pass}} 36 | {{if a!=request.application:}} 37 | {{=LI(A(T('Uninstall'),_href=URL('uninstall',args=a)))}} 38 | {{=LI(button_enable(URL('enable',args=a), a))}} 39 | {{pass}} 40 |
    41 |
  • 42 | {{pass}} 43 |
44 | 45 | -------------------------------------------------------------------------------- /apps/admin/static/codemirror/lib/util/match-highlighter.js: -------------------------------------------------------------------------------- 1 | // Define match-highlighter commands. Depends on searchcursor.js 2 | // Use by attaching the following function call to the onCursorActivity event: 3 | //myCodeMirror.matchHighlight(minChars); 4 | // And including a special span.CodeMirror-matchhighlight css class (also optionally a separate one for .CodeMirror-focused -- see demo matchhighlighter.html) 5 | 6 | (function() { 7 | var DEFAULT_MIN_CHARS = 2; 8 | 9 | function MatchHighlightState() { 10 | this.marked = []; 11 | } 12 | function getMatchHighlightState(cm) { 13 | return cm._matchHighlightState || (cm._matchHighlightState = new MatchHighlightState()); 14 | } 15 | 16 | function clearMarks(cm) { 17 | var state = getMatchHighlightState(cm); 18 | for (var i = 0; i < state.marked.length; ++i) 19 | state.marked[i].clear(); 20 | state.marked = []; 21 | } 22 | 23 | function markDocument(cm, className, minChars) { 24 | clearMarks(cm); 25 | minChars = (typeof minChars !== 'undefined' ? minChars : DEFAULT_MIN_CHARS); 26 | if (cm.somethingSelected() && cm.getSelection().replace(/^\s+|\s+$/g, "").length >= minChars) { 27 | var state = getMatchHighlightState(cm); 28 | var query = cm.getSelection(); 29 | cm.operation(function() { 30 | if (cm.lineCount() < 2000) { // This is too expensive on big documents. 31 | for (var cursor = cm.getSearchCursor(query); cursor.findNext();) { 32 | //Only apply matchhighlight to the matches other than the one actually selected 33 | if (!(cursor.from().line === cm.getCursor(true).line && cursor.from().ch === cm.getCursor(true).ch)) 34 | state.marked.push(cm.markText(cursor.from(), cursor.to(), className)); 35 | } 36 | } 37 | }); 38 | } 39 | } 40 | 41 | CodeMirror.defineExtension("matchHighlight", function(className, minChars) { 42 | markDocument(this, className, minChars); 43 | }); 44 | })(); 45 | -------------------------------------------------------------------------------- /apps/admin/static/codemirror/lib/util/runmode.js: -------------------------------------------------------------------------------- 1 | CodeMirror.runMode = function(string, modespec, callback, options) { 2 | function esc(str) { 3 | return str.replace(/[<&]/, function(ch) { return ch == "<" ? "<" : "&"; }); 4 | } 5 | 6 | var mode = CodeMirror.getMode(CodeMirror.defaults, modespec); 7 | var isNode = callback.nodeType == 1; 8 | var tabSize = (options && options.tabSize) || CodeMirror.defaults.tabSize; 9 | if (isNode) { 10 | var node = callback, accum = [], col = 0; 11 | callback = function(text, style) { 12 | if (text == "\n") { 13 | accum.push("
"); 14 | col = 0; 15 | return; 16 | } 17 | var escaped = ""; 18 | // HTML-escape and replace tabs 19 | for (var pos = 0;;) { 20 | var idx = text.indexOf("\t", pos); 21 | if (idx == -1) { 22 | escaped += esc(text.slice(pos)); 23 | col += text.length - pos; 24 | break; 25 | } else { 26 | col += idx - pos; 27 | escaped += esc(text.slice(pos, idx)); 28 | var size = tabSize - col % tabSize; 29 | col += size; 30 | for (var i = 0; i < size; ++i) escaped += " "; 31 | pos = idx + 1; 32 | } 33 | } 34 | 35 | if (style) 36 | accum.push("" + escaped + ""); 37 | else 38 | accum.push(escaped); 39 | }; 40 | } 41 | var lines = CodeMirror.splitLines(string), state = CodeMirror.startState(mode); 42 | for (var i = 0, e = lines.length; i < e; ++i) { 43 | if (i) callback("\n"); 44 | var stream = new CodeMirror.StringStream(lines[i]); 45 | while (!stream.eol()) { 46 | var style = mode.token(stream, state); 47 | callback(stream.current(), style, i, stream.start); 48 | stream.start = stream.pos; 49 | } 50 | } 51 | if (isNode) 52 | node.innerHTML = accum.join(""); 53 | }; 54 | -------------------------------------------------------------------------------- /apps/admin/static/codemirror/lib/util/loadmode.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | if (!CodeMirror.modeURL) CodeMirror.modeURL = "../mode/%N/%N.js"; 3 | 4 | var loading = {}; 5 | function splitCallback(cont, n) { 6 | var countDown = n; 7 | return function() { if (--countDown == 0) cont(); }; 8 | } 9 | function ensureDeps(mode, cont) { 10 | var deps = CodeMirror.modes[mode].dependencies; 11 | if (!deps) return cont(); 12 | var missing = []; 13 | for (var i = 0; i < deps.length; ++i) { 14 | if (!CodeMirror.modes.hasOwnProperty(deps[i])) 15 | missing.push(deps[i]); 16 | } 17 | if (!missing.length) return cont(); 18 | var split = splitCallback(cont, missing.length); 19 | for (var i = 0; i < missing.length; ++i) 20 | CodeMirror.requireMode(missing[i], split); 21 | } 22 | 23 | CodeMirror.requireMode = function(mode, cont) { 24 | if (typeof mode != "string") mode = mode.name; 25 | if (CodeMirror.modes.hasOwnProperty(mode)) return ensureDeps(mode, cont); 26 | if (loading.hasOwnProperty(mode)) return loading[mode].push(cont); 27 | 28 | var script = document.createElement("script"); 29 | script.src = CodeMirror.modeURL.replace(/%N/g, mode); 30 | var others = document.getElementsByTagName("script")[0]; 31 | others.parentNode.insertBefore(script, others); 32 | var list = loading[mode] = [cont]; 33 | var count = 0, poll = setInterval(function() { 34 | if (++count > 100) return clearInterval(poll); 35 | if (CodeMirror.modes.hasOwnProperty(mode)) { 36 | clearInterval(poll); 37 | loading[mode] = null; 38 | ensureDeps(mode, function() { 39 | for (var i = 0; i < list.length; ++i) list[i](); 40 | }); 41 | } 42 | }, 200); 43 | }; 44 | 45 | CodeMirror.autoLoadMode = function(instance, mode) { 46 | if (!CodeMirror.modes.hasOwnProperty(mode)) 47 | CodeMirror.requireMode(mode, function() { 48 | instance.setOption("mode", instance.getOption("mode")); 49 | }); 50 | }; 51 | }()); 52 | -------------------------------------------------------------------------------- /apps/admin/static/codemirror/lib/util/overlay.js: -------------------------------------------------------------------------------- 1 | // Utility function that allows modes to be combined. The mode given 2 | // as the base argument takes care of most of the normal mode 3 | // functionality, but a second (typically simple) mode is used, which 4 | // can override the style of text. Both modes get to parse all of the 5 | // text, but when both assign a non-null style to a piece of code, the 6 | // overlay wins, unless the combine argument was true, in which case 7 | // the styles are combined. 8 | 9 | // overlayParser is the old, deprecated name 10 | CodeMirror.overlayMode = CodeMirror.overlayParser = function(base, overlay, combine) { 11 | return { 12 | startState: function() { 13 | return { 14 | base: CodeMirror.startState(base), 15 | overlay: CodeMirror.startState(overlay), 16 | basePos: 0, baseCur: null, 17 | overlayPos: 0, overlayCur: null 18 | }; 19 | }, 20 | copyState: function(state) { 21 | return { 22 | base: CodeMirror.copyState(base, state.base), 23 | overlay: CodeMirror.copyState(overlay, state.overlay), 24 | basePos: state.basePos, baseCur: null, 25 | overlayPos: state.overlayPos, overlayCur: null 26 | }; 27 | }, 28 | 29 | token: function(stream, state) { 30 | if (stream.start == state.basePos) { 31 | state.baseCur = base.token(stream, state.base); 32 | state.basePos = stream.pos; 33 | } 34 | if (stream.start == state.overlayPos) { 35 | stream.pos = stream.start; 36 | state.overlayCur = overlay.token(stream, state.overlay); 37 | state.overlayPos = stream.pos; 38 | } 39 | stream.pos = Math.min(state.basePos, state.overlayPos); 40 | if (stream.eol()) state.basePos = state.overlayPos = 0; 41 | 42 | if (state.overlayCur == null) return state.baseCur; 43 | if (state.baseCur != null && combine) return state.baseCur + " " + state.overlayCur; 44 | else return state.overlayCur; 45 | }, 46 | 47 | indent: base.indent && function(state, textAfter) { 48 | return base.indent(state.base, textAfter); 49 | }, 50 | electricChars: base.electricChars 51 | }; 52 | }; 53 | -------------------------------------------------------------------------------- /apps/admin/static/codemirror/theme/lesser-dark.css: -------------------------------------------------------------------------------- 1 | /* 2 | http://lesscss.org/ dark theme 3 | Ported to CodeMirror by Peter Kroon 4 | */ 5 | .cm-s-lesser-dark { 6 | line-height: 1.3em; 7 | } 8 | .cm-s-lesser-dark { 9 | font-family: 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', 'Monaco', Courier, monospace !important; 10 | } 11 | 12 | .cm-s-lesser-dark { background: #262626; color: #EBEFE7; text-shadow: 0 -1px 1px #262626; } 13 | .cm-s-lesser-dark div.CodeMirror-selected {background: #45443B !important;} /* 33322B*/ 14 | .cm-s-lesser-dark .CodeMirror-cursor { border-left: 1px solid white !important; } 15 | .cm-s-lesser-dark .CodeMirror-lines { margin-left:3px; margin-right:3px; }/*editable code holder*/ 16 | 17 | div.CodeMirror span.CodeMirror-matchingbracket { color: #7EFC7E; }/*65FC65*/ 18 | 19 | .cm-s-lesser-dark .CodeMirror-gutter { background: #262626; border-right:1px solid #aaa; padding-right:3px; min-width:2.5em; } 20 | .cm-s-lesser-dark .CodeMirror-gutter-text { color: #777; } 21 | 22 | .cm-s-lesser-dark span.cm-keyword { color: #599eff; } 23 | .cm-s-lesser-dark span.cm-atom { color: #C2B470; } 24 | .cm-s-lesser-dark span.cm-number { color: #B35E4D; } 25 | .cm-s-lesser-dark span.cm-def {color: white;} 26 | .cm-s-lesser-dark span.cm-variable { color:#D9BF8C; } 27 | .cm-s-lesser-dark span.cm-variable-2 { color: #669199; } 28 | .cm-s-lesser-dark span.cm-variable-3 { color: white; } 29 | .cm-s-lesser-dark span.cm-property {color: #92A75C;} 30 | .cm-s-lesser-dark span.cm-operator {color: #92A75C;} 31 | .cm-s-lesser-dark span.cm-comment { color: #666; } 32 | .cm-s-lesser-dark span.cm-string { color: #BCD279; } 33 | .cm-s-lesser-dark span.cm-string-2 {color: #f50;} 34 | .cm-s-lesser-dark span.cm-meta { color: #738C73; } 35 | .cm-s-lesser-dark span.cm-error { color: #9d1e15; } 36 | .cm-s-lesser-dark span.cm-qualifier {color: #555;} 37 | .cm-s-lesser-dark span.cm-builtin { color: #ff9e59; } 38 | .cm-s-lesser-dark span.cm-bracket { color: #EBEFE7; } 39 | .cm-s-lesser-dark span.cm-tag { color: #669199; } 40 | .cm-s-lesser-dark span.cm-attribute {color: #00c;} 41 | .cm-s-lesser-dark span.cm-header {color: #a0a;} 42 | .cm-s-lesser-dark span.cm-quote {color: #090;} 43 | .cm-s-lesser-dark span.cm-hr {color: #999;} 44 | .cm-s-lesser-dark span.cm-link {color: #00c;} 45 | -------------------------------------------------------------------------------- /apps/admin/static/js/autoscroll.js: -------------------------------------------------------------------------------- 1 | /* 2 | * autoscroll.js widget with jquery event(s) 3 | * Copyright 2011 Michael Whitford 4 | * License: BSD 5 | */ 6 | 7 | // toggle - id of the toggle element for the click event 8 | // textarea - id of the textarea to autoscroll 9 | var toggleAutoScroll = function (toggle, textarea) { 10 | var autoScrollDebug = false; 11 | var state = toggle + 'interval'; 12 | var scrollOn = function() { 13 | if (autoScrollDebug) { console.log('on:', toggle, textarea); } 14 | var onAnimation = function(name, target) { 15 | jQuery('#' + name).unbind().click(function() { 16 | toggleAutoScroll(name, target); 17 | }).fadeTo(350, 1); 18 | }; 19 | // uses obj attached to window for state 20 | window[state] = {}; 21 | window[state].name = toggle; 22 | window[state].target = textarea; 23 | // get a handle to the textarea el 24 | var area = jQuery('#' + textarea); 25 | // set the interval 26 | window[state].interval = setInterval(function() { 27 | // ui hack? needs more testing 28 | area[0].scrollTop = area[0].scrollHeight; 29 | }, 2500); // 2.5 seconds 30 | onAnimation(toggle, textarea); 31 | }; 32 | var scrollOff = function() { 33 | if (autoScrollDebug) { console.log('off:', toggle, textarea); } 34 | var offAnimation = function(name, target) { 35 | jQuery('#' + name).unbind().click(function() { 36 | toggleAutoScroll(name, target); 37 | }).fadeTo(350, 0.55); 38 | }; 39 | offAnimation(toggle, textarea); 40 | clearInterval(window[state].interval); 41 | window[state] = undefined; 42 | }; 43 | if (arguments.length == 2) { 44 | if (typeof window[state] === 'undefined') { 45 | scrollOn(); 46 | } else { 47 | scrollOff(); 48 | } 49 | } 50 | return; 51 | }; 52 | 53 | // jquery onready 54 | 55 | jQuery(document).ready(function () { 56 | // turn it on by default 57 | toggleAutoScroll('autoscroll', 'output'); 58 | }); 59 | 60 | // todo: some key - toggle off 61 | // todo: drag scrollbar up - toggle off 62 | // todo: drag scrollbar to bottom - toggle off 63 | 64 | -------------------------------------------------------------------------------- /web3py/cleaners.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import inspect 3 | import traceback 4 | 5 | __all__ = ['Cleaner', 'WrapWithCleaners'] 6 | 7 | class Cleaner(object): 8 | def on_start(self): pass 9 | def on_success(self): pass 10 | def on_failure(self): pass 11 | def wrap_call(self,func): return func 12 | 13 | class WrapWithCleaners(object): 14 | def __init__(self, cleaners=[]): 15 | self.cleaners = cleaners 16 | def __call__(self, f): 17 | def wrap(f, cleaner): 18 | def g(*a,**b): 19 | try: 20 | cleaner.on_start() 21 | output = cleaner.wrap_call(f)(*a,**b) 22 | cleaner.on_success() 23 | return output 24 | except: 25 | cleaner.on_failure() 26 | raise 27 | return g 28 | for cleaner in self.cleaners: 29 | if isinstance(cleaner,Cleaner): 30 | f = wrap(f, cleaner) 31 | return f 32 | 33 | def smart_traceback(): 34 | tb = traceback.format_exc() 35 | frames = [] 36 | for item in inspect.trace(): 37 | frame = item[0] 38 | try: 39 | with open(frame.f_code.co_filename,'rb') as file: 40 | content = file.read() 41 | except IOError: 42 | content = '' 43 | frames.append(dict(filename = frame.f_code.co_filename, 44 | content = content, 45 | line_number = frame.f_lineno, 46 | locals_variables = frame.f_locals, 47 | global_variables = frame.f_globals)) 48 | return (tb, frames) 49 | 50 | def example(): 51 | 52 | class CleanerExample(Cleaner): 53 | def __init__(self): sys.stdout.write('connecting\n') 54 | def on_start(self): sys.stdout.write('pool connection\n') 55 | def on_success(self): sys.stdout.write('commit\n') 56 | def on_failure(self): sys.stdout.write('rollback\n') 57 | def insert(self,**data): sys.stdout.write('inserting %s\n' % data) 58 | 59 | db = CleanerExample() 60 | 61 | @WrapWithCleaners((db,)) 62 | def action(x): 63 | db.insert(key=1/x) 64 | return 65 | 66 | try: 67 | a = action(1) 68 | a = action(0) 69 | except: 70 | pass # print smart_traceback()[1][-1] 71 | -------------------------------------------------------------------------------- /apps/admin/views/layout.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{=response.title or URL()}} 7 | {{response.files.append(URL('static','css/styles.css'))}} 8 | {{include 'web2py_ajax.html'}} 9 | 10 | 11 | 12 | 24 |
25 |
26 |
{{=response.flash or ''}}
27 | {{include}} 28 |
29 |
30 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /apps/admin/views/plugin_jqmobile/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | jQuery Mobile Plugin for web2py 4 | 42 | 43 | 44 | 45 | 46 |
47 |

web2py plugin

48 |

for jQuery Mobile

49 |

Try click on a button on the left, it is a demo!

50 |

License

51 | MIT (same as jQuery Mobile) 52 |

Instructions

53 |
    54 |
  • Download 55 | and install the plugin in a web2py app.
  • 56 |
  • Replace extend "layout.html" with extend "plugin_jqmobile/layout.html" in all your views.
  • 57 |
  • Only link pages that extend this layout.
  • 58 |
  • Link external pages with <a rel="external" ...>.
  • 59 |
  • Optional: make a different response.menu for each action.
  • 60 |
61 |

Created by

62 |
    63 |
  • Jason Blum
  • 64 |
  • Timothy Stockman
  • 65 |
  • Harkirat Singh
  • 66 |
  • Massimo Di Pierro
  • 67 |
68 |
69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /apps/admin/controllers/openshift.py: -------------------------------------------------------------------------------- 1 | import os 2 | try: 3 | from distutils import dir_util 4 | except ImportError: 5 | session.flash = T('requires distutils, but not installed') 6 | redirect(URL('default', 'site')) 7 | try: 8 | from git import * 9 | except ImportError: 10 | session.flash = T('requires python-git, but not installed') 11 | redirect(URL('default', 'site')) 12 | 13 | 14 | def deploy(): 15 | apps = sorted(file for file in os.listdir(apath(r=request))) 16 | form = SQLFORM.factory( 17 | Field( 18 | 'osrepo', default='/tmp', label=T('Path to local openshift repo root.'), 19 | requires=EXISTS(error_message=T('directory not found'))), 20 | Field('osname', default='web2py', label=T('WSGI reference name')), 21 | Field('applications', 'list:string', 22 | requires=IS_IN_SET(apps, multiple=True), 23 | label=T('web2py apps to deploy'))) 24 | 25 | cmd = output = errors = "" 26 | if form.accepts(request, session): 27 | try: 28 | kill() 29 | except: 30 | pass 31 | 32 | ignore_apps = [ 33 | item for item in apps if not item in form.vars.applications] 34 | regex = re.compile('\(applications/\(.*') 35 | w2p_origin = os.getcwd() 36 | osrepo = form.vars.osrepo 37 | osname = form.vars.osname 38 | #Git code starts here 39 | repo = Repo(form.vars.osrepo) 40 | index = repo.index 41 | assert repo.bare == False 42 | 43 | for i in form.vars.applications: 44 | appsrc = os.path.join(apath(r=request), i) 45 | appdest = os.path.join(osrepo, 'wsgi', osname, 'applications', i) 46 | dir_util.copy_tree(appsrc, appdest) 47 | #shutil.copytree(appsrc,appdest) 48 | index.add(['wsgi/' + osname + '/applications/' + i]) 49 | new_commit = index.commit("Deploy from Web2py IDE") 50 | 51 | origin = repo.remotes.origin 52 | origin.push 53 | origin.push() 54 | #Git code ends here 55 | return dict(form=form, command=cmd) 56 | 57 | 58 | class EXISTS(object): 59 | def __init__(self, error_message='file not found'): 60 | self.error_message = error_message 61 | 62 | def __call__(self, value): 63 | if os.path.exists(value): 64 | return (value, None) 65 | return (value, self.error_message) 66 | -------------------------------------------------------------------------------- /apps/admin/static/codemirror/theme/xq-dark.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 by MarkLogic Corporation 3 | Author: Mike Brevoort 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. 22 | */ 23 | .cm-s-xq-dark { background: #0a001f; color: #f8f8f8; } 24 | .cm-s-xq-dark span.CodeMirror-selected { background: #a8f !important; } 25 | .cm-s-xq-dark .CodeMirror-gutter { background: #0a001f; border-right: 1px solid #aaa; } 26 | .cm-s-xq-dark .CodeMirror-gutter-text { color: #f8f8f8; } 27 | .cm-s-xq-dark .CodeMirror-cursor { border-left: 1px solid white !important; } 28 | 29 | .cm-s-xq-dark span.cm-keyword {color: #FFBD40;} 30 | .cm-s-xq-dark span.cm-atom {color: #6C8CD5;} 31 | .cm-s-xq-dark span.cm-number {color: #164;} 32 | .cm-s-xq-dark span.cm-def {color: #FFF; text-decoration:underline;} 33 | .cm-s-xq-dark span.cm-variable {color: #FFF;} 34 | .cm-s-xq-dark span.cm-variable-2 {color: #EEE;} 35 | .cm-s-xq-dark span.cm-variable-3 {color: #DDD;} 36 | .cm-s-xq-dark span.cm-property {} 37 | .cm-s-xq-dark span.cm-operator {} 38 | .cm-s-xq-dark span.cm-comment {color: gray;} 39 | .cm-s-xq-dark span.cm-string {color: #9FEE00;} 40 | .cm-s-xq-dark span.cm-meta {color: yellow;} 41 | .cm-s-xq-dark span.cm-error {color: #f00;} 42 | .cm-s-xq-dark span.cm-qualifier {color: #FFF700;} 43 | .cm-s-xq-dark span.cm-builtin {color: #30a;} 44 | .cm-s-xq-dark span.cm-bracket {color: #cc7;} 45 | .cm-s-xq-dark span.cm-tag {color: #FFBD40;} 46 | .cm-s-xq-dark span.cm-attribute {color: #FFF700;} 47 | -------------------------------------------------------------------------------- /apps/admin/static/codemirror/lib/util/dialog.js: -------------------------------------------------------------------------------- 1 | // Open simple dialogs on top of an editor. Relies on dialog.css. 2 | 3 | (function() { 4 | function dialogDiv(cm, template) { 5 | var wrap = cm.getWrapperElement(); 6 | var dialog = wrap.insertBefore(document.createElement("div"), wrap.firstChild); 7 | dialog.className = "CodeMirror-dialog"; 8 | dialog.innerHTML = '
' + template + '
'; 9 | return dialog; 10 | } 11 | 12 | CodeMirror.defineExtension("openDialog", function(template, callback) { 13 | var dialog = dialogDiv(this, template); 14 | var closed = false, me = this; 15 | function close() { 16 | if (closed) return; 17 | closed = true; 18 | dialog.parentNode.removeChild(dialog); 19 | } 20 | var inp = dialog.getElementsByTagName("input")[0], button; 21 | if (inp) { 22 | CodeMirror.connect(inp, "keydown", function(e) { 23 | if (e.keyCode == 13 || e.keyCode == 27) { 24 | CodeMirror.e_stop(e); 25 | close(); 26 | me.focus(); 27 | if (e.keyCode == 13) callback(inp.value); 28 | } 29 | }); 30 | inp.focus(); 31 | CodeMirror.connect(inp, "blur", close); 32 | } else if (button = dialog.getElementsByTagName("button")[0]) { 33 | CodeMirror.connect(button, "click", function() { 34 | close(); 35 | me.focus(); 36 | }); 37 | button.focus(); 38 | CodeMirror.connect(button, "blur", close); 39 | } 40 | return close; 41 | }); 42 | 43 | CodeMirror.defineExtension("openConfirm", function(template, callbacks) { 44 | var dialog = dialogDiv(this, template); 45 | var buttons = dialog.getElementsByTagName("button"); 46 | var closed = false, me = this, blurring = 1; 47 | function close() { 48 | if (closed) return; 49 | closed = true; 50 | dialog.parentNode.removeChild(dialog); 51 | me.focus(); 52 | } 53 | buttons[0].focus(); 54 | for (var i = 0; i < buttons.length; ++i) { 55 | var b = buttons[i]; 56 | (function(callback) { 57 | CodeMirror.connect(b, "click", function(e) { 58 | CodeMirror.e_preventDefault(e); 59 | close(); 60 | if (callback) callback(me); 61 | }); 62 | })(callbacks[i]); 63 | CodeMirror.connect(b, "blur", function() { 64 | --blurring; 65 | setTimeout(function() { if (blurring <= 0) close(); }, 200); 66 | }); 67 | CodeMirror.connect(b, "focus", function() { ++blurring; }); 68 | } 69 | }); 70 | })(); -------------------------------------------------------------------------------- /apps/admin/views/default/amy_ajax.html: -------------------------------------------------------------------------------- 1 | 59 | 60 | 61 | {{if request.args[1]=="views":}} 62 | 63 | {{else:}} 64 | 65 | {{pass}} 66 | 67 | 68 | 77 | 78 | -------------------------------------------------------------------------------- /apps/admin/views/default.mobile/amy_ajax.html: -------------------------------------------------------------------------------- 1 | 59 | 60 | 61 | {{if request.args[1]=="views":}} 62 | 63 | {{else:}} 64 | 65 | {{pass}} 66 | 67 | 68 | 77 | 78 | -------------------------------------------------------------------------------- /apps/admin/static/plugin_multiselect/multi-select.css: -------------------------------------------------------------------------------- 1 | .ms-container{ 2 | background: transparent url('switch.png') no-repeat 164px 80px; 3 | } 4 | 5 | .ms-container:after{ 6 | content: "."; display: block; height: 0; line-height: 0; font-size: 0; clear: both; min-height: 0; visibility: hidden; 7 | } 8 | 9 | .ms-container .ms-selectable, .ms-container .ms-selection{ 10 | 11 | background: #fff; 12 | color: #555555; 13 | float: left; 14 | } 15 | 16 | .ms-container .ms-list{ 17 | -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); 18 | -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); 19 | box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); 20 | -webkit-transition: border linear 0.2s, box-shadow linear 0.2s; 21 | -moz-transition: border linear 0.2s, box-shadow linear 0.2s; 22 | -ms-transition: border linear 0.2s, box-shadow linear 0.2s; 23 | -o-transition: border linear 0.2s, box-shadow linear 0.2s; 24 | transition: border linear 0.2s, box-shadow linear 0.2s; 25 | border: 1px solid #cccccc; 26 | -webkit-border-radius: 3px; 27 | -moz-border-radius: 3px; 28 | border-radius: 3px; 29 | } 30 | 31 | 32 | .ms-selected{ 33 | display:none; 34 | } 35 | .ms-container .ms-selectable{ 36 | margin-right: 40px; 37 | } 38 | 39 | .ms-container .ms-list.ms-focus{ 40 | border-color: rgba(82, 168, 236, 0.8); 41 | -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); 42 | -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); 43 | box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); 44 | outline: 0; 45 | outline: thin dotted \9; 46 | } 47 | 48 | .ms-container ul { 49 | margin: 0; 50 | list-style-type: none; 51 | } 52 | 53 | .ms-container ul li { 54 | margin: 0; 55 | } 56 | 57 | .ms-container ul.ms-list{ 58 | width: 160px; 59 | height: 200px; 60 | padding: 0px 0px; 61 | overflow-y: auto; 62 | } 63 | 64 | .ms-container .ms-selectable li.ms-elem-selectable, 65 | .ms-container .ms-selection li.ms-elem-selected{ 66 | border-bottom: 1px #eee solid; 67 | padding: 2px 10px; 68 | color: #555; 69 | font-size: 14px; 70 | } 71 | 72 | .ms-container .ms-selectable li.disabled, 73 | .ms-container .ms-selection li.disabled{ 74 | background-color: #eee; 75 | color: #aaa; 76 | } 77 | 78 | .ms-container .ms-optgroup-label{ 79 | padding: 5px 0px 0px 5px; 80 | cursor: pointer; 81 | color: #999; 82 | } 83 | 84 | .ms-container li.ms-elem-selectable:not(.disabled).ms-hover, 85 | .ms-container .ms-selection li:not(.disabled).ms-hover{ 86 | cursor: pointer; 87 | color: #ffffff; 88 | text-decoration: none; 89 | background-color: #0088cc; 90 | } 91 | 92 | -------------------------------------------------------------------------------- /apps/welcome/static/js/share.js: -------------------------------------------------------------------------------- 1 | /** 2 | 3 | Created and copyrighted by Massimo Di Pierro 4 | (MIT license) 5 | 6 | Example: 7 | 8 | 9 | 10 | **/ 11 | 12 | jQuery(function(){ 13 | var script_source = jQuery('script[src*="share.js"]').attr('src'); 14 | var params = function(name,default_value) { 15 | var match = RegExp('[?&]' + name + '=([^&]*)').exec(script_source); 16 | return match && decodeURIComponent(match[1].replace(/\+/g, ' '))||default_value; 17 | } 18 | var path = params('static','social'); 19 | var url = window.location.href; 20 | var host = window.location.hostname; 21 | var title = escape(jQuery('title').text()); 22 | var twit = 'http://twitter.com/home?status='+title+'%20'+url; 23 | var facebook = 'http://www.facebook.com/sharer.php?u='+url; 24 | var gplus = 'https://plus.google.com/share?url='+url; 25 | var tbar = '
Share
Share on TwitterShare on facebookShare on Google Plus
'; 26 | // Add the share tool bar. 27 | jQuery('body').append(tbar); 28 | var st = jQuery('#socialdrawer'); 29 | st.css({'opacity':'.7','z-index':'3000','background':'#FFF','border':'solid 1px #666','border-width':' 1px 0 0 1px','height':'20px','width':'40px','position':'fixed','bottom':'0','right':'0','padding':'2px 5px','overflow':'hidden','-webkit-border-top-left-radius':' 12px','-moz-border-radius-topleft':' 12px','border-top-left-radius':' 12px','-moz-box-shadow':' -3px -3px 3px rgba(0,0,0,0.5)','-webkit-box-shadow':' -3px -3px 3px rgba(0,0,0,0.5)','box-shadow':' -3px -3px 3px rgba(0,0,0,0.5)'}); 30 | jQuery('#socialdrawer a').css({'float':'left','width':'32px','margin':'3px 2px 2px 2px','padding':'0'}); 31 | jQuery('#socialdrawer span').css({'float':'left','margin':'2px 3px','text-shadow':' 1px 1px 1px #FFF','color':'#444','font-size':'12px','line-height':'1em'}); 32 | jQuery('#socialdrawer img').hide(); 33 | // hover 34 | st.click(function(){ 35 | jQuery(this).animate({height:'40px', width:'160px', opacity: 0.95}, 300); 36 | jQuery('#socialdrawer img').show(); 37 | }); 38 | //leave 39 | st.mouseleave(function(){ 40 | st.animate({height:'20px', width: '40px', opacity: .7}, 300); 41 | jQuery('#socialdrawer img').hide(); 42 | return false; 43 | } ); 44 | }); 45 | -------------------------------------------------------------------------------- /apps/welcome_legacy/static/js/share.js: -------------------------------------------------------------------------------- 1 | /** 2 | 3 | Created and copyrighted by Massimo Di Pierro 4 | (MIT license) 5 | 6 | Example: 7 | 8 | 9 | 10 | **/ 11 | 12 | jQuery(function(){ 13 | var script_source = jQuery('script[src*="share.js"]').attr('src'); 14 | var params = function(name,default_value) { 15 | var match = RegExp('[?&]' + name + '=([^&]*)').exec(script_source); 16 | return match && decodeURIComponent(match[1].replace(/\+/g, ' '))||default_value; 17 | } 18 | var path = params('static','social'); 19 | var url = window.location.href; 20 | var host = window.location.hostname; 21 | var title = escape(jQuery('title').text()); 22 | var twit = 'http://twitter.com/home?status='+title+'%20'+url; 23 | var facebook = 'http://www.facebook.com/sharer.php?u='+url; 24 | var gplus = 'https://plus.google.com/share?url='+url; 25 | var tbar = '
Share
Share on TwitterShare on facebookShare on Google Plus
'; 26 | // Add the share tool bar. 27 | jQuery('body').append(tbar); 28 | var st = jQuery('#socialdrawer'); 29 | st.css({'opacity':'.7','z-index':'3000','background':'#FFF','border':'solid 1px #666','border-width':' 1px 0 0 1px','height':'20px','width':'40px','position':'fixed','bottom':'0','right':'0','padding':'2px 5px','overflow':'hidden','-webkit-border-top-left-radius':' 12px','-moz-border-radius-topleft':' 12px','border-top-left-radius':' 12px','-moz-box-shadow':' -3px -3px 3px rgba(0,0,0,0.5)','-webkit-box-shadow':' -3px -3px 3px rgba(0,0,0,0.5)','box-shadow':' -3px -3px 3px rgba(0,0,0,0.5)'}); 30 | jQuery('#socialdrawer a').css({'float':'left','width':'32px','margin':'3px 2px 2px 2px','padding':'0'}); 31 | jQuery('#socialdrawer span').css({'float':'left','margin':'2px 3px','text-shadow':' 1px 1px 1px #FFF','color':'#444','font-size':'12px','line-height':'1em'}); 32 | jQuery('#socialdrawer img').hide(); 33 | // hover 34 | st.click(function(){ 35 | jQuery(this).animate({height:'40px', width:'160px', opacity: 0.95}, 300); 36 | jQuery('#socialdrawer img').show(); 37 | }); 38 | //leave 39 | st.mouseleave(function(){ 40 | st.animate({height:'20px', width: '40px', opacity: .7}, 300); 41 | jQuery('#socialdrawer img').hide(); 42 | return false; 43 | } ); 44 | }); 45 | -------------------------------------------------------------------------------- /apps/admin/views/default.mobile/edit.html: -------------------------------------------------------------------------------- 1 | {{extend 'default.mobile/layout.html'}} 2 | 3 | {{ 4 | def shortcut(combo, description): 5 | return XML('
  • %s %s
  • ' % (combo, description)) 6 | }} 7 | 8 | {{if TEXT_EDITOR == 'amy':}} 9 | {{include 'default/amy_ajax.html'}} 10 | {{else:}} 11 | 14 | 15 | 20 | {{pass}} 21 | 22 | {{block sectionclass}}edit {{filename}}{{end}} 23 | 24 | {{if functions:}} 25 |

    26 | 27 | {{=B(T('exposes:'))}}{{=XML(', '.join([A(f,_href=URL(a=app,c=controller,f=f)).xml() for f in functions]))}} 28 | 29 | {{if editviewlinks:}}
    30 | {{=B(T('edit views:'))}} 31 | {{=XML(', '.join([v.xml() for v in editviewlinks]))}} 32 | {{pass}} 33 |

    34 | {{pass}} 35 | 36 |
    37 |
    38 | 39 | {{=IMG(_src=URL('static', 'images/save_icon.png'), _alt=T('Save'))}} 40 | 41 | {{=T('Saved file hash:')}} 42 | 43 | {{=T('Last saved on:')}} 44 | {{if TEXT_EDITOR=='amy':}} 45 | 46 | {{else:}} 47 | 48 | {{pass}} 49 | 50 | 51 |
    52 |
    53 |
    54 | 55 | 56 | -------------------------------------------------------------------------------- /apps/welcome_legacy/controllers/default.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # this file is released under public domain and you can use without limitations 3 | 4 | ######################################################################### 5 | ## This is a samples controller 6 | ## - index is the default action of any application 7 | ## - user is required for authentication and authorization 8 | ## - download is for downloading files uploaded in the db (does streaming) 9 | ## - call exposes all registered services (none by default) 10 | ######################################################################### 11 | 12 | 13 | def index(): 14 | """ 15 | example action using the internationalization operator T and flash 16 | rendered by views/default/index.html or views/generic.html 17 | 18 | if you need a simple wiki simple replace the two lines below with: 19 | return auth.wiki() 20 | """ 21 | response.flash = T("Welcome to web2py!") 22 | return dict(message=T('Hello World')) 23 | 24 | 25 | def user(): 26 | """ 27 | exposes: 28 | http://..../[app]/default/user/login 29 | http://..../[app]/default/user/logout 30 | http://..../[app]/default/user/register 31 | http://..../[app]/default/user/profile 32 | http://..../[app]/default/user/retrieve_password 33 | http://..../[app]/default/user/change_password 34 | use @auth.requires_login() 35 | @auth.requires_membership('group name') 36 | @auth.requires_permission('read','table name',record_id) 37 | to decorate functions that need access control 38 | """ 39 | return dict(form=auth()) 40 | 41 | 42 | def download(): 43 | """ 44 | allows downloading of uploaded files 45 | http://..../[app]/default/download/[filename] 46 | """ 47 | return response.download(request, db) 48 | 49 | 50 | def call(): 51 | """ 52 | exposes services. for example: 53 | http://..../[app]/default/call/jsonrpc 54 | decorate with @services.jsonrpc the functions to expose 55 | supports xml, json, xmlrpc, jsonrpc, amfrpc, rss, csv 56 | """ 57 | return service() 58 | 59 | 60 | # @auth.requires_signature() 61 | def data(): 62 | """ 63 | http://..../[app]/default/data/tables 64 | http://..../[app]/default/data/create/[table] 65 | http://..../[app]/default/data/read/[table]/[id] 66 | http://..../[app]/default/data/update/[table]/[id] 67 | http://..../[app]/default/data/delete/[table]/[id] 68 | http://..../[app]/default/data/select/[table] 69 | http://..../[app]/default/data/search/[table] 70 | but URLs must be signed, i.e. linked with 71 | A('table',_href=URL('data/tables',user_signature=True)) 72 | or with the signed load operator 73 | LOAD('default','data.load',args='tables',ajax=True,user_signature=True) 74 | """ 75 | return dict(form=crud()) 76 | -------------------------------------------------------------------------------- /apps/admin/controllers/mercurial.py: -------------------------------------------------------------------------------- 1 | from gluon.fileutils import read_file, write_file 2 | 3 | if DEMO_MODE or MULTI_USER_MODE: 4 | session.flash = T('disabled in demo mode') 5 | redirect(URL('default', 'site')) 6 | if not have_mercurial: 7 | session.flash = T("Sorry, could not find mercurial installed") 8 | redirect(URL('default', 'design', args=request.args(0))) 9 | 10 | _hgignore_content = """\ 11 | syntax: glob 12 | *~ 13 | *.pyc 14 | *.pyo 15 | *.bak 16 | *.bak2 17 | cache/* 18 | private/* 19 | uploads/* 20 | databases/* 21 | sessions/* 22 | errors/* 23 | """ 24 | 25 | 26 | def hg_repo(path): 27 | import os 28 | uio = ui.ui() 29 | uio.quiet = True 30 | if not os.environ.get('HGUSER') and not uio.config("ui", "username"): 31 | os.environ['HGUSER'] = 'web2py@localhost' 32 | try: 33 | repo = hg.repository(ui=uio, path=path) 34 | except: 35 | repo = hg.repository(ui=uio, path=path, create=True) 36 | hgignore = os.path.join(path, '.hgignore') 37 | if not os.path.exists(hgignore): 38 | write_file(hgignore, _hgignore_content) 39 | return repo 40 | 41 | 42 | def commit(): 43 | app = request.args(0) 44 | path = apath(app, r=request) 45 | repo = hg_repo(path) 46 | form = FORM('Comment:', INPUT(_name='comment', requires=IS_NOT_EMPTY()), 47 | INPUT(_type='submit', _value=T('Commit'))) 48 | if form.accepts(request.vars, session): 49 | oldid = repo[repo.lookup('.')] 50 | addremove(repo) 51 | repo.commit(text=form.vars.comment) 52 | if repo[repo.lookup('.')] == oldid: 53 | response.flash = 'no changes' 54 | try: 55 | files = TABLE(*[TR(file) for file in repo[repo.lookup('.')].files()]) 56 | changes = TABLE(TR(TH('revision'), TH('description'))) 57 | for change in repo.changelog: 58 | ctx = repo.changectx(change) 59 | revision, description = ctx.rev(), ctx.description() 60 | changes.append(TR(A(revision, _href=URL('revision', 61 | args=(app, revision))), 62 | description)) 63 | except: 64 | files = [] 65 | changes = [] 66 | return dict(form=form, files=files, changes=changes, repo=repo) 67 | 68 | 69 | def revision(): 70 | app = request.args(0) 71 | path = apath(app, r=request) 72 | repo = hg_repo(path) 73 | revision = request.args(1) 74 | ctx = repo.changectx(revision) 75 | form = FORM(INPUT(_type='submit', _value=T('Revert'))) 76 | if form.accepts(request.vars): 77 | hg.update(repo, revision) 78 | session.flash = "reverted to revision %s" % ctx.rev() 79 | redirect(URL('default', 'design', args=app)) 80 | return dict( 81 | files=ctx.files(), 82 | rev=str(ctx.rev()), 83 | desc=ctx.description(), 84 | form=form 85 | ) 86 | -------------------------------------------------------------------------------- /apps/admin/static/css/calendar.css: -------------------------------------------------------------------------------- 1 | .calendar{z-index:99;position:relative;display:none;background:#fff;border:2px solid #000;font-size:11px;color:#000;cursor:default;font-family:Arial,Helvetica,sans-serif; 2 | border-radius: 10px; 3 | -moz-border-radius: 10px; 4 | -webkit-border-radius: 10px; 5 | }.calendar table{margin:0px;font-size:11px;color:#000;cursor:default;font-family:tahoma,verdana,sans-serif;}.calendar .button{text-align:center;padding:1px;color:#fff;background:#000;}.calendar .nav{background:#000;color:#fff}.calendar thead .title{font-weight:bold;padding:1px;background:#000;color:#fff;text-align:center;}.calendar thead .name{padding:2px;text-align:center;background:#bbb;}.calendar thead .weekend{color:#f00;}.calendar thead .hilite {background-color:#666;}.calendar thead .active{padding:2px 0 0 2px;background-color:#c4c0b8;}.calendar tbody .day{width:2em;text-align:right;padding:2px 4px 2px 2px;}.calendar tbody .day.othermonth{color:#aaa;}.calendar tbody .day.othermonth.oweekend{color:#faa;}.calendar table .wn{padding:2px 3px 2px 2px;background:#bbb;}.calendar tbody .rowhilite td{background:#ddd;}.calendar tbody td.hilite{background:#bbb;}.calendar tbody td.active{background:#bbb;}.calendar tbody td.selected{font-weight:bold;background:#ddd;}.calendar tbody td.weekend{color:#f00;}.calendar tbody td.today{font-weight:bold;color:#00f;}.calendar tbody .disabled{color:#999;}.calendar tbody .emptycell{visibility:hidden;}.calendar tbody .emptyrow{display:none;}.calendar tfoot .ttip{background:#bbb;padding:1px;background:#000;color:#fff;text-align:center;}.calendar tfoot .hilite{background:#ddd;}.calendar tfoot .active{}.calendar .combo{position:absolute;display:none;width:4em;top:0;left:0;cursor:default;background:#e4e0d8;padding:1px;z-index:100;}.calendar .combo .label,.calendar .combo .label-IEfix{text-align:center;padding:1px;}.calendar .combo .label-IEfix{width:4em;}.calendar .combo .active{background:#c4c0b8;}.calendar .combo .hilite{background:#048;color:#fea;}.calendar td.time{padding:1px 0;text-align:center;background-color:#bbb;}.calendar td.time .hour,.calendar td.time .minute,.calendar td.time .ampm{padding:0 3px 0 4px;font-weight:bold;}.calendar td.time .ampm{text-align:center;}.calendar td.time .colon{padding:0 2px 0 3px;font-weight:bold;}.calendar td.time span.hilite{}.calendar td.time span.active{border-color:#f00;background-color:#000;color:#0f0;}.hour,.minute{font-size:2em;} 6 | 7 | #CP_hourcont{z-index:99;padding:0;position:absolute;border:1px dashed #666;background-color:#eee;display:none;}#CP_minutecont{z-index:99;background-color:#ddd;padding:1px;position:absolute;width:45px;display:none;}.floatleft{float:left;}.CP_hour{z-index:99;padding:1px;font-family:Arial,Helvetica,sans-serif;font-size:9px;white-space:nowrap;cursor:pointer;width:35px;}.CP_minute{z-index:99;padding:1px;font-family:Arial,Helvetica,sans-serif;font-size:9px;white-space:nowrap;cursor:pointer;width:auto;}.CP_over{background-color:#fff;z-index:99} 8 | -------------------------------------------------------------------------------- /apps/welcome/static/css/calendar.css: -------------------------------------------------------------------------------- 1 | .calendar{z-index:99;position:relative;display:none;background:#fff;border:2px solid #000;font-size:11px;color:#000;cursor:default;font-family:Arial,Helvetica,sans-serif; 2 | border-radius: 10px; 3 | -moz-border-radius: 10px; 4 | -webkit-border-radius: 10px; 5 | }.calendar table{margin:0px;font-size:11px;color:#000;cursor:default;font-family:tahoma,verdana,sans-serif;}.calendar .button{text-align:center;padding:1px;color:#fff;background:#000;}.calendar .nav{background:#000;color:#fff}.calendar thead .title{font-weight:bold;padding:1px;background:#000;color:#fff;text-align:center;}.calendar thead .name{padding:2px;text-align:center;background:#bbb;}.calendar thead .weekend{color:#f00;}.calendar thead .hilite {background-color:#666;}.calendar thead .active{padding:2px 0 0 2px;background-color:#c4c0b8;}.calendar tbody .day{width:2em;text-align:right;padding:2px 4px 2px 2px;}.calendar tbody .day.othermonth{color:#aaa;}.calendar tbody .day.othermonth.oweekend{color:#faa;}.calendar table .wn{padding:2px 3px 2px 2px;background:#bbb;}.calendar tbody .rowhilite td{background:#ddd;}.calendar tbody td.hilite{background:#bbb;}.calendar tbody td.active{background:#bbb;}.calendar tbody td.selected{font-weight:bold;background:#ddd;}.calendar tbody td.weekend{color:#f00;}.calendar tbody td.today{font-weight:bold;color:#00f;}.calendar tbody .disabled{color:#999;}.calendar tbody .emptycell{visibility:hidden;}.calendar tbody .emptyrow{display:none;}.calendar tfoot .ttip{background:#bbb;padding:1px;background:#000;color:#fff;text-align:center;}.calendar tfoot .hilite{background:#ddd;}.calendar tfoot .active{}.calendar .combo{position:absolute;display:none;width:4em;top:0;left:0;cursor:default;background:#e4e0d8;padding:1px;z-index:100;}.calendar .combo .label,.calendar .combo .label-IEfix{text-align:center;padding:1px;}.calendar .combo .label-IEfix{width:4em;}.calendar .combo .active{background:#c4c0b8;}.calendar .combo .hilite{background:#048;color:#fea;}.calendar td.time{padding:1px 0;text-align:center;background-color:#bbb;}.calendar td.time .hour,.calendar td.time .minute,.calendar td.time .ampm{padding:0 3px 0 4px;font-weight:bold;}.calendar td.time .ampm{text-align:center;}.calendar td.time .colon{padding:0 2px 0 3px;font-weight:bold;}.calendar td.time span.hilite{}.calendar td.time span.active{border-color:#f00;background-color:#000;color:#0f0;}.hour,.minute{font-size:2em;} 6 | 7 | #CP_hourcont{z-index:99;padding:0;position:absolute;border:1px dashed #666;background-color:#eee;display:none;}#CP_minutecont{z-index:99;background-color:#ddd;padding:1px;position:absolute;width:45px;display:none;}.floatleft{float:left;}.CP_hour{z-index:99;padding:1px;font-family:Arial,Helvetica,sans-serif;font-size:9px;white-space:nowrap;cursor:pointer;width:35px;}.CP_minute{z-index:99;padding:1px;font-family:Arial,Helvetica,sans-serif;font-size:9px;white-space:nowrap;cursor:pointer;width:auto;}.CP_over{background-color:#fff;z-index:99} 8 | -------------------------------------------------------------------------------- /apps/admin/static/codemirror/mode/javascript/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CodeMirror: JavaScript mode 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

    CodeMirror: JavaScript mode

    14 | 15 |
    64 | 65 | 71 | 72 |

    JavaScript mode supports a single configuration 73 | option, json, which will set the mode to expect JSON 74 | data rather than a JavaScript program.

    75 | 76 |

    MIME types defined: text/javascript, application/json.

    77 | 78 | 79 | -------------------------------------------------------------------------------- /apps/welcome_legacy/static/css/calendar.css: -------------------------------------------------------------------------------- 1 | .calendar{z-index:99;position:relative;display:none;background:#fff;border:2px solid #000;font-size:11px;color:#000;cursor:default;font-family:Arial,Helvetica,sans-serif; 2 | border-radius: 10px; 3 | -moz-border-radius: 10px; 4 | -webkit-border-radius: 10px; 5 | }.calendar table{margin:0px;font-size:11px;color:#000;cursor:default;font-family:tahoma,verdana,sans-serif;}.calendar .button{text-align:center;padding:1px;color:#fff;background:#000;}.calendar .nav{background:#000;color:#fff}.calendar thead .title{font-weight:bold;padding:1px;background:#000;color:#fff;text-align:center;}.calendar thead .name{padding:2px;text-align:center;background:#bbb;}.calendar thead .weekend{color:#f00;}.calendar thead .hilite {background-color:#666;}.calendar thead .active{padding:2px 0 0 2px;background-color:#c4c0b8;}.calendar tbody .day{width:2em;text-align:right;padding:2px 4px 2px 2px;}.calendar tbody .day.othermonth{color:#aaa;}.calendar tbody .day.othermonth.oweekend{color:#faa;}.calendar table .wn{padding:2px 3px 2px 2px;background:#bbb;}.calendar tbody .rowhilite td{background:#ddd;}.calendar tbody td.hilite{background:#bbb;}.calendar tbody td.active{background:#bbb;}.calendar tbody td.selected{font-weight:bold;background:#ddd;}.calendar tbody td.weekend{color:#f00;}.calendar tbody td.today{font-weight:bold;color:#00f;}.calendar tbody .disabled{color:#999;}.calendar tbody .emptycell{visibility:hidden;}.calendar tbody .emptyrow{display:none;}.calendar tfoot .ttip{background:#bbb;padding:1px;background:#000;color:#fff;text-align:center;}.calendar tfoot .hilite{background:#ddd;}.calendar tfoot .active{}.calendar .combo{position:absolute;display:none;width:4em;top:0;left:0;cursor:default;background:#e4e0d8;padding:1px;z-index:100;}.calendar .combo .label,.calendar .combo .label-IEfix{text-align:center;padding:1px;}.calendar .combo .label-IEfix{width:4em;}.calendar .combo .active{background:#c4c0b8;}.calendar .combo .hilite{background:#048;color:#fea;}.calendar td.time{padding:1px 0;text-align:center;background-color:#bbb;}.calendar td.time .hour,.calendar td.time .minute,.calendar td.time .ampm{padding:0 3px 0 4px;font-weight:bold;}.calendar td.time .ampm{text-align:center;}.calendar td.time .colon{padding:0 2px 0 3px;font-weight:bold;}.calendar td.time span.hilite{}.calendar td.time span.active{border-color:#f00;background-color:#000;color:#0f0;}.hour,.minute{font-size:2em;} 6 | 7 | #CP_hourcont{z-index:99;padding:0;position:absolute;border:1px dashed #666;background-color:#eee;display:none;}#CP_minutecont{z-index:99;background-color:#ddd;padding:1px;position:absolute;width:45px;display:none;}.floatleft{float:left;}.CP_hour{z-index:99;padding:1px;font-family:Arial,Helvetica,sans-serif;font-size:9px;white-space:nowrap;cursor:pointer;width:35px;}.CP_minute{z-index:99;padding:1px;font-family:Arial,Helvetica,sans-serif;font-size:9px;white-space:nowrap;cursor:pointer;width:auto;}.CP_over{background-color:#fff;z-index:99} 8 | -------------------------------------------------------------------------------- /apps/welcome_legacy/views/generic.map: -------------------------------------------------------------------------------- 1 | {{""" 2 | this is an example of usage of google map 3 | the web2py action should be something like: 4 | 5 | def map(): 6 | return dict( 7 | googlemap_key='...', 8 | center_latitude = 41.878, 9 | center_longitude = -87.629, 10 | scale = 7, 11 | maker = lambda point: A(row.id,_href='...') 12 | points = db(db.point).select() where a points have latitute and longitude 13 | ) 14 | 15 | the corresponding views/defaut/map.html should be something like: 16 | 17 | \{\{extend 'layout.html'\}\} 18 |
    \{\{include 'generic.map'\}\}
    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 |
    46 | 48 | 50 |

    51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | {{for bp in breakpoints:}} 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 82 | 83 | {{pass}} 84 | 85 |
    {{=T("Delete")}}{{=T("Filename")}}{{=T("LineNo")}}{{=T("Temporary")}}{{=T("Condition")}}{{=T("Hits")}}
    {{=bp['filename']}}{{=A(bp['lineno'],_href="#",_onclick="collapse('%s');" % bp['number'])}}{{=bp['temporary']}}{{=bp['condition']}}{{=bp['hits']}}
    77 |
    78 | {{=CODE(open(bp['path']).read(), language='python', 79 | link=None, highlight_line=bp['lineno'], context_lines=10)}} 80 |
    81 |
    86 |
    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 | 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.
    • 119 |
    120 | 121 |

    MIME types defined: text/x-python.

    122 | 123 | 124 | --------------------------------------------------------------------------------