Merge branch 'master' into pydal-pip

Conflicts:
	gluon/__init__.py
	gluon/dal/_load.py
	gluon/dal/adapters/base.py
	gluon/dal/adapters/google.py
	gluon/dal/adapters/postgres.py
	gluon/dal/adapters/teradata.py
	gluon/dal/base.py
	gluon/dal/objects.py
	gluon/tests/__init__.py
	gluon/tests/test_dal_nosql.py
This commit is contained in:
gi0baro
2015-01-17 13:32:06 +01:00
55 changed files with 2715 additions and 1907 deletions
+18
View File
@@ -1,3 +1,21 @@
## 2.9.12
- Tornado HTTPS support, thanks Diego
- Modular DAL, thanks Giovanni
- Added coverage support, thanks Niphlod
- More tests, thanks Niphlod and Paolo Valleri
- Added support for show_if in readonly sqlform, thanks Paolo
- Improved scheduler, thanks Niphlod
- Email timeout support
- Made web2py's custom_import work with circular imports, thanks Jack Kuan
- Added Portuguese, Catalan, and Burmese translations
- Allow map_hyphen to work for application names, thanks Tim Nyborg
- New module appconfig.py, thanks Niphlod
- Added geospatial support to Teradata adaptor, thanks Andrew Willimott
- Many bug fixes
## 2.9.6 - 2.9.10 ## 2.9.6 - 2.9.10
- fixed support of GAE + SQL - fixed support of GAE + SQL
+2 -2
View File
@@ -37,7 +37,7 @@ update:
echo "remember that pymysql was tweaked" echo "remember that pymysql was tweaked"
src: src:
### Use semantic versioning ### Use semantic versioning
echo 'Version 2.10.0-beta+timestamp.'`date +%Y.%m.%d.%H.%M.%S` > VERSION echo 'Version 2.9.12-stable+timestamp.'`date +%Y.%m.%d.%H.%M.%S` > VERSION
### rm -f all junk files ### rm -f all junk files
make clean make clean
### clean up baisc apps ### clean up baisc apps
@@ -61,7 +61,7 @@ src:
### build web2py_src.zip ### build web2py_src.zip
echo '' > NEWINSTALL echo '' > NEWINSTALL
mv web2py_src.zip web2py_src_old.zip | echo 'no old' mv web2py_src.zip web2py_src_old.zip | echo 'no old'
cd ..; zip -r web2py/web2py_src.zip web2py/web2py.py web2py/anyserver.py web2py/gluon/*.py web2py/gluon/contrib/* web2py/extras/* web2py/handlers/* web2py/examples/* web2py/README.markdown web2py/LICENSE web2py/CHANGELOG web2py/NEWINSTALL web2py/VERSION web2py/MANIFEST.in web2py/scripts/*.sh web2py/scripts/*.py web2py/applications/admin web2py/applications/examples/ web2py/applications/welcome web2py/applications/__init__.py web2py/site-packages/__init__.py web2py/gluon/tests/*.sh web2py/gluon/tests/*.py cd ..; zip -r web2py/web2py_src.zip web2py/web2py.py web2py/anyserver.py web2py/gluon/*.py web2py/gluon/dal/* web2py/gluon/contrib/* web2py/extras/* web2py/handlers/* web2py/examples/* web2py/README.markdown web2py/LICENSE web2py/CHANGELOG web2py/NEWINSTALL web2py/VERSION web2py/MANIFEST.in web2py/scripts/*.sh web2py/scripts/*.py web2py/applications/admin web2py/applications/examples/ web2py/applications/welcome web2py/applications/__init__.py web2py/site-packages/__init__.py web2py/gluon/tests/*.sh web2py/gluon/tests/*.py
mdp: mdp:
make src make src
+3 -3
View File
@@ -15,13 +15,13 @@ Then edit ./app.yaml and replace "yourappname" with yourappname.
## Documentation (readthedocs.org) ## Documentation (readthedocs.org)
[![Docs Status](https://readthedocs.org/projects/web2py/badge/?version=latest)](http://web2py.rtfd.org/) [![Docs Status](https://readthedocs.org/projects/web2py/badge/?version=latest&style=flat-square)](http://web2py.rtfd.org/)
## Tests ## Tests
[![Build Status](https://travis-ci.org/web2py/web2py.png)](https://travis-ci.org/web2py/web2py) [![Build Status](https://img.shields.io/travis/web2py/web2py.svg?style=flat-square)](https://travis-ci.org/web2py/web2py)
[![Coverage Status](https://coveralls.io/repos/web2py/web2py/badge.png)](https://coveralls.io/r/web2py/web2py) [![Coverage Status](https://img.shields.io/coveralls/web2py/web2py.svg?style=flat-square)](https://coveralls.io/r/web2py/web2py)
## Installation Instructions ## Installation Instructions
+1 -1
View File
@@ -1 +1 @@
Version 2.10.0-beta+timestamp.2014.10.16.15.58.50 Version 2.9.12-stable+timestamp.2015.01.17.00.07.04
+1 -2
View File
@@ -72,8 +72,7 @@ def interact():
f_globals = {} f_globals = {}
for name, value in env['globals'].items(): for name, value in env['globals'].items():
if name not in gluon.html.__all__ and \ if name not in gluon.html.__all__ and \
name not in gluon.validators.__all__ and \ name not in gluon.validators.__all__:
name not in gluon.dal.__all__:
f_globals[name] = pydoc.text.repr(value) f_globals[name] = pydoc.text.repr(value)
else: else:
f_locals = {} f_locals = {}
+25 -26
View File
@@ -589,7 +589,7 @@ def edit():
if 'settings' in request.vars: if 'settings' in request.vars:
if request.post_vars: #save new preferences if request.post_vars: #save new preferences
post_vars = request.post_vars.items() post_vars = request.post_vars.items()
# Since unchecked checkbox are not serialized, we must set them as false by hand to store the correct preference in the settings # Since unchecked checkbox are not serialized, we must set them as false by hand to store the correct preference in the settings
post_vars+= [(opt, 'false') for opt in preferences if opt not in request.post_vars ] post_vars+= [(opt, 'false') for opt in preferences if opt not in request.post_vars ]
if config.save(post_vars): if config.save(post_vars):
response.headers["web2py-component-flash"] = T('Preferences saved correctly') response.headers["web2py-component-flash"] = T('Preferences saved correctly')
@@ -775,12 +775,12 @@ def edit():
view_link=view_link, view_link=view_link,
editviewlinks=editviewlinks, editviewlinks=editviewlinks,
id=IS_SLUG()(filename)[0], id=IS_SLUG()(filename)[0],
force= True if (request.vars.restore or force= True if (request.vars.restore or
request.vars.revert) else False) request.vars.revert) else False)
plain_html = response.render('default/edit_js.html', file_details) plain_html = response.render('default/edit_js.html', file_details)
file_details['plain_html'] = plain_html file_details['plain_html'] = plain_html
if is_mobile: if is_mobile:
return response.render('default.mobile/edit.html', return response.render('default.mobile/edit.html',
file_details, editor_settings=preferences) file_details, editor_settings=preferences)
else: else:
return response.json(file_details) return response.json(file_details)
@@ -1278,7 +1278,7 @@ def create_file():
path = abspath(request.vars.location) path = abspath(request.vars.location)
else: else:
if request.vars.dir: if request.vars.dir:
request.vars.location += request.vars.dir + '/' request.vars.location += request.vars.dir + '/'
app = get_app(name=request.vars.location.split('/')[0]) app = get_app(name=request.vars.location.split('/')[0])
path = apath(request.vars.location, r=request) path = apath(request.vars.location, r=request)
filename = re.sub('[^\w./-]+', '_', request.vars.filename) filename = re.sub('[^\w./-]+', '_', request.vars.filename)
@@ -1387,7 +1387,7 @@ def create_file():
from gluon import *\n""")[1:] from gluon import *\n""")[1:]
elif (path[-8:] == '/static/') or (path[-9:] == '/private/'): elif (path[-8:] == '/static/') or (path[-9:] == '/private/'):
if (request.vars.plugin and if (request.vars.plugin and
not filename.startswith('plugin_%s/' % request.vars.plugin)): not filename.startswith('plugin_%s/' % request.vars.plugin)):
filename = 'plugin_%s/%s' % (request.vars.plugin, filename) filename = 'plugin_%s/%s' % (request.vars.plugin, filename)
text = '' text = ''
@@ -1434,37 +1434,37 @@ def create_file():
""" % URL('edit', args=[app,request.vars.dir,filename]) """ % URL('edit', args=[app,request.vars.dir,filename])
return '' return ''
else: else:
redirect(request.vars.sender + anchor) redirect(request.vars.sender + anchor)
def listfiles(app, dir, regexp='.*\.py$'): def listfiles(app, dir, regexp='.*\.py$'):
files = sorted( files = sorted(
listdir(apath('%(app)s/%(dir)s/' % {'app':app, 'dir':dir}, r=request), regexp)) listdir(apath('%(app)s/%(dir)s/' % {'app':app, 'dir':dir}, r=request), regexp))
files = [x.replace('\\', '/') for x in files if not x.endswith('.bak')] files = [x.replace('\\', '/') for x in files if not x.endswith('.bak')]
return files return files
def editfile(path,file,vars={}, app = None): def editfile(path,file,vars={}, app = None):
args=(path,file) if 'app' in vars else (app,path,file) args=(path,file) if 'app' in vars else (app,path,file)
url = URL('edit', args=args, vars=vars) url = URL('edit', args=args, vars=vars)
return A(file, _class='editor_filelink', _href=url, _style='word-wrap: nowrap;') return A(file, _class='editor_filelink', _href=url, _style='word-wrap: nowrap;')
def files_menu(): def files_menu():
app = request.vars.app or 'welcome' app = request.vars.app or 'welcome'
dirs=[{'name':'models', 'reg':'.*\.py$'}, dirs=[{'name':'models', 'reg':'.*\.py$'},
{'name':'controllers', 'reg':'.*\.py$'}, {'name':'controllers', 'reg':'.*\.py$'},
{'name':'views', 'reg':'[\w/\-]+(\.\w+)+$'}, {'name':'views', 'reg':'[\w/\-]+(\.\w+)+$'},
{'name':'modules', 'reg':'.*\.py$'}, {'name':'modules', 'reg':'.*\.py$'},
{'name':'static', 'reg': '[^\.#].*'}, {'name':'static', 'reg': '[^\.#].*'},
{'name':'private', 'reg':'.*\.py$'}] {'name':'private', 'reg':'.*\.py$'}]
result_files = [] result_files = []
for dir in dirs: for dir in dirs:
result_files.append(TAG[''](LI(dir['name'], _class="nav-header component", _onclick="collapse('" + dir['name'] + "_files');"), result_files.append(TAG[''](LI(dir['name'], _class="nav-header component", _onclick="collapse('" + dir['name'] + "_files');"),
LI(UL(*[LI(editfile(dir['name'], f, dict(id=dir['name'] + f.replace('.','__')), app), _style="overflow:hidden", _id=dir['name']+"__"+f.replace('.','__')) LI(UL(*[LI(editfile(dir['name'], f, dict(id=dir['name'] + f.replace('.','__')), app), _style="overflow:hidden", _id=dir['name']+"__"+f.replace('.','__'))
for f in listfiles(app, dir['name'], regexp=dir['reg'])], for f in listfiles(app, dir['name'], regexp=dir['reg'])],
_class="nav nav-list small-font"), _class="nav nav-list small-font"),
_id=dir['name'] + '_files', _style="display: none;"))) _id=dir['name'] + '_files', _style="display: none;")))
return dict(result_files = result_files) return dict(result_files = result_files)
def upload_file(): def upload_file():
""" File uploading handler """ """ File uploading handler """
if request.vars and not request.vars.token == session.token: if request.vars and not request.vars.token == session.token:
@@ -1941,4 +1941,3 @@ def install_plugin():
T('unable to install plugin "%s"', filename) T('unable to install plugin "%s"', filename)
redirect(URL(f="plugins", args=[app,])) redirect(URL(f="plugins", args=[app,]))
return dict(form=form, app=app, plugin=plugin, source=source) return dict(form=form, app=app, plugin=plugin, source=source)
+480 -480
View File
@@ -1,480 +1,480 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
{ {
'!langcode!': 'cs-cz', '!langcode!': 'cs-cz',
'!langname!': 'čeština', '!langname!': 'čeština',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': 'Kolonka "Upravit" je nepovinný výraz, například "pole1=\'nováhodnota\'". Výsledky databázového JOINu nemůžete mazat ani upravovat.', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': 'Kolonka "Upravit" je nepovinný výraz, například "pole1=\'nováhodnota\'". Výsledky databázového JOINu nemůžete mazat ani upravovat.',
'"User Exception" debug mode. An error ticket could be issued!': '"User Exception" debug mode. An error ticket could be issued!', '"User Exception" debug mode. An error ticket could be issued!': '"User Exception" debug mode. An error ticket could be issued!',
'%%{Row} in Table': '%%{řádek} v tabulce', '%%{Row} in Table': '%%{řádek} v tabulce',
'%%{Row} selected': 'označených %%{řádek}', '%%{Row} selected': 'označených %%{řádek}',
'%s %%{row} deleted': '%s smazaných %%{záznam}', '%s %%{row} deleted': '%s smazaných %%{záznam}',
'%s %%{row} updated': '%s upravených %%{záznam}', '%s %%{row} updated': '%s upravených %%{záznam}',
'%s selected': '%s označených', '%s selected': '%s označených',
'%Y-%m-%d': '%d.%m.%Y', '%Y-%m-%d': '%d.%m.%Y',
'%Y-%m-%d %H:%M:%S': '%d.%m.%Y %H:%M:%S', '%Y-%m-%d %H:%M:%S': '%d.%m.%Y %H:%M:%S',
'(requires internet access)': '(vyžaduje připojení k internetu)', '(requires internet access)': '(vyžaduje připojení k internetu)',
'(requires internet access, experimental)': '(requires internet access, experimental)', '(requires internet access, experimental)': '(requires internet access, experimental)',
'(something like "it-it")': '(například "cs-cs")', '(something like "it-it")': '(například "cs-cs")',
'@markmin\x01(file **gluon/contrib/plural_rules/%s.py** is not found)': '(soubor **gluon/contrib/plural_rules/%s.py** nenalezen)', '@markmin\x01(file **gluon/contrib/plural_rules/%s.py** is not found)': '(soubor **gluon/contrib/plural_rules/%s.py** nenalezen)',
'@markmin\x01Searching: **%s** %%{file}': 'Hledání: **%s** %%{soubor}', '@markmin\x01Searching: **%s** %%{file}': 'Hledání: **%s** %%{soubor}',
'About': 'O programu', 'About': 'O programu',
'About application': 'O aplikaci', 'About application': 'O aplikaci',
'Access Control': 'Řízení přístupu', 'Access Control': 'Řízení přístupu',
'Add breakpoint': 'Přidat bod přerušení', 'Add breakpoint': 'Přidat bod přerušení',
'Additional code for your application': 'Další kód pro Vaši aplikaci', 'Additional code for your application': 'Další kód pro Vaši aplikaci',
'Admin design page': 'Admin design page', 'Admin design page': 'Admin design page',
'Admin language': 'jazyk rozhraní', 'Admin language': 'jazyk rozhraní',
'Administrative interface': 'pro administrátorské rozhraní klikněte sem', 'Administrative interface': 'pro administrátorské rozhraní klikněte sem',
'Administrative Interface': 'Administrátorské rozhraní', 'Administrative Interface': 'Administrátorské rozhraní',
'administrative interface': 'rozhraní pro správu', 'administrative interface': 'rozhraní pro správu',
'Administrator Password:': 'Administrátorské heslo:', 'Administrator Password:': 'Administrátorské heslo:',
'Ajax Recipes': 'Recepty s ajaxem', 'Ajax Recipes': 'Recepty s ajaxem',
'An error occured, please %s the page': 'An error occured, please %s the page', 'An error occured, please %s the page': 'An error occured, please %s the page',
'and rename it:': 'a přejmenovat na:', 'and rename it:': 'a přejmenovat na:',
'appadmin': 'appadmin', 'appadmin': 'appadmin',
'appadmin is disabled because insecure channel': 'appadmin je zakázaná bez zabezpečeného spojení', 'appadmin is disabled because insecure channel': 'appadmin je zakázaná bez zabezpečeného spojení',
'Application': 'Application', 'Application': 'Application',
'application "%s" uninstalled': 'application "%s" odinstalována', 'application "%s" uninstalled': 'application "%s" odinstalována',
'application compiled': 'aplikace zkompilována', 'application compiled': 'aplikace zkompilována',
'Application name:': 'Název aplikace:', 'Application name:': 'Název aplikace:',
'are not used': 'nepoužita', 'are not used': 'nepoužita',
'are not used yet': 'ještě nepoužita', 'are not used yet': 'ještě nepoužita',
'Are you sure you want to delete this object?': 'Opravdu chcete odstranit tento objekt?', 'Are you sure you want to delete this object?': 'Opravdu chcete odstranit tento objekt?',
'Are you sure you want to uninstall application "%s"?': 'Opravdu chcete odinstalovat aplikaci "%s"?', 'Are you sure you want to uninstall application "%s"?': 'Opravdu chcete odinstalovat aplikaci "%s"?',
'arguments': 'arguments', 'arguments': 'arguments',
'at char %s': 'at char %s', 'at char %s': 'at char %s',
'at line %s': 'at line %s', 'at line %s': 'at line %s',
'ATTENTION:': 'ATTENTION:', 'ATTENTION:': 'ATTENTION:',
'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.': 'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.', 'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.': 'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.',
'Available Databases and Tables': 'Dostupné databáze a tabulky', 'Available Databases and Tables': 'Dostupné databáze a tabulky',
'back': 'zpět', 'back': 'zpět',
'Back to wizard': 'Back to wizard', 'Back to wizard': 'Back to wizard',
'Basics': 'Basics', 'Basics': 'Basics',
'Begin': 'Začít', 'Begin': 'Začít',
'breakpoint': 'bod přerušení', 'breakpoint': 'bod přerušení',
'Breakpoints': 'Body přerušení', 'Breakpoints': 'Body přerušení',
'breakpoints': 'body přerušení', 'breakpoints': 'body přerušení',
'Buy this book': 'Koupit web2py knihu', 'Buy this book': 'Koupit web2py knihu',
'Cache': 'Cache', 'Cache': 'Cache',
'cache': 'cache', 'cache': 'cache',
'Cache Keys': 'Klíče cache', 'Cache Keys': 'Klíče cache',
'cache, errors and sessions cleaned': 'cache, chyby a relace byly pročištěny', 'cache, errors and sessions cleaned': 'cache, chyby a relace byly pročištěny',
'can be a git repo': 'může to být git repo', 'can be a git repo': 'může to být git repo',
'Cancel': 'Storno', 'Cancel': 'Storno',
'Cannot be empty': 'Nemůže být prázdné', 'Cannot be empty': 'Nemůže být prázdné',
'Change Admin Password': 'Změnit heslo pro správu', 'Change Admin Password': 'Změnit heslo pro správu',
'Change admin password': 'Změnit heslo pro správu aplikací', 'Change admin password': 'Změnit heslo pro správu aplikací',
'Change password': 'Změna hesla', 'Change password': 'Změna hesla',
'check all': 'vše označit', 'check all': 'vše označit',
'Check for upgrades': 'Zkusit aktualizovat', 'Check for upgrades': 'Zkusit aktualizovat',
'Check to delete': 'Označit ke smazání', 'Check to delete': 'Označit ke smazání',
'Check to delete:': 'Označit ke smazání:', 'Check to delete:': 'Označit ke smazání:',
'Checking for upgrades...': 'Zjišťuji, zda jsou k dispozici aktualizace...', 'Checking for upgrades...': 'Zjišťuji, zda jsou k dispozici aktualizace...',
'Clean': 'Pročistit', 'Clean': 'Pročistit',
'Clear CACHE?': 'Vymazat CACHE?', 'Clear CACHE?': 'Vymazat CACHE?',
'Clear DISK': 'Vymazat DISK', 'Clear DISK': 'Vymazat DISK',
'Clear RAM': 'Vymazat RAM', 'Clear RAM': 'Vymazat RAM',
'Click row to expand traceback': 'Pro rozbalení stopy, klikněte na řádek', 'Click row to expand traceback': 'Pro rozbalení stopy, klikněte na řádek',
'Click row to view a ticket': 'Pro zobrazení chyby (ticketu), klikněte na řádku...', 'Click row to view a ticket': 'Pro zobrazení chyby (ticketu), klikněte na řádku...',
'Client IP': 'IP adresa klienta', 'Client IP': 'IP adresa klienta',
'code': 'code', 'code': 'code',
'Code listing': 'Code listing', 'Code listing': 'Code listing',
'collapse/expand all': 'vše sbalit/rozbalit', 'collapse/expand all': 'vše sbalit/rozbalit',
'Community': 'Komunita', 'Community': 'Komunita',
'Compile': 'Zkompilovat', 'Compile': 'Zkompilovat',
'compiled application removed': 'zkompilovaná aplikace smazána', 'compiled application removed': 'zkompilovaná aplikace smazána',
'Components and Plugins': 'Komponenty a zásuvné moduly', 'Components and Plugins': 'Komponenty a zásuvné moduly',
'Condition': 'Podmínka', 'Condition': 'Podmínka',
'continue': 'continue', 'continue': 'continue',
'Controller': 'Kontrolér (Controller)', 'Controller': 'Kontrolér (Controller)',
'Controllers': 'Kontroléry', 'Controllers': 'Kontroléry',
'controllers': 'kontroléry', 'controllers': 'kontroléry',
'Copyright': 'Copyright', 'Copyright': 'Copyright',
'Count': 'Počet', 'Count': 'Počet',
'Create': 'Vytvořit', 'Create': 'Vytvořit',
'create file with filename:': 'vytvořit soubor s názvem:', 'create file with filename:': 'vytvořit soubor s názvem:',
'created by': 'vytvořil', 'created by': 'vytvořil',
'Created By': 'Vytvořeno - kým', 'Created By': 'Vytvořeno - kým',
'Created On': 'Vytvořeno - kdy', 'Created On': 'Vytvořeno - kdy',
'crontab': 'crontab', 'crontab': 'crontab',
'Current request': 'Aktuální požadavek', 'Current request': 'Aktuální požadavek',
'Current response': 'Aktuální odpověď', 'Current response': 'Aktuální odpověď',
'Current session': 'Aktuální relace', 'Current session': 'Aktuální relace',
'currently running': 'právě běží', 'currently running': 'právě běží',
'currently saved or': 'uloženo nebo', 'currently saved or': 'uloženo nebo',
'customize me!': 'upravte mě!', 'customize me!': 'upravte mě!',
'data uploaded': 'data nahrána', 'data uploaded': 'data nahrána',
'Database': 'Rozhraní databáze', 'Database': 'Rozhraní databáze',
'Database %s select': 'databáze %s výběr', 'Database %s select': 'databáze %s výběr',
'Database administration': 'Database administration', 'Database administration': 'Database administration',
'database administration': 'správa databáze', 'database administration': 'správa databáze',
'Date and Time': 'Datum a čas', 'Date and Time': 'Datum a čas',
'day': 'den', 'day': 'den',
'db': 'db', 'db': 'db',
'DB Model': 'Databázový model', 'DB Model': 'Databázový model',
'Debug': 'Ladění', 'Debug': 'Ladění',
'defines tables': 'defines tables', 'defines tables': 'defines tables',
'Delete': 'Smazat', 'Delete': 'Smazat',
'delete': 'smazat', 'delete': 'smazat',
'delete all checked': 'smazat vše označené', 'delete all checked': 'smazat vše označené',
'delete plugin': 'delete plugin', 'delete plugin': 'delete plugin',
'Delete this file (you will be asked to confirm deletion)': 'Smazat tento soubor (budete požádán o potvrzení mazání)', 'Delete this file (you will be asked to confirm deletion)': 'Smazat tento soubor (budete požádán o potvrzení mazání)',
'Delete:': 'Smazat:', 'Delete:': 'Smazat:',
'deleted after first hit': 'smazat po prvním dosažení', 'deleted after first hit': 'smazat po prvním dosažení',
'Demo': 'Demo', 'Demo': 'Demo',
'Deploy': 'Nahrát', 'Deploy': 'Nahrát',
'Deploy on Google App Engine': 'Nahrát na Google App Engine', 'Deploy on Google App Engine': 'Nahrát na Google App Engine',
'Deploy to OpenShift': 'Nahrát na OpenShift', 'Deploy to OpenShift': 'Nahrát na OpenShift',
'Deployment Recipes': 'Postupy pro deployment', 'Deployment Recipes': 'Postupy pro deployment',
'Description': 'Popis', 'Description': 'Popis',
'design': 'návrh', 'design': 'návrh',
'Detailed traceback description': 'Podrobný výpis prostředí', 'Detailed traceback description': 'Podrobný výpis prostředí',
'details': 'podrobnosti', 'details': 'podrobnosti',
'direction: ltr': 'směr: ltr', 'direction: ltr': 'směr: ltr',
'Disable': 'Zablokovat', 'Disable': 'Zablokovat',
'DISK': 'DISK', 'DISK': 'DISK',
'Disk Cache Keys': 'Klíče diskové cache', 'Disk Cache Keys': 'Klíče diskové cache',
'Disk Cleared': 'Disk smazán', 'Disk Cleared': 'Disk smazán',
'docs': 'dokumentace', 'docs': 'dokumentace',
'Documentation': 'Dokumentace', 'Documentation': 'Dokumentace',
"Don't know what to do?": 'Nevíte kudy kam?', "Don't know what to do?": 'Nevíte kudy kam?',
'done!': 'hotovo!', 'done!': 'hotovo!',
'Download': 'Stáhnout', 'Download': 'Stáhnout',
'download layouts': 'stáhnout moduly rozvržení stránky', 'download layouts': 'stáhnout moduly rozvržení stránky',
'download plugins': 'stáhnout zásuvné moduly', 'download plugins': 'stáhnout zásuvné moduly',
'E-mail': 'E-mail', 'E-mail': 'E-mail',
'Edit': 'Upravit', 'Edit': 'Upravit',
'edit all': 'edit all', 'edit all': 'edit all',
'Edit application': 'Správa aplikace', 'Edit application': 'Správa aplikace',
'edit controller': 'edit controller', 'edit controller': 'edit controller',
'Edit current record': 'Upravit aktuální záznam', 'Edit current record': 'Upravit aktuální záznam',
'Edit Profile': 'Upravit profil', 'Edit Profile': 'Upravit profil',
'edit views:': 'upravit pohled:', 'edit views:': 'upravit pohled:',
'Editing file "%s"': 'Úprava souboru "%s"', 'Editing file "%s"': 'Úprava souboru "%s"',
'Editing Language file': 'Úprava jazykového souboru', 'Editing Language file': 'Úprava jazykového souboru',
'Editing Plural Forms File': 'Editing Plural Forms File', 'Editing Plural Forms File': 'Editing Plural Forms File',
'Email and SMS': 'Email a SMS', 'Email and SMS': 'Email a SMS',
'Enable': 'Odblokovat', 'Enable': 'Odblokovat',
'enter a number between %(min)g and %(max)g': 'zadejte číslo mezi %(min)g a %(max)g', 'enter a number between %(min)g and %(max)g': 'zadejte číslo mezi %(min)g a %(max)g',
'enter an integer between %(min)g and %(max)g': 'zadejte celé číslo mezi %(min)g a %(max)g', 'enter an integer between %(min)g and %(max)g': 'zadejte celé číslo mezi %(min)g a %(max)g',
'Error': 'Chyba', 'Error': 'Chyba',
'Error logs for "%(app)s"': 'Seznam výskytu chyb pro aplikaci "%(app)s"', 'Error logs for "%(app)s"': 'Seznam výskytu chyb pro aplikaci "%(app)s"',
'Error snapshot': 'Snapshot chyby', 'Error snapshot': 'Snapshot chyby',
'Error ticket': 'Ticket chyby', 'Error ticket': 'Ticket chyby',
'Errors': 'Chyby', 'Errors': 'Chyby',
'Exception %(extype)s: %(exvalue)s': 'Exception %(extype)s: %(exvalue)s', 'Exception %(extype)s: %(exvalue)s': 'Exception %(extype)s: %(exvalue)s',
'Exception %s': 'Exception %s', 'Exception %s': 'Exception %s',
'Exception instance attributes': 'Prvky instance výjimky', 'Exception instance attributes': 'Prvky instance výjimky',
'Expand Abbreviation': 'Expand Abbreviation', 'Expand Abbreviation': 'Expand Abbreviation',
'export as csv file': 'exportovat do .csv souboru', 'export as csv file': 'exportovat do .csv souboru',
'exposes': 'vystavuje', 'exposes': 'vystavuje',
'exposes:': 'vystavuje funkce:', 'exposes:': 'vystavuje funkce:',
'extends': 'rozšiřuje', 'extends': 'rozšiřuje',
'failed to compile file because:': 'soubor se nepodařilo zkompilovat, protože:', 'failed to compile file because:': 'soubor se nepodařilo zkompilovat, protože:',
'FAQ': 'Často kladené dotazy', 'FAQ': 'Často kladené dotazy',
'File': 'Soubor', 'File': 'Soubor',
'file': 'soubor', 'file': 'soubor',
'file "%(filename)s" created': 'file "%(filename)s" created', 'file "%(filename)s" created': 'file "%(filename)s" created',
'file saved on %(time)s': 'soubor uložen %(time)s', 'file saved on %(time)s': 'soubor uložen %(time)s',
'file saved on %s': 'soubor uložen %s', 'file saved on %s': 'soubor uložen %s',
'Filename': 'Název souboru', 'Filename': 'Název souboru',
'filter': 'filtr', 'filter': 'filtr',
'Find Next': 'Najít další', 'Find Next': 'Najít další',
'Find Previous': 'Najít předchozí', 'Find Previous': 'Najít předchozí',
'First name': 'Křestní jméno', 'First name': 'Křestní jméno',
'Forgot username?': 'Zapomněl jste svoje přihlašovací jméno?', 'Forgot username?': 'Zapomněl jste svoje přihlašovací jméno?',
'forgot username?': 'zapomněl jste svoje přihlašovací jméno?', 'forgot username?': 'zapomněl jste svoje přihlašovací jméno?',
'Forms and Validators': 'Formuláře a validátory', 'Forms and Validators': 'Formuláře a validátory',
'Frames': 'Frames', 'Frames': 'Frames',
'Free Applications': 'Aplikace zdarma', 'Free Applications': 'Aplikace zdarma',
'Functions with no doctests will result in [passed] tests.': 'Functions with no doctests will result in [passed] tests.', 'Functions with no doctests will result in [passed] tests.': 'Functions with no doctests will result in [passed] tests.',
'Generate': 'Vytvořit', 'Generate': 'Vytvořit',
'Get from URL:': 'Stáhnout z internetu:', 'Get from URL:': 'Stáhnout z internetu:',
'Git Pull': 'Git Pull', 'Git Pull': 'Git Pull',
'Git Push': 'Git Push', 'Git Push': 'Git Push',
'Globals##debug': 'Globální proměnné', 'Globals##debug': 'Globální proměnné',
'go!': 'OK!', 'go!': 'OK!',
'Goto': 'Goto', 'Goto': 'Goto',
'graph model': 'graph model', 'graph model': 'graph model',
'Group %(group_id)s created': 'Skupina %(group_id)s vytvořena', 'Group %(group_id)s created': 'Skupina %(group_id)s vytvořena',
'Group ID': 'ID skupiny', 'Group ID': 'ID skupiny',
'Groups': 'Skupiny', 'Groups': 'Skupiny',
'Hello World': 'Ahoj světe', 'Hello World': 'Ahoj světe',
'Help': 'Nápověda', 'Help': 'Nápověda',
'Hide/Show Translated strings': 'Skrýt/Zobrazit přeložené texty', 'Hide/Show Translated strings': 'Skrýt/Zobrazit přeložené texty',
'Hits': 'Kolikrát dosaženo', 'Hits': 'Kolikrát dosaženo',
'Home': 'Domovská stránka', 'Home': 'Domovská stránka',
'honored only if the expression evaluates to true': 'brát v potaz jen když se tato podmínka vyhodnotí kladně', 'honored only if the expression evaluates to true': 'brát v potaz jen když se tato podmínka vyhodnotí kladně',
'How did you get here?': 'Jak jste se sem vlastně dostal?', 'How did you get here?': 'Jak jste se sem vlastně dostal?',
'If start the upgrade, be patient, it may take a while to download': 'If start the upgrade, be patient, it may take a while to download', 'If start the upgrade, be patient, it may take a while to download': 'If start the upgrade, be patient, it may take a while to download',
'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.\nA green title indicates that all tests (if defined) passed. In this case test results are not shown.': '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.\nA green title indicates that all tests (if defined) passed. In this case test results are not shown.', '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.\nA green title indicates that all tests (if defined) passed. In this case test results are not shown.': '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.\nA green title indicates that all tests (if defined) passed. In this case test results are not shown.',
'import': 'import', 'import': 'import',
'Import/Export': 'Import/Export', 'Import/Export': 'Import/Export',
'includes': 'zahrnuje', 'includes': 'zahrnuje',
'Index': 'Index', 'Index': 'Index',
'insert new': 'vložit nový záznam ', 'insert new': 'vložit nový záznam ',
'insert new %s': 'vložit nový záznam %s', 'insert new %s': 'vložit nový záznam %s',
'inspect attributes': 'inspect attributes', 'inspect attributes': 'inspect attributes',
'Install': 'Instalovat', 'Install': 'Instalovat',
'Installed applications': 'Nainstalované aplikace', 'Installed applications': 'Nainstalované aplikace',
'Interaction at %s line %s': 'Interakce v %s, na řádce %s', 'Interaction at %s line %s': 'Interakce v %s, na řádce %s',
'Interactive console': 'Interaktivní příkazová řádka', 'Interactive console': 'Interaktivní příkazová řádka',
'Internal State': 'Vnitřní stav', 'Internal State': 'Vnitřní stav',
'Introduction': 'Úvod', 'Introduction': 'Úvod',
'Invalid email': 'Neplatný email', 'Invalid email': 'Neplatný email',
'Invalid password': 'Nesprávné heslo', 'Invalid password': 'Nesprávné heslo',
'invalid password.': 'neplatné heslo', 'invalid password.': 'neplatné heslo',
'Invalid Query': 'Neplatný dotaz', 'Invalid Query': 'Neplatný dotaz',
'invalid request': 'Neplatný požadavek', 'invalid request': 'Neplatný požadavek',
'Is Active': 'Je aktivní', 'Is Active': 'Je aktivní',
'It is %s %%{day} today.': 'Dnes je to %s %%{den}.', 'It is %s %%{day} today.': 'Dnes je to %s %%{den}.',
'Key': 'Klíč', 'Key': 'Klíč',
'Key bindings': 'Vazby klíčů', 'Key bindings': 'Vazby klíčů',
'Key bindings for ZenCoding Plugin': 'Key bindings for ZenCoding Plugin', 'Key bindings for ZenCoding Plugin': 'Key bindings for ZenCoding Plugin',
'languages': 'jazyky', 'languages': 'jazyky',
'Languages': 'Jazyky', 'Languages': 'Jazyky',
'Last name': 'Příjmení', 'Last name': 'Příjmení',
'Last saved on:': 'Naposledy uloženo:', 'Last saved on:': 'Naposledy uloženo:',
'Layout': 'Rozvržení stránky (layout)', 'Layout': 'Rozvržení stránky (layout)',
'Layout Plugins': 'Moduly rozvržení stránky (Layout Plugins)', 'Layout Plugins': 'Moduly rozvržení stránky (Layout Plugins)',
'Layouts': 'Rozvržení stránek', 'Layouts': 'Rozvržení stránek',
'License for': 'Licence pro', 'License for': 'Licence pro',
'Line number': 'Číslo řádku', 'Line number': 'Číslo řádku',
'LineNo': 'Č.řádku', 'LineNo': 'Č.řádku',
'Live Chat': 'Online pokec', 'Live Chat': 'Online pokec',
'loading...': 'nahrávám...', 'loading...': 'nahrávám...',
'locals': 'locals', 'locals': 'locals',
'Locals##debug': 'Lokální proměnné', 'Locals##debug': 'Lokální proměnné',
'Logged in': 'Přihlášení proběhlo úspěšně', 'Logged in': 'Přihlášení proběhlo úspěšně',
'Logged out': 'Odhlášení proběhlo úspěšně', 'Logged out': 'Odhlášení proběhlo úspěšně',
'Login': 'Přihlásit se', 'Login': 'Přihlásit se',
'login': 'přihlásit se', 'login': 'přihlásit se',
'Login to the Administrative Interface': 'Přihlásit se do Správce aplikací', 'Login to the Administrative Interface': 'Přihlásit se do Správce aplikací',
'logout': 'odhlásit se', 'logout': 'odhlásit se',
'Logout': 'Odhlásit se', 'Logout': 'Odhlásit se',
'Lost Password': 'Zapomněl jste heslo', 'Lost Password': 'Zapomněl jste heslo',
'Lost password?': 'Zapomněl jste heslo?', 'Lost password?': 'Zapomněl jste heslo?',
'lost password?': 'zapomněl jste heslo?', 'lost password?': 'zapomněl jste heslo?',
'Manage': 'Manage', 'Manage': 'Manage',
'Manage Cache': 'Manage Cache', 'Manage Cache': 'Manage Cache',
'Menu Model': 'Model rozbalovací nabídky', 'Menu Model': 'Model rozbalovací nabídky',
'Models': 'Modely', 'Models': 'Modely',
'models': 'modely', 'models': 'modely',
'Modified By': 'Změněno - kým', 'Modified By': 'Změněno - kým',
'Modified On': 'Změněno - kdy', 'Modified On': 'Změněno - kdy',
'Modules': 'Moduly', 'Modules': 'Moduly',
'modules': 'moduly', 'modules': 'moduly',
'My Sites': 'Správa aplikací', 'My Sites': 'Správa aplikací',
'Name': 'Jméno', 'Name': 'Jméno',
'new application "%s" created': 'nová aplikace "%s" vytvořena', 'new application "%s" created': 'nová aplikace "%s" vytvořena',
'New Application Wizard': 'Nový průvodce aplikací', 'New Application Wizard': 'Nový průvodce aplikací',
'New application wizard': 'Nový průvodce aplikací', 'New application wizard': 'Nový průvodce aplikací',
'New password': 'Nové heslo', 'New password': 'Nové heslo',
'New Record': 'Nový záznam', 'New Record': 'Nový záznam',
'new record inserted': 'nový záznam byl založen', 'new record inserted': 'nový záznam byl založen',
'New simple application': 'Vytvořit primitivní aplikaci', 'New simple application': 'Vytvořit primitivní aplikaci',
'next': 'next', 'next': 'next',
'next 100 rows': 'dalších 100 řádků', 'next 100 rows': 'dalších 100 řádků',
'No databases in this application': 'V této aplikaci nejsou žádné databáze', 'No databases in this application': 'V této aplikaci nejsou žádné databáze',
'No Interaction yet': 'Ještě žádná interakce nenastala', 'No Interaction yet': 'Ještě žádná interakce nenastala',
'No ticket_storage.txt found under /private folder': 'Soubor ticket_storage.txt v adresáři /private nenalezen', 'No ticket_storage.txt found under /private folder': 'Soubor ticket_storage.txt v adresáři /private nenalezen',
'Object or table name': 'Objekt či tabulka', 'Object or table name': 'Objekt či tabulka',
'Old password': 'Původní heslo', 'Old password': 'Původní heslo',
'online designer': 'online návrhář', 'online designer': 'online návrhář',
'Online examples': 'Příklady online', 'Online examples': 'Příklady online',
'Open new app in new window': 'Open new app in new window', 'Open new app in new window': 'Open new app in new window',
'or alternatively': 'or alternatively', 'or alternatively': 'or alternatively',
'Or Get from URL:': 'Or Get from URL:', 'Or Get from URL:': 'Or Get from URL:',
'or import from csv file': 'nebo importovat z .csv souboru', 'or import from csv file': 'nebo importovat z .csv souboru',
'Origin': 'Původ', 'Origin': 'Původ',
'Original/Translation': 'Originál/Překlad', 'Original/Translation': 'Originál/Překlad',
'Other Plugins': 'Ostatní moduly', 'Other Plugins': 'Ostatní moduly',
'Other Recipes': 'Ostatní zásuvné moduly', 'Other Recipes': 'Ostatní zásuvné moduly',
'Overview': 'Přehled', 'Overview': 'Přehled',
'Overwrite installed app': 'Přepsat instalovanou aplikaci', 'Overwrite installed app': 'Přepsat instalovanou aplikaci',
'Pack all': 'Zabalit', 'Pack all': 'Zabalit',
'Pack compiled': 'Zabalit zkompilované', 'Pack compiled': 'Zabalit zkompilované',
'pack plugin': 'pack plugin', 'pack plugin': 'pack plugin',
'password': 'heslo', 'password': 'heslo',
'Password': 'Heslo', 'Password': 'Heslo',
"Password fields don't match": 'Hesla se neshodují', "Password fields don't match": 'Hesla se neshodují',
'Peeking at file': 'Peeking at file', 'Peeking at file': 'Peeking at file',
'Please': 'Prosím', 'Please': 'Prosím',
'Plugin "%s" in application': 'Plugin "%s" in application', 'Plugin "%s" in application': 'Plugin "%s" in application',
'plugins': 'zásuvné moduly', 'plugins': 'zásuvné moduly',
'Plugins': 'Zásuvné moduly', 'Plugins': 'Zásuvné moduly',
'Plural Form #%s': 'Plural Form #%s', 'Plural Form #%s': 'Plural Form #%s',
'Plural-Forms:': 'Množná čísla:', 'Plural-Forms:': 'Množná čísla:',
'Powered by': 'Poháněno', 'Powered by': 'Poháněno',
'Preface': 'Předmluva', 'Preface': 'Předmluva',
'previous 100 rows': 'předchozích 100 řádků', 'previous 100 rows': 'předchozích 100 řádků',
'Private files': 'Soukromé soubory', 'Private files': 'Soukromé soubory',
'private files': 'soukromé soubory', 'private files': 'soukromé soubory',
'profile': 'profil', 'profile': 'profil',
'Project Progress': 'Vývoj projektu', 'Project Progress': 'Vývoj projektu',
'Python': 'Python', 'Python': 'Python',
'Query:': 'Dotaz:', 'Query:': 'Dotaz:',
'Quick Examples': 'Krátké příklady', 'Quick Examples': 'Krátké příklady',
'RAM': 'RAM', 'RAM': 'RAM',
'RAM Cache Keys': 'Klíče RAM Cache', 'RAM Cache Keys': 'Klíče RAM Cache',
'Ram Cleared': 'RAM smazána', 'Ram Cleared': 'RAM smazána',
'Readme': 'Nápověda', 'Readme': 'Nápověda',
'Recipes': 'Postupy jak na to', 'Recipes': 'Postupy jak na to',
'Record': 'Záznam', 'Record': 'Záznam',
'record does not exist': 'záznam neexistuje', 'record does not exist': 'záznam neexistuje',
'Record ID': 'ID záznamu', 'Record ID': 'ID záznamu',
'Record id': 'id záznamu', 'Record id': 'id záznamu',
'refresh': 'obnovte', 'refresh': 'obnovte',
'register': 'registrovat', 'register': 'registrovat',
'Register': 'Zaregistrovat se', 'Register': 'Zaregistrovat se',
'Registration identifier': 'Registrační identifikátor', 'Registration identifier': 'Registrační identifikátor',
'Registration key': 'Registrační klíč', 'Registration key': 'Registrační klíč',
'reload': 'reload', 'reload': 'reload',
'Reload routes': 'Znovu nahrát cesty', 'Reload routes': 'Znovu nahrát cesty',
'Remember me (for 30 days)': 'Zapamatovat na 30 dní', 'Remember me (for 30 days)': 'Zapamatovat na 30 dní',
'Remove compiled': 'Odstranit zkompilované', 'Remove compiled': 'Odstranit zkompilované',
'Removed Breakpoint on %s at line %s': 'Bod přerušení smazán - soubor %s na řádce %s', 'Removed Breakpoint on %s at line %s': 'Bod přerušení smazán - soubor %s na řádce %s',
'Replace': 'Zaměnit', 'Replace': 'Zaměnit',
'Replace All': 'Zaměnit vše', 'Replace All': 'Zaměnit vše',
'request': 'request', 'request': 'request',
'Reset Password key': 'Reset registračního klíče', 'Reset Password key': 'Reset registračního klíče',
'response': 'response', 'response': 'response',
'restart': 'restart', 'restart': 'restart',
'restore': 'obnovit', 'restore': 'obnovit',
'Retrieve username': 'Získat přihlašovací jméno', 'Retrieve username': 'Získat přihlašovací jméno',
'return': 'return', 'return': 'return',
'revert': 'vrátit se k původnímu', 'revert': 'vrátit se k původnímu',
'Role': 'Role', 'Role': 'Role',
'Rows in Table': 'Záznamy v tabulce', 'Rows in Table': 'Záznamy v tabulce',
'Rows selected': 'Záznamů zobrazeno', 'Rows selected': 'Záznamů zobrazeno',
'rules are not defined': 'pravidla nejsou definována', 'rules are not defined': 'pravidla nejsou definována',
"Run tests in this file (to run all files, you may also use the button labelled 'test')": "Spustí testy v tomto souboru (ke spuštění všech testů, použijte tlačítko 'test')", "Run tests in this file (to run all files, you may also use the button labelled 'test')": "Spustí testy v tomto souboru (ke spuštění všech testů, použijte tlačítko 'test')",
'Running on %s': 'Běží na %s', 'Running on %s': 'Běží na %s',
'Save': 'Uložit', 'Save': 'Uložit',
'Save file:': 'Save file:', 'Save file:': 'Save file:',
'Save via Ajax': 'Uložit pomocí Ajaxu', 'Save via Ajax': 'Uložit pomocí Ajaxu',
'Saved file hash:': 'hash uloženého souboru:', 'Saved file hash:': 'hash uloženého souboru:',
'Semantic': 'Modul semantic', 'Semantic': 'Modul semantic',
'Services': 'Služby', 'Services': 'Služby',
'session': 'session', 'session': 'session',
'session expired': 'session expired', 'session expired': 'session expired',
'Set Breakpoint on %s at line %s: %s': 'Bod přerušení nastaven v souboru %s na řádce %s: %s', 'Set Breakpoint on %s at line %s: %s': 'Bod přerušení nastaven v souboru %s na řádce %s: %s',
'shell': 'příkazová řádka', 'shell': 'příkazová řádka',
'Singular Form': 'Singular Form', 'Singular Form': 'Singular Form',
'Site': 'Správa aplikací', 'Site': 'Správa aplikací',
'Size of cache:': 'Velikost cache:', 'Size of cache:': 'Velikost cache:',
'skip to generate': 'skip to generate', 'skip to generate': 'skip to generate',
'Sorry, could not find mercurial installed': 'Bohužel mercurial není nainstalován.', 'Sorry, could not find mercurial installed': 'Bohužel mercurial není nainstalován.',
'Start a new app': 'Vytvořit novou aplikaci', 'Start a new app': 'Vytvořit novou aplikaci',
'Start searching': 'Začít hledání', 'Start searching': 'Začít hledání',
'Start wizard': 'Spustit průvodce', 'Start wizard': 'Spustit průvodce',
'state': 'stav', 'state': 'stav',
'Static': 'Static', 'Static': 'Static',
'static': 'statické soubory', 'static': 'statické soubory',
'Static files': 'Statické soubory', 'Static files': 'Statické soubory',
'Statistics': 'Statistika', 'Statistics': 'Statistika',
'Step': 'Step', 'Step': 'Step',
'step': 'step', 'step': 'step',
'stop': 'stop', 'stop': 'stop',
'Stylesheet': 'CSS styly', 'Stylesheet': 'CSS styly',
'submit': 'odeslat', 'submit': 'odeslat',
'Submit': 'Odeslat', 'Submit': 'Odeslat',
'successful': 'úspěšně', 'successful': 'úspěšně',
'Support': 'Podpora', 'Support': 'Podpora',
'Sure you want to delete this object?': 'Opravdu chcete smazat tento objekt?', 'Sure you want to delete this object?': 'Opravdu chcete smazat tento objekt?',
'Table': 'tabulka', 'Table': 'tabulka',
'Table name': 'Název tabulky', 'Table name': 'Název tabulky',
'Temporary': 'Dočasný', 'Temporary': 'Dočasný',
'test': 'test', 'test': 'test',
'Testing application': 'Testing application', 'Testing application': 'Testing application',
'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': '"Dotaz" je podmínka, například "db.tabulka1.pole1==\'hodnota\'". Podmínka "db.tabulka1.pole1==db.tabulka2.pole2" pak vytvoří SQL JOIN.', 'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': '"Dotaz" je podmínka, například "db.tabulka1.pole1==\'hodnota\'". Podmínka "db.tabulka1.pole1==db.tabulka2.pole2" pak vytvoří SQL JOIN.',
'The application logic, each URL path is mapped in one exposed function in the controller': 'Logika aplikace: každá URL je mapována na funkci vystavovanou kontrolérem.', 'The application logic, each URL path is mapped in one exposed function in the controller': 'Logika aplikace: každá URL je mapována na funkci vystavovanou kontrolérem.',
'The Core': 'Jádro (The Core)', 'The Core': 'Jádro (The Core)',
'The data representation, define database tables and sets': 'Reprezentace dat: definovat tabulky databáze a záznamy', 'The data representation, define database tables and sets': 'Reprezentace dat: definovat tabulky databáze a záznamy',
'The output of the file is a dictionary that was rendered by the view %s': 'Výstup ze souboru je slovník, který se zobrazil v pohledu %s.', 'The output of the file is a dictionary that was rendered by the view %s': 'Výstup ze souboru je slovník, který se zobrazil v pohledu %s.',
'The presentations layer, views are also known as templates': 'Prezentační vrstva: pohledy či templaty (šablony)', 'The presentations layer, views are also known as templates': 'Prezentační vrstva: pohledy či templaty (šablony)',
'The Views': 'Pohledy (The Views)', 'The Views': 'Pohledy (The Views)',
'There are no controllers': 'There are no controllers', 'There are no controllers': 'There are no controllers',
'There are no modules': 'There are no modules', 'There are no modules': 'There are no modules',
'There are no plugins': 'Žádné moduly nejsou instalovány.', 'There are no plugins': 'Žádné moduly nejsou instalovány.',
'There are no private files': 'Žádné soukromé soubory neexistují.', 'There are no private files': 'Žádné soukromé soubory neexistují.',
'There are no static files': 'There are no static files', 'There are no static files': 'There are no static files',
'There are no translators, only default language is supported': 'There are no translators, only default language is supported', 'There are no translators, only default language is supported': 'There are no translators, only default language is supported',
'There are no views': 'There are no views', 'There are no views': 'There are no views',
'These files are not served, they are only available from within your app': 'Tyto soubory jsou klientům nepřístupné. K dispozici jsou pouze v rámci aplikace.', 'These files are not served, they are only available from within your app': 'Tyto soubory jsou klientům nepřístupné. K dispozici jsou pouze v rámci aplikace.',
'These files are served without processing, your images go here': 'Tyto soubory jsou servírovány bez přídavné logiky, sem patří např. obrázky.', 'These files are served without processing, your images go here': 'Tyto soubory jsou servírovány bez přídavné logiky, sem patří např. obrázky.',
'This App': 'Tato aplikace', 'This App': 'Tato aplikace',
'This is a copy of the scaffolding application': 'Toto je kopie aplikace skelet.', 'This is a copy of the scaffolding application': 'Toto je kopie aplikace skelet.',
'This is an experimental feature and it needs more testing. If you decide to upgrade you do it at your own risk': 'This is an experimental feature and it needs more testing. If you decide to upgrade you do it at your own risk', 'This is an experimental feature and it needs more testing. If you decide to upgrade you do it at your own risk': 'This is an experimental feature and it needs more testing. If you decide to upgrade you do it at your own risk',
'This is the %(filename)s template': 'This is the %(filename)s template', 'This is the %(filename)s template': 'This is the %(filename)s template',
'this page to see if a breakpoint was hit and debug interaction is required.': 'tuto stránku, abyste uviděli, zda se dosáhlo bodu přerušení.', 'this page to see if a breakpoint was hit and debug interaction is required.': 'tuto stránku, abyste uviděli, zda se dosáhlo bodu přerušení.',
'Ticket': 'Ticket', 'Ticket': 'Ticket',
'Ticket ID': 'Ticket ID', 'Ticket ID': 'Ticket ID',
'Time in Cache (h:m:s)': 'Čas v Cache (h:m:s)', 'Time in Cache (h:m:s)': 'Čas v Cache (h:m:s)',
'Timestamp': 'Časové razítko', 'Timestamp': 'Časové razítko',
'to previous version.': 'k předchozí verzi.', 'to previous version.': 'k předchozí verzi.',
'To create a plugin, name a file/folder plugin_[name]': 'Zásuvný modul vytvoříte tak, že pojmenujete soubor/adresář plugin_[jméno modulu]', 'To create a plugin, name a file/folder plugin_[name]': 'Zásuvný modul vytvoříte tak, že pojmenujete soubor/adresář plugin_[jméno modulu]',
'To emulate a breakpoint programatically, write:': 'K nastavení bodu přerušení v kódu programu, napište:', 'To emulate a breakpoint programatically, write:': 'K nastavení bodu přerušení v kódu programu, napište:',
'to use the debugger!': ', abyste mohli ladící program používat!', 'to use the debugger!': ', abyste mohli ladící program používat!',
'toggle breakpoint': 'vyp./zap. bod přerušení', 'toggle breakpoint': 'vyp./zap. bod přerušení',
'Toggle Fullscreen': 'Na celou obrazovku a zpět', 'Toggle Fullscreen': 'Na celou obrazovku a zpět',
'too short': 'Příliš krátké', 'too short': 'Příliš krátké',
'Traceback': 'Traceback', 'Traceback': 'Traceback',
'Translation strings for the application': 'Překlad textů pro aplikaci', 'Translation strings for the application': 'Překlad textů pro aplikaci',
'try something like': 'try something like', 'try something like': 'try something like',
'Try the mobile interface': 'Zkuste rozhraní pro mobilní zařízení', 'Try the mobile interface': 'Zkuste rozhraní pro mobilní zařízení',
'try view': 'try view', 'try view': 'try view',
'Twitter': 'Twitter', 'Twitter': 'Twitter',
'Type python statement in here and hit Return (Enter) to execute it.': 'Type python statement in here and hit Return (Enter) to execute it.', 'Type python statement in here and hit Return (Enter) to execute it.': 'Type python statement in here and hit Return (Enter) to execute it.',
'Type some Python code in here and hit Return (Enter) to execute it.': 'Type some Python code in here and hit Return (Enter) to execute it.', 'Type some Python code in here and hit Return (Enter) to execute it.': 'Type some Python code in here and hit Return (Enter) to execute it.',
'Unable to check for upgrades': 'Unable to check for upgrades', 'Unable to check for upgrades': 'Unable to check for upgrades',
'unable to parse csv file': 'csv soubor nedá sa zpracovat', 'unable to parse csv file': 'csv soubor nedá sa zpracovat',
'uncheck all': 'vše odznačit', 'uncheck all': 'vše odznačit',
'Uninstall': 'Odinstalovat', 'Uninstall': 'Odinstalovat',
'update': 'aktualizovat', 'update': 'aktualizovat',
'update all languages': 'aktualizovat všechny jazyky', 'update all languages': 'aktualizovat všechny jazyky',
'Update:': 'Upravit:', 'Update:': 'Upravit:',
'Upgrade': 'Upgrade', 'Upgrade': 'Upgrade',
'upgrade now': 'upgrade now', 'upgrade now': 'upgrade now',
'upgrade now to %s': 'upgrade now to %s', 'upgrade now to %s': 'upgrade now to %s',
'upload': 'nahrát', 'upload': 'nahrát',
'Upload': 'Upload', 'Upload': 'Upload',
'Upload a package:': 'Nahrát balík:', 'Upload a package:': 'Nahrát balík:',
'Upload and install packed application': 'Nahrát a instalovat zabalenou aplikaci', 'Upload and install packed application': 'Nahrát a instalovat zabalenou aplikaci',
'upload file:': 'nahrát soubor:', 'upload file:': 'nahrát soubor:',
'upload plugin file:': 'nahrát soubor modulu:', 'upload plugin file:': 'nahrát soubor modulu:',
'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'Použijte (...)&(...) pro AND, (...)|(...) pro OR a ~(...) pro NOT pro sestavení složitějších dotazů.', 'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'Použijte (...)&(...) pro AND, (...)|(...) pro OR a ~(...) pro NOT pro sestavení složitějších dotazů.',
'User %(id)s Logged-in': 'Uživatel %(id)s přihlášen', 'User %(id)s Logged-in': 'Uživatel %(id)s přihlášen',
'User %(id)s Logged-out': 'Uživatel %(id)s odhlášen', 'User %(id)s Logged-out': 'Uživatel %(id)s odhlášen',
'User %(id)s Password changed': 'Uživatel %(id)s změnil heslo', 'User %(id)s Password changed': 'Uživatel %(id)s změnil heslo',
'User %(id)s Profile updated': 'Uživatel %(id)s upravil profil', 'User %(id)s Profile updated': 'Uživatel %(id)s upravil profil',
'User %(id)s Registered': 'Uživatel %(id)s se zaregistroval', 'User %(id)s Registered': 'Uživatel %(id)s se zaregistroval',
'User %(id)s Username retrieved': 'Uživatel %(id)s si nachal zaslat přihlašovací jméno', 'User %(id)s Username retrieved': 'Uživatel %(id)s si nachal zaslat přihlašovací jméno',
'User ID': 'ID uživatele', 'User ID': 'ID uživatele',
'Username': 'Přihlašovací jméno', 'Username': 'Přihlašovací jméno',
'variables': 'variables', 'variables': 'variables',
'Verify Password': 'Zopakujte heslo', 'Verify Password': 'Zopakujte heslo',
'Version': 'Verze', 'Version': 'Verze',
'Version %s.%s.%s (%s) %s': 'Verze %s.%s.%s (%s) %s', 'Version %s.%s.%s (%s) %s': 'Verze %s.%s.%s (%s) %s',
'Versioning': 'Verzování', 'Versioning': 'Verzování',
'Videos': 'Videa', 'Videos': 'Videa',
'View': 'Pohled (View)', 'View': 'Pohled (View)',
'Views': 'Pohledy', 'Views': 'Pohledy',
'views': 'pohledy', 'views': 'pohledy',
'Web Framework': 'Web Framework', 'Web Framework': 'Web Framework',
'web2py is up to date': 'Máte aktuální verzi web2py.', 'web2py is up to date': 'Máte aktuální verzi web2py.',
'web2py online debugger': 'Ladící online web2py program', 'web2py online debugger': 'Ladící online web2py program',
'web2py Recent Tweets': 'Štěbetání na Twitteru o web2py', 'web2py Recent Tweets': 'Štěbetání na Twitteru o web2py',
'web2py upgrade': 'web2py upgrade', 'web2py upgrade': 'web2py upgrade',
'web2py upgraded; please restart it': 'web2py upgraded; please restart it', 'web2py upgraded; please restart it': 'web2py upgraded; please restart it',
'Welcome': 'Vítejte', 'Welcome': 'Vítejte',
'Welcome to web2py': 'Vitejte ve web2py', 'Welcome to web2py': 'Vitejte ve web2py',
'Welcome to web2py!': 'Vítejte ve web2py!', 'Welcome to web2py!': 'Vítejte ve web2py!',
'Which called the function %s located in the file %s': 'která zavolala funkci %s v souboru (kontroléru) %s.', 'Which called the function %s located in the file %s': 'která zavolala funkci %s v souboru (kontroléru) %s.',
'You are successfully running web2py': 'Úspěšně jste spustili web2py.', 'You are successfully running web2py': 'Úspěšně jste spustili web2py.',
'You can also set and remove breakpoint in the edit window, using the Toggle Breakpoint button': 'Nastavovat a mazat body přerušení je též možno v rámci editování zdrojového souboru přes tlačítko Vyp./Zap. bod přerušení', 'You can also set and remove breakpoint in the edit window, using the Toggle Breakpoint button': 'Nastavovat a mazat body přerušení je též možno v rámci editování zdrojového souboru přes tlačítko Vyp./Zap. bod přerušení',
'You can modify this application and adapt it to your needs': 'Tuto aplikaci si můžete upravit a přizpůsobit ji svým potřebám.', 'You can modify this application and adapt it to your needs': 'Tuto aplikaci si můžete upravit a přizpůsobit ji svým potřebám.',
'You need to set up and reach a': 'Je třeba nejprve nastavit a dojít až na', 'You need to set up and reach a': 'Je třeba nejprve nastavit a dojít až na',
'You visited the url %s': 'Navštívili jste stránku %s,', 'You visited the url %s': 'Navštívili jste stránku %s,',
'Your application will be blocked until you click an action button (next, step, continue, etc.)': 'Aplikace bude blokována než se klikne na jedno z tlačítek (další, krok, pokračovat, atd.)', 'Your application will be blocked until you click an action button (next, step, continue, etc.)': 'Aplikace bude blokována než se klikne na jedno z tlačítek (další, krok, pokračovat, atd.)',
'You can inspect variables using the console bellow': 'Níže pomocí příkazové řádky si můžete prohlédnout proměnné', 'You can inspect variables using the console bellow': 'Níže pomocí příkazové řádky si můžete prohlédnout proměnné',
} }
+2 -2
View File
@@ -325,7 +325,7 @@
'unable to uninstall "%s"': 'impossibile disinstallare "%s"', 'unable to uninstall "%s"': 'impossibile disinstallare "%s"',
'unable to upgrade because "%s"': 'impossibile aggiornare perché "%s"', 'unable to upgrade because "%s"': 'impossibile aggiornare perché "%s"',
'uncheck all': 'smarca tutti', 'uncheck all': 'smarca tutti',
'Uninstall': 'disinstalla', 'Uninstall': 'Disinstalla',
'update': 'aggiorna', 'update': 'aggiorna',
'update all languages': 'aggiorna tutti i linguaggi', 'update all languages': 'aggiorna tutti i linguaggi',
'Update:': 'Aggiorna:', 'Update:': 'Aggiorna:',
@@ -348,7 +348,7 @@
'Versioning': 'Versioning', 'Versioning': 'Versioning',
'View': 'Vista', 'View': 'Vista',
'view': 'vista', 'view': 'vista',
'Views': 'viste', 'Views': 'Viste',
'views': 'viste', 'views': 'viste',
'Web Framework': 'Web Framework', 'Web Framework': 'Web Framework',
'web2py is up to date': 'web2py è aggiornato', 'web2py is up to date': 'web2py è aggiornato',
-2
View File
@@ -47,5 +47,3 @@ if 'adminLanguage' in request.cookies and not (request.cookies['adminLanguage']
#set static_version #set static_version
from gluon.settings import global_settings from gluon.settings import global_settings
response.static_version = global_settings.web2py_version.split('-')[0] response.static_version = global_settings.web2py_version.split('-')[0]
-1
View File
@@ -34,4 +34,3 @@ else:
URL(_a, 'default', f='logout'))) URL(_a, 'default', f='logout')))
response.menu.append((T('Debug'), False, response.menu.append((T('Debug'), False,
URL(_a, 'debug', 'interact'))) URL(_a, 'debug', 'interact')))
@@ -7,11 +7,10 @@ def stateWidget(field, value, data={'on-label':'Enabled', 'off-label':'Disabled'
except: except:
fieldName = field fieldName = field
div = DIV(INPUT( _type='checkbox', _name='%s' % fieldName, _checked= 'checked' if value == 'true' else None, _value='true'), div = DIV(INPUT( _type='checkbox', _name='%s' % fieldName, _checked= 'checked' if value == 'true' else None, _value='true'),
_class='make-bootstrap-switch', _class='make-bootstrap-switch',
data=data) data=data)
script = SCRIPT(""" script = SCRIPT("""
jQuery(".make-bootstrap-switch input[name='%s']").parent().bootstrapSwitch(); jQuery(".make-bootstrap-switch input[name='%s']").parent().bootstrapSwitch();
""" % fieldName) """ % fieldName)
return DIV(div, script) return DIV(div, script)
+492
View File
@@ -0,0 +1,492 @@
# -*- coding: utf-8 -*-
{
'!langcode!': 'ca',
'!langname!': 'Català',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"actualizi" és una expressió opcional com "camp1=\'nou_valor\'". No es poden actualitzar o eliminar resultats de un JOIN',
'%(nrows)s records found': '%(nrows)s registres trobats',
'%s %%{position}': '%s %%{posició}',
'%s %%{row} deleted': '%s %%{fila} %%{eliminada}',
'%s %%{row} updated': '%s %%{fila} %%{actualitzada}',
'%s selected': '%s %%{seleccionat}',
'%Y-%m-%d': '%d/%m/%Y',
'%Y-%m-%d %H:%M:%S': '%d/%m/%Y %H:%M:%S',
'(something like "it-it")': '(similar a "això-això")',
'@markmin\x01An error occured, please [[reload %s]] the page': 'Hi ha hagut un error, si us plau [[recarregui %s]] la pàgina',
'@markmin\x01Number of entries: **%s**': "Nombre d'entrades: **%s**",
'A new version of web2py is available': 'Hi ha una nova versió de wep2py disponible',
'A new version of web2py is available: %s': 'Hi ha una nova versió de wep2py disponible: %s',
'About': 'Sobre',
'about': 'sobre',
'About application': "Sobre l'aplicació",
'Access Control': "Control d'Accés",
'Add': 'Afegir',
'Add Record': 'Afegeix registre',
'additional code for your application': '`codi addicional per a la seva aplicació',
'admin disabled because no admin password': 'admin inhabilitat per falta de contrasenya',
'admin disabled because not supported on google app engine': 'admin inhabilitat, no és suportat en GAE',
'admin disabled because unable to access password file': 'admin inhabilitat, impossible accedir al fitxer con la contrasenya',
'Admin is disabled because insecure channel': 'Admin inhabilitat, el canal no és segur',
'Admin is disabled because unsecure channel': 'Admin inhabilitat, el canal no és segur',
'Administrative interface': 'Interfície administrativa',
'Administrative Interface': 'Interfície Administrativa',
'administrative interface': 'interfície administrativa',
'Administrator Password:': 'Contrasenya del Administrador:',
'Ajax Recipes': 'Receptes AJAX',
'An error occured, please %s the page': 'Hi ha hagut un error, per favor %s la pàgina',
'And': 'I',
'and rename it (required):': 'i renombri-la (requerit):',
'and rename it:': " i renombri'l:",
'appadmin': 'appadmin',
'appadmin is disabled because insecure channel': 'admin inhabilitat, el canal no és segur',
'application "%s" uninstalled': 'aplicació "%s" desinstal·lada',
'application compiled': 'aplicació compilada',
'application is compiled and cannot be designed': 'la aplicació està compilada i no pot ser modificada',
'Apply changes': 'Aplicar canvis',
'Appointment': 'Nomenament',
'Are you sure you want to delete file "%s"?': 'Està segur que vol eliminar el arxiu "%s"?',
'Are you sure you want to delete this object?': 'Està segur que vol esborrar aquest objecte?',
'Are you sure you want to uninstall application "%s"': '¿Està segur que vol desinstalar la aplicació "%s"',
'Are you sure you want to uninstall application "%s"?': '¿Està segur que vol desinstalar la aplicació "%s"?',
'at': 'a',
'ATTENTION: Login requires a secure (HTTPS) connection or running on localhost.': 'ATENCIÓ: Inici de sessió requereix una connexió segura (HTTPS) o localhost.',
'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.': 'ATENCION: NO EJECUTE VARIAS PRUEBAS SIMULTANEAMENTE, NO SON THREAD SAFE.',
'ATTENTION: you cannot edit the running application!': 'ATENCIO: no pot modificar la aplicació que està ejecutant-se!',
'Authentication': 'Autenticació',
'Authentication failed at client DB!': '¡La autenticació ha fallat en la BDD client!',
'Authentication failed at main DB!': '¡La autenticació ha fallat en la BDD principal!',
'Available Databases and Tables': 'Bases de dades i taules disponibles',
'Back': 'Endarrera',
'Buy this book': 'Compra aquest lllibre',
'Cache': 'Caché',
'cache': 'caché',
'Cache Cleared': 'Caché Netejada',
'Cache Keys': 'Claus de la Caché',
'cache, errors and sessions cleaned': 'caché, errors i sessions eliminats',
'Cannot be empty': 'No pot estar buit',
'Cannot compile: there are errors in your app. Debug it, correct errors and try again.': 'No se pot compilar: hi ha errors en la seva aplicació. Depuri, corregeixi errors i torni a intentar-ho.',
'cannot upload file "%(filename)s"': 'no és possible pujar fitxer "%(filename)s"',
'Change Password': 'Canviï la Contrasenya',
'Change password': 'Canviï la contrasenya',
'change password': 'canviï la contrasenya',
'Changelog': 'Changelog',
'check all': 'marcar tots',
'Check to delete': 'Marqui per a eliminar',
'choose one': 'escolliu un',
'clean': 'neteja',
'Clear': 'Netejar',
'Clear CACHE?': 'Netejar Memòrica Cau?',
'Clear DISK': 'Netejar DISC',
'Clear RAM': 'Netejar RAM',
'Click on the link %(link)s to reset your password': "Cliqui en l'enllaç %(link)s per a reiniciar la seva contrasenya",
'click to check for upgrades': 'feu clic per buscar actualitzacions',
'client': 'cliente',
'Client IP': 'IP del Client',
'Close': 'Tancar',
'Comma-separated export including columns not shown; fields from other tables are exported as raw values for faster export': 'Comma-separated export including columns not shown; fields from other tables are exported as raw values for faster export',
'Comma-separated export of visible columns. Fields from other tables are exported as they appear on-screen but this may be slow for many rows': 'Comma-separated export of visible columns. Fields from other tables are exported as they appear on-screen but this may be slow for many rows',
'Community': 'Comunitat',
'compile': 'compilar',
'compiled application removed': 'aplicació compilada eliminada',
'Components and Plugins': 'Components i Plugins',
'contains': 'conté',
'Controller': 'Controlador',
'Controllers': 'Controladors',
'controllers': 'controladors',
'Copyright': 'Copyright',
'Correo electrónico invàlid': 'Correu electrònic invàlid',
'create file with filename:': 'crear el fitxer amb el nom:',
'Create new application': 'Crear una nova aplicació',
'create new application:': 'crear una nova aplicació:',
'Create New Page': 'Crear Pàgina Nova',
'Create Page from Slug': 'Create Page from Slug',
'Created By': 'Creat Per',
'Created On': 'Creat a',
'CSV': 'CSV',
'CSV (hidden cols)': 'CSV (columnas ocultes)',
'Current request': 'Sol·licitud en curs',
'Current response': 'Resposta en curs',
'Current session': 'Sessió en curs',
'currently saved or': 'actualment guardat o',
'customize me!': "¡Adapta'm!",
'data uploaded': 'dades pujades',
'Database': 'Base de dades',
'Database %s select': 'selecció a base de dades %s',
'database administration': 'administració de base de dades',
'Database Administration (appadmin)': 'Administració de Base de Dades (appadmin)',
'Date and Time': 'Data i Hora',
'DB': 'BDD',
'db': 'bdd',
'DB Model': 'Model BDD',
'defines tables': 'defineix taules',
'Delete': 'Eliminar',
'delete': 'eliminar',
'delete all checked': 'eliminar marcats',
'Delete:': 'Eliminar:',
'Demo': 'Demostració',
'Deploy on Google App Engine': 'Desplegament a Google App Engine',
'Deployment Recipes': 'Receptes de desplegament',
'Description': 'Descripció',
'design': 'diseny',
'DESIGN': 'DISENY',
'Design for': 'Diseny per a',
'detecting': 'detectant',
'DISK': 'DISC',
'Disk Cache Keys': 'Claus de Caché en Disc',
'Disk Cleared': 'Disc netejat',
'Documentation': 'Documentació',
"Don't know what to do?": 'No sap què fer?',
'done!': '¡fet!',
'Download': 'Descàrregues',
'E-mail': 'Correu electrònic',
'edit': 'editar',
'EDIT': 'EDITAR',
'Edit': 'Editar',
'Edit application': 'Editar aplicació',
'edit controller': 'editar controlador',
'Edit current record': 'Editar el registre actual',
'Edit Menu': 'Editar Menu',
'Edit Page': 'Editar Pàgina',
'Edit Page Media': 'Edit Page Media',
'Edit Profile': 'Editar Perfil',
'edit profile': 'editar perfil',
'Edit This App': 'Editi aquesta App',
'Editing file': 'Editant fitxer',
'Editing file "%s"': 'Editant fitxer "%s"',
'El fitxer ha de ser PDF': 'El fitxer ha de ser PDF',
'El fitxer ha de ser PDF o XML': 'El fitxer ha de ser PDF o XML',
'Email': 'Email',
'Email and SMS': 'Correu electrònic i SMS',
'Email sent': 'Correu electrònic enviat',
'End of impersonation': 'Fi de suplantació',
'enter a number between %(min)g and %(max)g': 'introdueixi un número entre %(min)g i %(max)g',
'Enter a valid email address': 'Entri una adreça email vàlida',
'enter a value': 'entri un valor',
'Enter a value': 'Entri un valor',
'Enter an integer between %(min)g and %(max)g': 'Entri un numero enter entre %(min)g i %(max)g',
'enter an integer between %(min)g and %(max)g': 'entri numero enter entre %(min)g i %(max)g',
'enter date and time as %(format)s': 'entri data i hora com %(format)s',
'Enter from %(min)g to %(max)g characters': 'Entri des de %(min)g a %(max)g caràcters',
'Enter valid filename': 'Entri nom de fitxer vàlid',
'Error logs for "%(app)s"': 'Bitàcora de errors a "%(app)s"',
'errors': 'errors',
'Errors': 'Errors',
'Errors in form, please check it out.': 'Hi ha errors en el formulari, per favor comprovi-ho.',
'export as csv file': 'exportar com fitxer CSV',
'Export:': 'Exportar:',
'exposes': 'exposa',
'extends': 'extén',
'failed to reload module': 'la recàrrega del mòdul ha fallat',
'FAQ': 'FAQ',
'file': 'fitxer',
'file "%(filename)s" created': 'fitxer "%(filename)s" creat',
'file "%(filename)s" deleted': 'fitxer "%(filename)s" eliminat',
'file "%(filename)s" uploaded': 'fitxer "%(filename)s" pujat',
'file "%(filename)s" was not deleted': 'fitxer "%(filename)s" no fou eliminat',
'file "%s" of %s restored': 'fitxer "%s" de %s restaurat',
'file ## download': 'file ',
'file changed on disk': 'fitxer modificat en el disco',
'file does not exist': 'fitxer no existeix',
'file saved on %(time)s': 'fitxer guardat a %(time)s',
'file saved on %s': 'fitxer guardat a %s',
'First name': 'Nom',
'Forgot username?': 'Ha oblidat el nom de usuari?',
'Forms and Validators': 'Formularis i validadors',
'Free Applications': 'Aplicacions Lliures',
'Functions with no doctests will result in [passed] tests.': 'Funcions sense doctests equivalen a pruebas [aceptades].',
'Group %(group_id)s created': 'Grupo %(group_id)s creat',
'Group ID': 'ID de Grup',
'Group uniquely assigned to user %(id)s': 'Grup assignat únicament al usuari %(id)s',
'Groups': 'Grups',
'Hello': 'Hola',
'Hello World': 'Hola Món',
'help': 'ajuda',
'Home': 'Inici',
'Hosted by': 'Hosted by',
'How did you get here?': 'Com has arribat aquí?',
'HTML': 'HTML',
'HTML export of visible columns': 'HTML export de columnes visibles',
'htmledit': 'htmledit',
'Impersonate': 'Suplantar',
'import': 'importar',
'Import/Export': 'Importar/Exportar',
'in': 'a',
'includes': 'inclou',
'Index': 'Índex',
'insert new': 'inserti nou',
'insert new %s': 'inserti nou %s',
'Installed applications': 'Aplicacions instalades',
'Insufficient privileges': 'Privilegis insuficients',
'internal error': 'error intern',
'Internal State': 'Estat Intern',
'Introduction': 'Introducció',
'Invalid action': 'Acció invàlida',
'Invalid email': 'Correo electrónico invàlid',
'invalid expression': 'expressió invàlida',
'Invalid login': 'Inici de sessió invàlida',
'invalid password': 'contrasenya invàlida',
'Invalid Query': 'Consulta invàlida',
'invalid request': 'sol·licitud invàlida',
'Invalid reset password': 'Reinici de contrasenya invàlid',
'invalid ticket': 'tiquet invàlid',
'Is Active': 'Està Actiu',
'Key': 'Clau',
'language file "%(filename)s" created/updated': 'fitxer de llenguatge "%(filename)s" creat/actualitzat',
'Language files (static strings) updated': 'Fitxers de llenguatge (cadenes estàtiques) actualitzats',
'languages': 'llenguatges',
'Languages': 'Llenguatges',
'languages updated': 'llenguatges actualitzats',
'Last name': 'Cognom',
'Last saved on:': 'Guardat a:',
'Layout': 'Diseny de pàgina',
'Layout Plugins': 'Plugins de disseny',
'Layouts': 'Dissenys de pàgines',
'License for': 'Llicència per a',
'Live Chat': 'Xat en viu',
'loading...': 'carregant...',
'Log In': 'Log In',
'Log Out': 'Log Out',
'Logged in': 'Sessió iniciada',
'Logged out': 'Sessió finalitzada',
'Login': 'Inici de sessió',
'login': 'inici de sessió',
'Login disabled by administrator': 'Inici de sessió inhabilitat pel administrador',
'Login to the Administrative Interface': 'Inici de sessió per a la Interfície Administrativa',
'logout': 'fi de sessió',
'Logout': 'Fi de sessió',
'Lost Password': 'Contrasenya perdida',
'Lost password?': 'Ha oblidat la contrasenya?',
'lost password?': '¿ha oblidat la contrasenya?',
'Main Menu': 'Menú principal',
'Manage %(action)s': 'Manage %(action)s',
'Manage Access Control': 'Manage Access Control',
'Manage Cache': 'Gestionar la Caché',
'Menu Model': 'Model "menu"',
'merge': 'combinar',
'Models': 'Models',
'models': 'models',
'Modified By': 'Modificat Per',
'Modified On': 'Modificat A',
'Modules': 'Mòduls',
'modules': 'mòduls',
'must be YYYY-MM-DD HH:MM:SS!': '¡debe ser DD/MM/YYYY HH:MM:SS!',
'must be YYYY-MM-DD!': '¡debe ser DD/MM/YYYY!',
'My Sites': 'Els Meus Llocs',
'Name': 'Nombre',
'New': 'Nuevo',
'New %(entity)s': 'Nou %(entity)s',
'new application "%s" created': 'nova aplicació "%s" creada',
'New password': 'Contrasenya nova',
'New Record': 'Registre nou',
'new record inserted': 'nou registre insertat',
'New Search': 'Cerca nova',
'next %s rows': 'següents %s files',
'next 100 rows': '100 files següents',
'NO': 'NO',
'No databases in this application': 'No hi ha bases de dades en esta aplicació',
'No records found': "No s'han trobat registres",
'Not authorized': 'No autoritzat',
'not in': 'no a',
'Object or table name': 'Nom del objecte o taula',
'Old password': 'Contrasenya anterior',
'Online examples': 'Ejemples en línia',
'Or': 'O',
'or import from csv file': 'o importar desde fitxer CSV',
'or provide application url:': 'o proveeix URL de la aplicació:',
'Origin': 'Origen',
'Original/Translation': 'Original/Traducció',
'Other Plugins': 'Altres Plugins',
'Other Recipes': 'Altres Receptes',
'Overview': 'Resum',
'pack all': 'empaquetar tot',
'pack compiled': 'empaquetar compilats',
'Password': 'Contrasenya',
'Password changed': 'Contrasenya cambiada',
"Password fields don't match": 'Els camps de contrasenya no coincideixen',
'Password reset': 'Reinici de contrasenya',
'Peeking at file': 'Visualitzant fitxer',
'Permission': 'Permís',
'Permissions': 'Permisos',
'Phone': 'Telèfon',
'please input your password again': 'si us plau, entri un altre cop la seva contrasenya',
'Plugins': 'Plugins',
'Powered by': 'Aquest lloc utilitza',
'Preface': 'Prefaci',
'Presentar Factures': 'Presentar Factures',
'Presentar factures': 'Presentar factures',
'previous %s rows': '%s files prèvies',
'previous 100 rows': '100 files anteriors',
'Profile': 'Perfil',
'Profile updated': 'Perfil actualitzat',
'pygraphviz library not found': 'pygraphviz library not found',
'Python': 'Python',
'Query Not Supported: %s': 'Consulta No Suportada: %s',
'Query:': 'Consulta:',
'Quick Examples': 'Exemple Ràpids',
'RAM': 'RAM',
'RAM Cache Keys': 'Claus de la Caché en RAM',
'Ram Cleared': 'Ram Netjeda',
'Recipes': 'Receptes',
'Record': 'Registre',
'Record %(id)s created': 'Registre %(id)s creat',
'Record Created': 'Registre Creat',
'record does not exist': 'el registre no existe',
'Record ID': 'ID de Registre',
'Record id': 'Id de registre',
'Ref APB': 'Ref APB',
'register': "registri's",
'Register': "Registri's",
'Registration identifier': 'Identificador de Registre',
'Registration key': 'Clau de registre',
'Registration successful': 'Registre amb èxit',
'reload': 'recarregar',
'Remember me (for 30 days)': "Recordi'm (durant 30 dies)",
'remove compiled': 'eliminar compilades',
'Request reset password': 'Sol·licitud de restabliment de contrasenya',
'Reset password': 'Reiniciar contrasenya',
'Reset Password key': 'Restaurar Clau de la Contrasenya',
'Resolve Conflict file': 'Resolgui el Conflicte de fitxer',
'restore': 'restaurar',
'Retrieve username': 'Recuperar nom de usuari',
'revert': 'revertir',
'Role': 'Rol',
'Roles': 'Rols',
'Rows in Table': 'Files a la taula',
'Rows selected': 'Files seleccionades',
'save': 'guardar',
'Save model as...': 'Save model as...',
'Saved file hash:': 'Hash del fitxer guardat:',
'Search': 'Buscar',
'Search Pages': 'Search Pages',
'Semantic': 'Semàntica',
'Services': 'Serveis',
'session expired': 'sessió expirada',
'shell': 'terminal',
'Sign Up': 'Sign Up',
'site': 'lloc',
'Size of cache:': 'Mida de la Caché:',
'Slug': 'Slug',
'some files could not be removed': 'algunos archivos no pudieron ser removidos',
'Spreadsheet-optimised export of tab-separated content including hidden columns. May be slow': 'Spreadsheet-optimised export of tab-separated content including hidden columns. May be slow',
'Spreadsheet-optimised export of tab-separated content, visible columns only. May be slow.': 'Spreadsheet-optimised export of tab-separated content, visible columns only. May be slow.',
'start': 'inici',
'Start building a new search': 'Start building a new search',
'starts with': 'comença per',
'state': 'estat',
'static': 'estàtics',
'Static files': 'Fitxers estàtics',
'Statistics': 'Estadístiques',
'Stylesheet': "Fulla d'estil",
'Submit': 'Enviar',
'submit': 'enviar',
'Success!': 'Correcte!',
'Support': 'Suport',
'Sure you want to delete this object?': '¿Està segur que vol eliminar aquest objecte?',
'Table': 'taula',
'Table name': 'Nom de la taula',
'test': 'provar',
'Testing application': 'Provant aplicació',
'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': 'La "consulta" és una condición com "db.tabla1.campo1==\'valor\'". Algo com "db.tabla1.campo1==db.tabla2.campo2" resulta en un JOIN SQL.',
'the application logic, each URL path is mapped in one exposed function in the controller': 'la lògica de la aplicació, cada ruta URL es mapeja en una funció exposada en el controlador',
'The Core': 'El Nucli',
'the data representation, define database tables and sets': 'la representació de dades, defineix taules i conjunts de base de dades',
'The output of the file is a dictionary that was rendered by the view %s': 'El resultat de aquesta funció és un diccionari que és desplegat per la vista %s',
'the presentations layer, views are also known as templates': 'la capa de presentació, les vistes també són anomenades plantilles',
'The Views': 'Les Vistes',
'There are no controllers': 'No hi ha controladors',
'There are no models': 'No hi ha models',
'There are no modules': 'No hi ha mòduls',
'There are no static files': 'No hi ha fitxers estàtics',
'There are no translators, only default language is supported': 'No hi ha traductors, només el llenguatge per defecte és suportat',
'There are no views': 'No hi ha vistes',
'these files are served without processing, your images go here': 'aquests fitxers són servits sense processar, les seves imatges van aquí',
'This App': 'Aquesta Aplicació',
'This email already has an account': 'Aquest correu electrònic ja té un compte',
'This is a copy of the scaffolding application': 'Aquesta és una còpia de la aplicació de bastiment',
'This is the %(filename)s template': 'Aquesta és la plantilla %(filename)s',
'Ticket': 'Tiquet',
'Time in Cache (h:m:s)': 'Temps en Caché (h:m:s)',
'Timestamp': 'Marca de temps',
'Title': 'Títol',
'to previous version.': 'a la versió prèvia.',
'To emulate a breakpoint programatically, write:': 'Emular un punto de ruptura programàticament, escribir:',
'to use the debugger!': 'usar el depurador!',
'toggle breakpoint': 'alternar punt de ruptura',
'Toggle comment': 'Alternar comentari',
'Toggle Fullscreen': 'Alternar pantalla completa',
'too short': 'massa curt',
'Traceback': 'Traceback',
'translation strings for the application': 'cadenes de caracters de traducció per a la aplicació',
'try': 'intenti',
'try something like': 'intenti algo com',
'TSV (Excel compatible)': 'TSV (compatible Excel)',
'TSV (Excel compatible, hidden cols)': 'TSV (compatible Excel, columnes ocultes)',
'TSV (Spreadsheets)': 'TSV (Fulls de càlcul)',
'TSV (Spreadsheets, hidden cols)': 'TSV (Fulls de càlcul, columnes amagades)',
'Twitter': 'Twitter',
'Unable to check for upgrades': 'No és possible verificar la existencia de actualitzacions',
'unable to create application "%s"': 'no és possible crear la aplicació "%s"',
'unable to delete file "%(filename)s"': 'no és possible eliminar el fitxer "%(filename)s"',
'Unable to download': 'No és possible la descàrrega',
'Unable to download app': 'No és possible descarregar la aplicació',
'unable to parse csv file': 'no és possible analitzar el fitxer CSV',
'unable to uninstall "%s"': 'no és possible instalar "%s"',
'uncheck all': 'desmarcar tots',
'uninstall': 'desinstalar',
'unknown': 'desconocido',
'update': 'actualitzar',
'update all languages': 'actualitzar tots els llenguatges',
'Update:': 'Actualizi:',
'upload application:': 'pujar aplicació:',
'Upload existing application': 'Puji aquesta aplicació',
'upload file:': 'puji fitxer:',
'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'Use (...)&(...) para AND, (...)|(...) para OR, i ~(...) para NOT, para crear consultas més complexes.',
'User': 'Usuari',
'User %(id)s is impersonating %(other_id)s': 'El usuari %(id)s està suplantant %(other_id)s',
'User %(id)s Logged-in': 'El usuari %(id)s inicià la sessió',
'User %(id)s Logged-out': 'El usuari %(id)s finalitzà la sessió',
'User %(id)s Password changed': 'Contrasenya del usuari %(id)s canviada',
'User %(id)s Password reset': 'Contrasenya del usuari %(id)s reiniciada',
'User %(id)s Profile updated': 'Actualitzat el perfil del usuari %(id)s',
'User %(id)s Registered': 'Usuari %(id)s Registrat',
'User %(id)s Username retrieved': 'Se ha recuperat el nom de usuari del usuari %(id)s',
'User %(username)s Logged-in': 'El usuari %(username)s inicià la sessió',
"User '%(username)s' Logged-in": "El usuari '%(username)s' inicià la sessió",
"User '%(username)s' Logged-out": "El usuari '%(username)s' finalitzà la sessió",
'User Id': 'Id de Usuari',
'User ID': 'ID de Usuari',
'User Logged-out': 'El usuari finalitzà la sessió',
'Username': 'Nom de usuari',
'Username retrieve': 'Recuperar nom de usuari',
'Users': 'Usuaris',
'Value already in database or empty': 'El valor ya existeix en la base de dades o està buit',
'value already in database or empty': 'el valor ya existeix en la base de dades o està buit',
'value not allowed': 'valor no permès',
'Value not in database': 'El valor no està a la base de dades',
'value not in database': 'el valor no està a la base de dades',
'Verify Password': 'Verificar Contrasenya',
'Version': 'Versió',
'versioning': 'versions',
'Videos': 'Videos',
'View': 'Vista',
'view': 'vista',
'View %(entity)s': 'Veure %(entity)s',
'View Page': 'View Page',
'Views': 'Vistes',
'views': 'vistes',
'web2py is up to date': 'web2py està actualitzat',
'web2py Recent Tweets': 'Tweets Recents de web2py',
'Welcome': 'Benvingut',
'Welcome %s': 'Benvingut %s',
'Welcome to web2py': 'Benvingut a web2py',
'Welcome to web2py!': '¡Benvingut a web2py!',
'Which called the function %s located in the file %s': 'La qual va cridar la funció %s localitzada en el fitxer %s',
'Wiki Page': 'Wiki Page',
'Working...': 'Treballant ...',
'XML': 'XML',
'XML export of columns shown': 'XML export of columns shown',
'YES': 'SÍ',
'You are successfully running web2py': 'Vostè està executant web2py amb èxit',
'You can modify this application and adapt it to your needs': 'Vostè pot modificar aquesta aplicació i adaptar-la a les seves necessitats',
'You visited the url %s': 'Vostè va visitar la url %s',
'Your username is: %(username)s': 'El seu nom de usuari és: %(username)s',
}
+2 -2
View File
@@ -25,9 +25,9 @@ import sys
import re import re
import zipfile import zipfile
#read web2py version from VERSION file #read web2py version from VERSION file
web2py_version_line = readlines_file('VERSION')[0] web2py_version_line = readlines_file('VERSION')[0]
#use regular expression to get just the version number #use regular expression to get just the version number
v_re = re.compile('[0-9]+\.[0-9]+\.[0-9]+') v_re = re.compile('[0-9]+\.[0-9]+\.[0-9]+')
web2py_version = v_re.search(web2py_version_line).group(0) web2py_version = v_re.search(web2py_version_line).group(0)
+32 -32
View File
@@ -1,8 +1,8 @@
#!/usr/bin/env python #!/usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
#Adapted from http://bazaar.launchpad.net/~flavour/sahana-eden/trunk/view/head:/static/scripts/tools/standalone_exe.py #Adapted from http://bazaar.launchpad.net/~flavour/sahana-eden/trunk/view/head:/static/scripts/tools/standalone_exe.py
USAGE = """ USAGE = """
Usage: Usage:
Copy this and setup_exe.conf to web2py root folder Copy this and setup_exe.conf to web2py root folder
@@ -13,7 +13,7 @@ Usage:
Install bbfreeze: https://pypi.python.org/pypi/bbfreeze/ Install bbfreeze: https://pypi.python.org/pypi/bbfreeze/
run python setup_exe.py bbfreeze run python setup_exe.py bbfreeze
""" """
from distutils.core import setup from distutils.core import setup
from gluon.import_all import base_modules, contributed_modules from gluon.import_all import base_modules, contributed_modules
from gluon.fileutils import readlines_file from gluon.fileutils import readlines_file
@@ -24,7 +24,7 @@ import shutil
import sys import sys
import re import re
import zipfile import zipfile
if len(sys.argv) != 2 or not os.path.isfile('web2py.py'): if len(sys.argv) != 2 or not os.path.isfile('web2py.py'):
print USAGE print USAGE
sys.exit(1) sys.exit(1)
@@ -32,11 +32,11 @@ BUILD_MODE = sys.argv[1]
if not BUILD_MODE in ('py2exe', 'bbfreeze'): if not BUILD_MODE in ('py2exe', 'bbfreeze'):
print USAGE print USAGE
sys.exit(1) sys.exit(1)
def unzip(source_filename, dest_dir): def unzip(source_filename, dest_dir):
with zipfile.ZipFile(source_filename) as zf: with zipfile.ZipFile(source_filename) as zf:
zf.extractall(dest_dir) zf.extractall(dest_dir)
#borrowed from http://bytes.com/topic/python/answers/851018-how-zip-directory-python-using-zipfile #borrowed from http://bytes.com/topic/python/answers/851018-how-zip-directory-python-using-zipfile
def recursive_zip(zipf, directory, folder=""): def recursive_zip(zipf, directory, folder=""):
for item in os.listdir(directory): for item in os.listdir(directory):
@@ -45,14 +45,14 @@ def recursive_zip(zipf, directory, folder=""):
elif os.path.isdir(os.path.join(directory, item)): elif os.path.isdir(os.path.join(directory, item)):
recursive_zip( recursive_zip(
zipf, os.path.join(directory, item), folder + os.sep + item) zipf, os.path.join(directory, item), folder + os.sep + item)
#read web2py version from VERSION file #read web2py version from VERSION file
web2py_version_line = readlines_file('VERSION')[0] web2py_version_line = readlines_file('VERSION')[0]
#use regular expression to get just the version number #use regular expression to get just the version number
v_re = re.compile('[0-9]+\.[0-9]+\.[0-9]+') v_re = re.compile('[0-9]+\.[0-9]+\.[0-9]+')
web2py_version = v_re.search(web2py_version_line).group(0) web2py_version = v_re.search(web2py_version_line).group(0)
#pull in preferences from config file #pull in preferences from config file
import ConfigParser import ConfigParser
Config = ConfigParser.ConfigParser() Config = ConfigParser.ConfigParser()
@@ -68,12 +68,12 @@ include_gevent = Config.getboolean("Setup", "include_gevent")
# Python base version # Python base version
python_version = sys.version_info[:3] python_version = sys.version_info[:3]
if BUILD_MODE == 'py2exe': if BUILD_MODE == 'py2exe':
import py2exe import py2exe
setup( setup(
console=[{'script':'web2py.py', console=[{'script':'web2py.py',
'icon_resources': [(0, 'extras/icons/web2py.ico')] 'icon_resources': [(0, 'extras/icons/web2py.ico')]
@@ -88,8 +88,8 @@ if BUILD_MODE == 'py2exe':
author="Massimo DiPierro", author="Massimo DiPierro",
license="LGPL v3", license="LGPL v3",
data_files=[ data_files=[
'ABOUT', 'ABOUT',
'LICENSE', 'LICENSE',
'VERSION' 'VERSION'
], ],
options={'py2exe': { options={'py2exe': {
@@ -108,7 +108,7 @@ if BUILD_MODE == 'py2exe':
zipl.close() zipl.close()
shutil.rmtree(library_temp_dir) shutil.rmtree(library_temp_dir)
print "web2py binary successfully built" print "web2py binary successfully built"
elif BUILD_MODE == 'bbfreeze': elif BUILD_MODE == 'bbfreeze':
modules = base_modules + contributed_modules modules = base_modules + contributed_modules
from bbfreeze import Freezer from bbfreeze import Freezer
@@ -131,26 +131,26 @@ elif BUILD_MODE == 'bbfreeze':
for req in ['ABOUT', 'LICENSE', 'VERSION']: for req in ['ABOUT', 'LICENSE', 'VERSION']:
shutil.copy(req, os.path.join('dist', req)) shutil.copy(req, os.path.join('dist', req))
print "web2py binary successfully built" print "web2py binary successfully built"
try: try:
os.unlink('storage.sqlite') os.unlink('storage.sqlite')
except: except:
pass pass
#This need to happen after bbfreeze is run because Freezer() deletes distdir before starting! #This need to happen after bbfreeze is run because Freezer() deletes distdir before starting!
if python_version > (2,5): if python_version > (2,5):
# Python26 compatibility: http://www.py2exe.org/index.cgi/Tutorial#Step52 # Python26 compatibility: http://www.py2exe.org/index.cgi/Tutorial#Step52
try: try:
shutil.copytree('C:\Bin\Microsoft.VC90.CRT', 'dist/Microsoft.VC90.CRT/') shutil.copytree('C:\Bin\Microsoft.VC90.CRT', 'dist/Microsoft.VC90.CRT/')
except: except:
print "You MUST copy Microsoft.VC90.CRT folder into the archive" print "You MUST copy Microsoft.VC90.CRT folder into the archive"
def copy_folders(source, destination): def copy_folders(source, destination):
"""Copy files & folders from source to destination (within dist/)""" """Copy files & folders from source to destination (within dist/)"""
if os.path.exists(os.path.join('dist', destination)): if os.path.exists(os.path.join('dist', destination)):
shutil.rmtree(os.path.join('dist', destination)) shutil.rmtree(os.path.join('dist', destination))
shutil.copytree(os.path.join(source), os.path.join('dist', destination)) shutil.copytree(os.path.join(source), os.path.join('dist', destination))
#should we remove Windows OS dlls user is unlikely to be able to distribute #should we remove Windows OS dlls user is unlikely to be able to distribute
if remove_msft_dlls: if remove_msft_dlls:
print "Deleted Microsoft files not licensed for open source distribution" print "Deleted Microsoft files not licensed for open source distribution"
@@ -166,7 +166,7 @@ if remove_msft_dlls:
os.unlink(os.path.join('dist', f)) os.unlink(os.path.join('dist', f))
except: except:
print "unable to delete dist/" + f print "unable to delete dist/" + f
#Should we include applications? #Should we include applications?
if copy_apps: if copy_apps:
copy_folders('applications', 'applications') copy_folders('applications', 'applications')
@@ -177,12 +177,12 @@ else:
copy_folders('applications/welcome', 'applications/welcome') copy_folders('applications/welcome', 'applications/welcome')
copy_folders('applications/examples', 'applications/examples') copy_folders('applications/examples', 'applications/examples')
print "Only web2py's admin, examples & welcome applications have been added" print "Only web2py's admin, examples & welcome applications have been added"
copy_folders('extras', 'extras') copy_folders('extras', 'extras')
copy_folders('examples', 'examples') copy_folders('examples', 'examples')
copy_folders('handlers', 'handlers') copy_folders('handlers', 'handlers')
#should we copy project's site-packages into dist/site-packages #should we copy project's site-packages into dist/site-packages
if copy_site_packages: if copy_site_packages:
#copy site-packages #copy site-packages
@@ -190,7 +190,7 @@ if copy_site_packages:
else: else:
#no worries, web2py will create the (empty) folder first run #no worries, web2py will create the (empty) folder first run
print "Skipping site-packages" print "Skipping site-packages"
#should we copy project's scripts into dist/scripts #should we copy project's scripts into dist/scripts
if copy_scripts: if copy_scripts:
#copy scripts #copy scripts
@@ -198,7 +198,7 @@ if copy_scripts:
else: else:
#no worries, web2py will create the (empty) folder first run #no worries, web2py will create the (empty) folder first run
print "Skipping scripts" print "Skipping scripts"
#should we create a zip file of the build? #should we create a zip file of the build?
if make_zip: if make_zip:
#create a web2py folder & copy dist's files into it #create a web2py folder & copy dist's files into it
@@ -209,13 +209,13 @@ if make_zip:
# just temp so the web2py directory is included in our zip file # just temp so the web2py directory is included in our zip file
path = 'zip_temp' path = 'zip_temp'
# leave the first folder as None, as path is root. # leave the first folder as None, as path is root.
recursive_zip(zipf, path) recursive_zip(zipf, path)
zipf.close() zipf.close()
shutil.rmtree('zip_temp') shutil.rmtree('zip_temp')
print "Your Windows binary version of web2py can be found in " + \ print "Your Windows binary version of web2py can be found in " + \
zip_filename + ".zip" zip_filename + ".zip"
print "You may extract the archive anywhere and then run web2py/web2py.exe" print "You may extract the archive anywhere and then run web2py/web2py.exe"
#should py2exe build files be removed? #should py2exe build files be removed?
if remove_build_files: if remove_build_files:
if BUILD_MODE == 'py2exe': if BUILD_MODE == 'py2exe':
@@ -223,10 +223,10 @@ if remove_build_files:
shutil.rmtree('deposit') shutil.rmtree('deposit')
shutil.rmtree('dist') shutil.rmtree('dist')
print "build files removed" print "build files removed"
#final info #final info
if not make_zip and not remove_build_files: if not make_zip and not remove_build_files:
print "Your Windows binary & associated files can also be found in /dist" print "Your Windows binary & associated files can also be found in /dist"
print "Finished!" print "Finished!"
print "Enjoy web2py " + web2py_version_line print "Enjoy web2py " + web2py_version_line
+693 -660
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -127,7 +127,7 @@ class mybuiltin(object):
def LOAD(c=None, f='index', args=None, vars=None, def LOAD(c=None, f='index', args=None, vars=None,
extension=None, target=None, ajax=False, ajax_trap=False, extension=None, target=None, ajax=False, ajax_trap=False,
url=None, user_signature=False, timeout=None, times=1, url=None, user_signature=False, timeout=None, times=1,
content='loading...', **attr): content='loading...', post_vars=Storage(), **attr):
""" LOADs a component into the action's document """ LOADs a component into the action's document
Args: Args:
@@ -202,7 +202,7 @@ def LOAD(c=None, f='index', args=None, vars=None,
other_request.args = List(args) other_request.args = List(args)
other_request.vars = vars other_request.vars = vars
other_request.get_vars = vars other_request.get_vars = vars
other_request.post_vars = Storage() other_request.post_vars = post_vars
other_response = Response() other_response = Response()
other_request.env.path_info = '/' + \ other_request.env.path_info = '/' + \
'/'.join([request.application, c, f] + '/'.join([request.application, c, f] +
+123
View File
@@ -0,0 +1,123 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Read from configuration files easily without hurting performances
USAGE:
During development you can load a config file either in .ini or .json
format (by default app/private/appconfig.ini or app/private/appconfig.json)
The result is a dict holding the configured values. Passing reload=True
is meant only for development: in production, leave reload to False and all
values will be cached
from gluon.contrib.appconfig import AppConfig
myconfig = AppConfig(path_to_configfile, reload=False)
print myconfig['db']['uri']
The returned dict can walk with "dot notation" an arbitrarely nested dict
print myconfig.take('db.uri')
You can even pass a cast function, i.e.
print myconfig.take('auth.expiration', cast=int)
Once the value has been fetched (and casted) it won't change until the process
is restarted (or reload=True is passed).
"""
import thread
import os
from ConfigParser import SafeConfigParser
from gluon import current
from gluon.serializers import json_parser
locker = thread.allocate_lock()
def AppConfig(*args, **vars):
locker.acquire()
reload_ = vars.pop('reload', False)
try:
instance_name = 'AppConfig_' + current.request.application
if reload_ or not hasattr(AppConfig, instance_name):
setattr(AppConfig, instance_name, AppConfigLoader(*args, **vars))
return getattr(AppConfig, instance_name).settings
finally:
locker.release()
class AppConfigDict(dict):
"""
dict that has a .take() method to fetch nested values and puts
them into cache
"""
def __init__(self, *args, **kwargs):
dict.__init__(self, *args, **kwargs)
self.int_cache = {}
def take(self, path, cast=None):
parts = path.split('.')
if path in self.int_cache:
return self.int_cache[path]
value = self
walking = []
for part in parts:
if part not in value:
raise BaseException("%s not in config [%s]" %
(part, '-->'.join(walking)))
value = value[part]
walking.append(part)
if cast is None:
self.int_cache[path] = value
else:
try:
value = cast(value)
self.int_cache[path] = value
except (ValueError, TypeError):
raise BaseException("%s can't be converted to %s" %
(value, cast))
return value
class AppConfigLoader(object):
def __init__(self, configfile=None):
if not configfile:
priv_folder = os.path.join(current.request.folder, 'private')
configfile = os.path.join(priv_folder, 'appconfig.ini')
if not os.path.isfile(configfile):
configfile = os.path.join(priv_folder, 'appconfig.json')
if not os.path.isfile(configfile):
configfile = None
if not configfile or not os.path.isfile(configfile):
raise BaseException("Config file not found")
self.file = configfile
self.ctype = os.path.splitext(configfile)[1][1:]
self.settings = None
self.read_config()
def read_config_ini(self):
config = SafeConfigParser()
config.read(self.file)
settings = {}
for section in config.sections():
settings[section] = {}
for option in config.options(section):
settings[section][option] = config.get(section, option)
self.settings = AppConfigDict(settings)
def read_config_json(self):
with open(self.file, 'r') as c:
self.settings = AppConfigDict(json_parser.load(c))
def read_config(self):
if self.settings is None:
try:
getattr(self, 'read_config_' + self.ctype)()
except AttributeError:
raise BaseException("Unsupported config file format")
return self.settings
+10 -11
View File
@@ -47,7 +47,7 @@ class Collection(object):
if self.compact: if self.compact:
for fieldname in (self.table_policy.get('fields',table.fields)): for fieldname in (self.table_policy.get('fields',table.fields)):
field = table[fieldname] field = table[fieldname]
if not ((field.type=='text' and text==False) or if not ((field.type=='text' and text==False) or
field.type=='blob' or field.type=='blob' or
field.type.startswith('reference ') or field.type.startswith('reference ') or
field.type.startswith('list:reference ')) and field.name in row: field.type.startswith('list:reference ')) and field.name in row:
@@ -56,7 +56,7 @@ class Collection(object):
for fieldname in (self.table_policy.get('fields',table.fields)): for fieldname in (self.table_policy.get('fields',table.fields)):
field = table[fieldname] field = table[fieldname]
if not ((field.type=='text' and text==False) or if not ((field.type=='text' and text==False) or
field.type=='blob' or field.type=='blob' or
field.type.startswith('reference ') or field.type.startswith('reference ') or
field.type.startswith('list:reference ')) and field.name in row: field.type.startswith('list:reference ')) and field.name in row:
data.append({'name':field.name,'value':row[field.name], data.append({'name':field.name,'value':row[field.name],
@@ -128,10 +128,10 @@ class Collection(object):
for key,value in vars.items(): for key,value in vars.items():
if key=='_offset': if key=='_offset':
limitby[0] = int(value) # MAY FAIL limitby[0] = int(value) # MAY FAIL
elif key == '_limit': elif key == '_limit':
limitby[1] = int(value)+1 # MAY FAIL limitby[1] = int(value)+1 # MAY FAIL
elif key=='_orderby': elif key=='_orderby':
orderby = value orderby = value
elif key in fieldnames: elif key in fieldnames:
queries.append(table[key] == value) queries.append(table[key] == value)
elif key.endswith('.eq') and key[:-3] in fieldnames: # for completeness (useless) elif key.endswith('.eq') and key[:-3] in fieldnames: # for completeness (useless)
@@ -156,14 +156,14 @@ class Collection(object):
if filter_query: if filter_query:
queries.append(filter_query) queries.append(filter_query)
query = reduce(lambda a,b:a&b,queries[1:]) if len(queries)>1 else queries[0] query = reduce(lambda a,b:a&b,queries[1:]) if len(queries)>1 else queries[0]
orderby = [table[f] if f[0]!='~' else ~table[f[1:]] for f in orderby.split(',')] orderby = [table[f] if f[0]!='~' else ~table[f[1:]] for f in orderby.split(',')]
return (query, limitby, orderby) return (query, limitby, orderby)
def table2queries(self,table, href): def table2queries(self,table, href):
""" generates a set of collection.queries examples for the table """ """ generates a set of collection.queries examples for the table """
data = [] data = []
for fieldname in (self.table_policy.get('fields', table.fields)): for fieldname in (self.table_policy.get('fields', table.fields)):
data.append({'name':fieldname,'value':''}) data.append({'name':fieldname,'value':''})
if self.extensions: if self.extensions:
data.append({'name':fieldname+'.ne','value':''}) # NEW !!! data.append({'name':fieldname+'.ne','value':''}) # NEW !!!
data.append({'name':fieldname+'.lt','value':''}) data.append({'name':fieldname+'.lt','value':''})
@@ -192,7 +192,7 @@ class Collection(object):
if not tablename: if not tablename:
r['href'] = URL(scheme=True), r['href'] = URL(scheme=True),
# https://github.com/collection-json/extensions/blob/master/model.md # https://github.com/collection-json/extensions/blob/master/model.md
r['links'] = [{'rel' : t, 'href' : URL(args=t,scheme=True), 'model':t} r['links'] = [{'rel' : t, 'href' : URL(args=t,scheme=True), 'model':t}
for t in tablenames] for t in tablenames]
response.headers['Content-Type'] = 'application/vnd.collection+json' response.headers['Content-Type'] = 'application/vnd.collection+json'
return response.json({'collection':r}) return response.json({'collection':r})
@@ -207,7 +207,7 @@ class Collection(object):
# process GET # process GET
if request.env.request_method=='GET': if request.env.request_method=='GET':
table = db[tablename] table = db[tablename]
r['href'] = URL(args=tablename) r['href'] = URL(args=tablename)
r['items'] = items = [] r['items'] = items = []
try: try:
(query, limitby, orderby) = self.request2query(table,request.get_vars) (query, limitby, orderby) = self.request2query(table,request.get_vars)
@@ -258,7 +258,7 @@ class Collection(object):
return response.json({'collection':r}) return response.json({'collection':r})
# process DELETE # process DELETE
elif request.env.request_method=='DELETE': elif request.env.request_method=='DELETE':
table = db[tablename] table = db[tablename]
if not request.get_vars: if not request.get_vars:
return self.error(400, "BAD REQUEST", "Nothing to delete") return self.error(400, "BAD REQUEST", "Nothing to delete")
else: else:
@@ -312,7 +312,7 @@ class Collection(object):
request, response = self.request, self.response request, response = self.request, self.response
r = OrderedDict({ r = OrderedDict({
"version" : self.VERSION, "version" : self.VERSION,
"href" : URL(args=request.args,vars=request.vars), "href" : URL(args=request.args,vars=request.vars),
"error" : { "error" : {
"title" : title, "title" : title,
"code" : code, "code" : code,
@@ -340,4 +340,3 @@ example_policies = {
'DELETE':{'query':None}, 'DELETE':{'query':None},
}, },
} }
@@ -73,7 +73,7 @@ class BrowserID(object):
auth_info_json = fetch(self.verify_url, data=verify_data) auth_info_json = fetch(self.verify_url, data=verify_data)
j = json.loads(auth_info_json) j = json.loads(auth_info_json)
epoch_time = int(time.time() * 1000) # we need 13 digit epoch time epoch_time = int(time.time() * 1000) # we need 13 digit epoch time
if j["status"] == "okay" and j["audience"] == audience and j['issuer'] == issuer and j['expires'] >= epoch_time: if j["status"] == "okay" and j["audience"] == audience and j['issuer'].endswith(issuer) and j['expires'] >= epoch_time:
return dict(email=j['email']) return dict(email=j['email'])
elif self.on_login_failure: elif self.on_login_failure:
#print "status: ", j["status"]=="okay", j["status"] #print "status: ", j["status"]=="okay", j["status"]
+6 -6
View File
@@ -254,12 +254,12 @@ class Table(DALStorage):
self._db(self.id > 0).delete() self._db(self.id > 0).delete()
def insert(self, **fields): def insert(self, **fields):
# Checks 3 times that the id is new. 3 times is enough! # Checks 3 times that the id is new. 3 times is enough!
for i in range(3): for i in range(3):
id = self._create_id() id = self._create_id()
if self.get(id) is None and self.update(id, **fields): if self.get(id) is None and self.update(id, **fields):
return long(id) return long(id)
else: else:
raise RuntimeError("Too many ID conflicts") raise RuntimeError("Too many ID conflicts")
+3 -4
View File
@@ -141,7 +141,7 @@ class Connection(object):
parts = "complete" parts = "complete"
return ("OK", (("%s " % message_id, message[parts]), message["flags"])) return ("OK", (("%s " % message_id, message[parts]), message["flags"]))
def _get_messages(self, query): def _get_messages(self, query):
if query.strip().isdigit(): if query.strip().isdigit():
return [self.spam[self._mailbox][int(query.strip()) - 1],] return [self.spam[self._mailbox][int(query.strip()) - 1],]
@@ -151,7 +151,7 @@ class Connection(object):
for item in self.spam[self._mailbox]: for item in self.spam[self._mailbox]:
if item["uid"] == query[1:-1].replace("UID", "").strip(): if item["uid"] == query[1:-1].replace("UID", "").strip():
return [item,] return [item,]
messages = [] messages = []
try: try:
for m in self.results[self._mailbox][query]: for m in self.results[self._mailbox][query]:
try: try:
@@ -169,7 +169,7 @@ class Connection(object):
return messages return messages
except KeyError: except KeyError:
raise ValueError("The client issued an unexpected query: %s" % query) raise ValueError("The client issued an unexpected query: %s" % query)
def setup(self, spam={}, results={}): def setup(self, spam={}, results={}):
"""adds custom message and query databases or sets """adds custom message and query databases or sets
the values to the module defaults. the values to the module defaults.
@@ -252,4 +252,3 @@ class IMAP4(object):
return Connection() return Connection()
IMAP4_SSL = IMAP4 IMAP4_SSL = IMAP4
+4 -4
View File
@@ -11,7 +11,7 @@
Note: This module is intended as a plugin replacement of pbkdf2.py Note: This module is intended as a plugin replacement of pbkdf2.py
by Armin Ronacher. by Armin Ronacher.
Git repository: Git repository:
$ git clone https://github.com/michele-comitini/pbkdf2_ctypes.git $ git clone https://github.com/michele-comitini/pbkdf2_ctypes.git
:copyright: Copyright (c) 2013: Michele Comitini <mcm@glisco.it> :copyright: Copyright (c) 2013: Michele Comitini <mcm@glisco.it>
@@ -86,7 +86,7 @@ def _openssl_hashlib_to_crypto_map_get(hashfunc):
crypto_hashfunc.restype = ctypes.c_void_p crypto_hashfunc.restype = ctypes.c_void_p
return crypto_hashfunc() return crypto_hashfunc()
def _openssl_pbkdf2(data, salt, iterations, digest, keylen): def _openssl_pbkdf2(data, salt, iterations, digest, keylen):
"""OpenSSL compatibile wrapper """OpenSSL compatibile wrapper
""" """
@@ -99,7 +99,7 @@ def _openssl_pbkdf2(data, salt, iterations, digest, keylen):
c_iter = ctypes.c_int(iterations) c_iter = ctypes.c_int(iterations)
c_keylen = ctypes.c_int(keylen) c_keylen = ctypes.c_int(keylen)
c_buff = ctypes.create_string_buffer(keylen) c_buff = ctypes.create_string_buffer(keylen)
# PKCS5_PBKDF2_HMAC(const char *pass, int passlen, # PKCS5_PBKDF2_HMAC(const char *pass, int passlen,
# const unsigned char *salt, int saltlen, int iter, # const unsigned char *salt, int saltlen, int iter,
# const EVP_MD *digest, # const EVP_MD *digest,
@@ -109,7 +109,7 @@ def _openssl_pbkdf2(data, salt, iterations, digest, keylen):
ctypes.c_char_p, ctypes.c_int, ctypes.c_char_p, ctypes.c_int,
ctypes.c_int, ctypes.c_void_p, ctypes.c_int, ctypes.c_void_p,
ctypes.c_int, ctypes.c_char_p] ctypes.c_int, ctypes.c_char_p]
crypto.PKCS5_PBKDF2_HMAC.restype = ctypes.c_int crypto.PKCS5_PBKDF2_HMAC.restype = ctypes.c_int
err = crypto.PKCS5_PBKDF2_HMAC(c_pass, c_passlen, err = crypto.PKCS5_PBKDF2_HMAC(c_pass, c_passlen,
c_salt, c_saltlen, c_salt, c_saltlen,
+408 -408
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -235,7 +235,7 @@ class SoapDispatcher(object):
body.marshall("%s:Fault" % soap_ns, fault, ns=False) body.marshall("%s:Fault" % soap_ns, fault, ns=False)
else: else:
# return normal value # return normal value
res = body.add_child("%sResponse" % name, ns=prefix) res = body.add_child("%sResponse" % name, ns=self.namespace)
if not prefix: if not prefix:
res['xmlns'] = self.namespace # add target namespace res['xmlns'] = self.namespace # add target namespace
+22 -22
View File
@@ -37,7 +37,7 @@ def pay():
elif form.errors: elif form.errors:
redirect(URL('pay_error')) redirect(URL('pay_error'))
return dict(form=form) return dict(form=form)
""" """
URL_CHARGE = 'https://%s:@api.stripe.com/v1/charges' URL_CHARGE = 'https://%s:@api.stripe.com/v1/charges'
@@ -114,7 +114,7 @@ class StripeForm(object):
def process(self): def process(self):
from gluon import current from gluon import current
request = current.request request = current.request
if request.post_vars: if request.post_vars:
if self.signature == request.post_vars.signature: if self.signature == request.post_vars.signature:
self.response = Stripe(self.sk).charge( self.response = Stripe(self.sk).charge(
@@ -127,7 +127,7 @@ class StripeForm(object):
return self return self
self.errors = True self.errors = True
return self return self
def xml(self): def xml(self):
from gluon.template import render from gluon.template import render
if self.accepted: if self.accepted:
@@ -135,8 +135,8 @@ class StripeForm(object):
elif self.errors: elif self.errors:
return "There was an processing error" return "There was an processing error"
else: else:
context = dict(amount=self.amount, context = dict(amount=self.amount,
signature=self.signature, pk=self.pk, signature=self.signature, pk=self.pk,
currency_symbol=self.currency_symbol, currency_symbol=self.currency_symbol,
security_notice=self.security_notice, security_notice=self.security_notice,
disclosure_notice=self.disclosure_notice) disclosure_notice=self.disclosure_notice)
@@ -145,14 +145,14 @@ class StripeForm(object):
TEMPLATE = """ TEMPLATE = """
<script type="text/javascript" src="https://js.stripe.com/v2/"></script> <script type="text/javascript" src="https://js.stripe.com/v2/"></script>
<script> <script>
jQuery(function(){ jQuery(function(){
// This identifies your website in the createToken call below // This identifies your website in the createToken call below
Stripe.setPublishableKey('{{=pk}}'); Stripe.setPublishableKey('{{=pk}}');
var stripeResponseHandler = function(status, response) { var stripeResponseHandler = function(status, response) {
var jQueryform = jQuery('#payment-form'); var jQueryform = jQuery('#payment-form');
if (response.error) { if (response.error) {
// Show the errors on the form // Show the errors on the form
jQuery('.payment-errors').text(response.error.message).show(); jQuery('.payment-errors').text(response.error.message).show();
@@ -167,17 +167,17 @@ jQuery(function(){
jQueryform.get(0).submit(); jQueryform.get(0).submit();
} }
}; };
jQuery(function(jQuery) { jQuery(function(jQuery) {
jQuery('#payment-form').submit(function(e) { jQuery('#payment-form').submit(function(e) {
var jQueryform = jQuery(this); var jQueryform = jQuery(this);
// Disable the submit button to prevent repeated clicks // Disable the submit button to prevent repeated clicks
jQueryform.find('button').prop('disabled', true); jQueryform.find('button').prop('disabled', true);
Stripe.createToken(jQueryform, stripeResponseHandler); Stripe.createToken(jQueryform, stripeResponseHandler);
// Prevent the form from submitting with the default action // Prevent the form from submitting with the default action
return false; return false;
}); });
@@ -189,33 +189,33 @@ jQuery(function(){
<form action="" method="POST" id="payment-form" class="form-horizontal"> <form action="" method="POST" id="payment-form" class="form-horizontal">
<div class="form-row control-group"> <div class="form-row control-group">
<label class="control-label">Card Number</label> <label class="control-label">Card Number</label>
<div class="controls"> <div class="controls">
<input type="text" size="20" data-stripe="number" <input type="text" size="20" data-stripe="number"
placeholder="4242424242424242"/> placeholder="4242424242424242"/>
</div> </div>
</div> </div>
<div class="form-row control-group"> <div class="form-row control-group">
<label class="control-label">CVC</label> <label class="control-label">CVC</label>
<div class="controls"> <div class="controls">
<input type="text" size="4" style="width:80px" data-stripe="cvc" <input type="text" size="4" style="width:80px" data-stripe="cvc"
placeholder="XXX"/> placeholder="XXX"/>
<a href="http://en.wikipedia.org/wiki/Card_Verification_Code" target="_blank">What is this?</a> <a href="http://en.wikipedia.org/wiki/Card_Verification_Code" target="_blank">What is this?</a>
</div> </div>
</div> </div>
<div class="form-row control-group"> <div class="form-row control-group">
<label class="control-label">Expiration</label> <label class="control-label">Expiration</label>
<div class="controls"> <div class="controls">
<input type="text" size="2" style="width:40px" data-stripe="exp-month" <input type="text" size="2" style="width:40px" data-stripe="exp-month"
placeholder="MM"/> placeholder="MM"/>
/ /
<input type="text" size="4" style="width:80px" data-stripe="exp-year" <input type="text" size="4" style="width:80px" data-stripe="exp-year"
placeholder="YYYY"/> placeholder="YYYY"/>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<div class="controls"> <div class="controls">
-1
View File
@@ -1,4 +1,3 @@
""" """
Developed by Massimo Di Pierro Developed by Massimo Di Pierro
Released under the web2py license (LGPL) Released under the web2py license (LGPL)
+2 -2
View File
@@ -74,9 +74,9 @@ https is possible too using 'https://127.0.0.1:8888' instead of 'http://127.0.0.
be started with be started with
python gluon/contrib/websocket_messaging.py -k mykey -p 8888 -s keyfile.pem -c certfile.pem python gluon/contrib/websocket_messaging.py -k mykey -p 8888 -s keyfile.pem -c certfile.pem
for secure websocket do: for secure websocket do:
web2py_websocket('wss://127.0.0.1:8888/realtime/mygroup',callback) web2py_websocket('wss://127.0.0.1:8888/realtime/mygroup',callback)
Acknowledgements: Acknowledgements:
+1 -1
View File
@@ -41,7 +41,7 @@ class CustomImportException(ImportError):
def custom_importer(name, globals=None, locals=None, fromlist=None, level=-1): def custom_importer(name, globals=None, locals=None, fromlist=None, level=-1):
""" """
web2py's custom importer. It behaves like the standard Python importer but web2py's custom importer. It behaves like the standard Python importer but
it tries to transform import statements as something like it tries to transform import statements as something like
"import applications.app_name.modules.x". "import applications.app_name.modules.x".
If the import fails, it falls back on naive_importer If the import fails, it falls back on naive_importer
+4 -4
View File
@@ -94,7 +94,7 @@ def parse_version(version):
return version_tuple return version_tuple
def read_file(filename, mode='r'): def read_file(filename, mode='r'):
"""Returns content from filename, making sure to close the file explicitly """Returns content from filename, making sure to close the file explicitly
on exit. on exit.
""" """
f = open(filename, mode) f = open(filename, mode)
@@ -105,7 +105,7 @@ def read_file(filename, mode='r'):
def write_file(filename, value, mode='w'): def write_file(filename, value, mode='w'):
"""Writes <value> to filename, making sure to close the file """Writes <value> to filename, making sure to close the file
explicitly on exit. explicitly on exit.
""" """
f = open(filename, mode) f = open(filename, mode)
@@ -346,7 +346,7 @@ def get_session(request, other_application='admin'):
session_filename = os.path.join( session_filename = os.path.join(
up(request.folder), other_application, 'sessions', session_id) up(request.folder), other_application, 'sessions', session_id)
if not os.path.exists(session_filename): if not os.path.exists(session_filename):
session_filename = generate(session_filename) session_filename = generate(session_filename)
osession = storage.load_storage(session_filename) osession = storage.load_storage(session_filename)
except Exception, e: except Exception, e:
osession = storage.Storage() osession = storage.Storage()
@@ -438,7 +438,7 @@ from settings import global_settings # we need to import settings here because
def abspath(*relpath, **base): def abspath(*relpath, **base):
"""Converts relative path to absolute path based (by default) on """Converts relative path to absolute path based (by default) on
applications_parent applications_parent
""" """
path = os.path.join(*relpath) path = os.path.join(*relpath)
+3 -1
View File
@@ -550,7 +550,7 @@ class Response(Storage):
else: else:
attname = filename attname = filename
headers["Content-Disposition"] = \ headers["Content-Disposition"] = \
"attachment;filename=%s" % attname 'attachment;filename="%s"' % attname
if not request: if not request:
request = current.request request = current.request
@@ -630,6 +630,8 @@ class Response(Storage):
return self.stream(stream, chunk_size=chunk_size, request=request) return self.stream(stream, chunk_size=chunk_size, request=request)
def json(self, data, default=None): def json(self, data, default=None):
if 'Content-Type' not in self.headers:
self.headers['Content-Type'] = 'application/json'
return json(data, default=default or custom_json) return json(data, default=default or custom_json)
def xmlrpc(self, request, methods): def xmlrpc(self, request, methods):
+2 -2
View File
@@ -850,7 +850,7 @@ class DIV(XmlComponent):
""" """
components = [] components = []
for c in self.components: for c in self.components:
if isinstance(c, allowed_parents): if isinstance(c, (allowed_parents,CAT)):
pass pass
elif wrap_lambda: elif wrap_lambda:
c = wrap_lambda(c) c = wrap_lambda(c)
@@ -1864,7 +1864,7 @@ class INPUT(DIV):
break break
if not name in self.errors: if not name in self.errors:
self.vars[name] = value self.vars[name] = value
return True return True
return False return False
def _postprocessing(self): def _postprocessing(self):
+63 -63
View File
@@ -1,63 +1,63 @@
import os, uuid import os, uuid
def generate(filename, depth=2, base=512): def generate(filename, depth=2, base=512):
if os.path.sep in filename: if os.path.sep in filename:
path, filename = os.path.split(filename) path, filename = os.path.split(filename)
else: else:
path = None path = None
dummyhash = sum(ord(c)*256**(i % 4) for i,c in enumerate(filename)) % base**depth dummyhash = sum(ord(c)*256**(i % 4) for i,c in enumerate(filename)) % base**depth
folders = [] folders = []
for level in range(depth-1,-1,-1): for level in range(depth-1,-1,-1):
code, dummyhash = divmod(dummyhash, base**level) code, dummyhash = divmod(dummyhash, base**level)
folders.append("%03x" % code) folders.append("%03x" % code)
folders.append(filename) folders.append(filename)
if path: if path:
folders.insert(0,path) folders.insert(0,path)
return os.path.join(*folders) return os.path.join(*folders)
def exists(filename, path=None): def exists(filename, path=None):
if os.path.exists(filename): if os.path.exists(filename):
return True return True
if path is None: if path is None:
path, filename = os.path.split(filename) path, filename = os.path.split(filename)
fullfilename = os.path.join(path, generate(filename)) fullfilename = os.path.join(path, generate(filename))
if os.path.exists(fullfilename): if os.path.exists(fullfilename):
return True return True
return False return False
def remove(filename, path=None): def remove(filename, path=None):
if os.path.exists(filename): if os.path.exists(filename):
return os.unlink(filename) return os.unlink(filename)
if path is None: if path is None:
path, filename = os.path.split(filename) path, filename = os.path.split(filename)
fullfilename = os.path.join(path, generate(filename)) fullfilename = os.path.join(path, generate(filename))
if os.path.exists(fullfilename): if os.path.exists(fullfilename):
return os.unlink(fullfilename) return os.unlink(fullfilename)
raise IOError raise IOError
def open(filename, mode="r", path=None): def open(filename, mode="r", path=None):
if not path: if not path:
path, filename = os.path.split(filename) path, filename = os.path.split(filename)
fullfilename = None fullfilename = None
if not mode.startswith('w'): if not mode.startswith('w'):
fullfilename = os.path.join(path, filename) fullfilename = os.path.join(path, filename)
if not os.path.exists(fullfilename): if not os.path.exists(fullfilename):
fullfilename = None fullfilename = None
if not fullfilename: if not fullfilename:
fullfilename = os.path.join(path, generate(filename)) fullfilename = os.path.join(path, generate(filename))
if mode.startswith('w') and not os.path.exists(os.path.dirname(fullfilename)): if mode.startswith('w') and not os.path.exists(os.path.dirname(fullfilename)):
os.makedirs(os.path.dirname(fullfilename)) os.makedirs(os.path.dirname(fullfilename))
return file(fullfilename, mode) return file(fullfilename, mode)
def test(): def test():
if not os.path.exists('tests'): if not os.path.exists('tests'):
os.mkdir('tests') os.mkdir('tests')
for k in range(20): for k in range(20):
filename = os.path.join('tests',str(uuid.uuid4())+'.test') filename = os.path.join('tests',str(uuid.uuid4())+'.test')
open(filename, "w").write('test') open(filename, "w").write('test')
assert open(filename, "r").read()=='test' assert open(filename, "r").read()=='test'
if exists(filename): if exists(filename):
remove(filename) remove(filename)
if __name__ == '__main__': if __name__ == '__main__':
test() test()
+2 -1
View File
@@ -878,6 +878,7 @@ class MapUrlIn(object):
self.domain_application = None self.domain_application = None
self.domain_controller = None self.domain_controller = None
self.domain_function = None self.domain_function = None
self.map_hyphen = base.map_hyphen
arg0 = self.harg0 arg0 = self.harg0
if not base.exclusive_domain and base.applications and arg0 in base.applications: if not base.exclusive_domain and base.applications and arg0 in base.applications:
self.application = arg0 self.application = arg0
@@ -1256,9 +1257,9 @@ class MapUrlOut(object):
"Builds a/c/f from components" "Builds a/c/f from components"
acf = '' acf = ''
if self.map_hyphen: if self.map_hyphen:
self.application = self.application.replace('_', '-')
self.controller = self.controller.replace('_', '-') self.controller = self.controller.replace('_', '-')
if self.controller != 'static' and not self.controller.startswith('static/'): if self.controller != 'static' and not self.controller.startswith('static/'):
self.application = self.application.replace('_', '-')
self.function = self.function.replace('_', '-') self.function = self.function.replace('_', '-')
if not self.omit_application: if not self.omit_application:
acf += '/' + self.application acf += '/' + self.application
+5 -4
View File
@@ -1850,13 +1850,14 @@ class WSGIWorker(Worker):
if data: if data:
self.write(data, sections) self.write(data, sections)
if self.chunked: if not self.headers_sent:
# If chunked, send our final chunk length
self.conn.sendall(b('0\r\n\r\n'))
elif not self.headers_sent:
# Send headers if the body was empty # Send headers if the body was empty
self.send_headers('', sections) self.send_headers('', sections)
if self.chunked and self.request_method != 'HEAD':
# If chunked, send our final chunk length
self.conn.sendall(b('0\r\n\r\n'))
# Don't capture exceptions here. The Worker class handles # Don't capture exceptions here. The Worker class handles
# them appropriately. # them appropriately.
finally: finally:
+34 -20
View File
@@ -87,11 +87,17 @@ if 'WEB2PY_PATH' not in os.environ:
os.environ['WEB2PY_PATH'] = path os.environ['WEB2PY_PATH'] = path
try: try:
from gluon.contrib.simplejson import loads, dumps # try external module
except:
from simplejson import loads, dumps from simplejson import loads, dumps
except ImportError:
try:
# try stdlib (Python >= 2.6)
from json import loads, dumps
except:
# fallback to pure-Python module
from gluon.contrib.simplejson import loads, dumps
IDENTIFIER = "%s#%s" % (socket.gethostname(),os.getpid()) IDENTIFIER = "%s#%s" % (socket.gethostname(), os.getpid())
logger = logging.getLogger('web2py.scheduler.%s' % IDENTIFIER) logger = logging.getLogger('web2py.scheduler.%s' % IDENTIFIER)
@@ -160,6 +166,7 @@ class TaskReport(object):
def __str__(self): def __str__(self):
return '<TaskReport: %s>' % self.status return '<TaskReport: %s>' % self.status
class JobGraph(object): class JobGraph(object):
"""Experimental: with JobGraph you can specify """Experimental: with JobGraph you can specify
dependencies amongs tasks""" dependencies amongs tasks"""
@@ -170,7 +177,9 @@ class JobGraph(object):
def add_deps(self, task_parent, task_child): def add_deps(self, task_parent, task_child):
"""Creates a dependency between task_parent and task_child""" """Creates a dependency between task_parent and task_child"""
self.db.scheduler_task_deps.insert(task_parent=task_parent, task_child=task_child, job_name=self.job_name) self.db.scheduler_task_deps.insert(task_parent=task_parent,
task_child=task_child,
job_name=self.job_name)
def validate(self, job_name): def validate(self, job_name):
"""Validates if all tasks job_name can be completed, i.e. there """Validates if all tasks job_name can be completed, i.e. there
@@ -195,16 +204,18 @@ class JobGraph(object):
try: try:
rtn = [] rtn = []
for k, v in nested_dict.items(): for k, v in nested_dict.items():
v.discard(k) # Ignore self dependencies v.discard(k) # Ignore self dependencies
extra_items_in_deps = reduce(set.union, nested_dict.values()) - set(nested_dict.keys()) extra_items_in_deps = reduce(set.union, nested_dict.values()) - set(nested_dict.keys())
nested_dict.update(dict((item, set()) for item in extra_items_in_deps)) nested_dict.update(dict((item, set()) for item in extra_items_in_deps))
while True: while True:
ordered = set(item for item,dep in nested_dict.items() if not dep) ordered = set(item for item, dep in nested_dict.items() if not dep)
if not ordered: if not ordered:
break break
rtn.append(ordered) rtn.append(ordered)
nested_dict = dict((item, (dep - ordered)) for item, dep in nested_dict.items() nested_dict = dict(
if item not in ordered) (item, (dep - ordered)) for item, dep in nested_dict.items()
if item not in ordered
)
assert not nested_dict, "A cyclic dependency exists amongst %r" % nested_dict assert not nested_dict, "A cyclic dependency exists amongst %r" % nested_dict
db.commit() db.commit()
return rtn return rtn
@@ -212,6 +223,7 @@ class JobGraph(object):
db.rollback() db.rollback()
return None return None
def demo_function(*argv, **kwargs): def demo_function(*argv, **kwargs):
""" test function """ """ test function """
for i in range(argv[0]): for i in range(argv[0]):
@@ -268,7 +280,7 @@ def executor(queue, task, out):
def write(self, data): def write(self, data):
self.out_queue.put(data) self.out_queue.put(data)
W2P_TASK = Storage({'id' : task.task_id, 'uuid' : task.uuid}) W2P_TASK = Storage({'id': task.task_id, 'uuid': task.uuid})
stdout = LogOutput(out) stdout = LogOutput(out)
try: try:
if task.app: if task.app:
@@ -293,7 +305,7 @@ def executor(queue, task, out):
raise NameError( raise NameError(
"name '%s' not found in scheduler's environment" % f) "name '%s' not found in scheduler's environment" % f)
#Inject W2P_TASK into environment #Inject W2P_TASK into environment
_env.update({'W2P_TASK' : W2P_TASK}) _env.update({'W2P_TASK': W2P_TASK})
#Inject W2P_TASK into current #Inject W2P_TASK into current
from gluon import current from gluon import current
current.W2P_TASK = W2P_TASK current.W2P_TASK = W2P_TASK
@@ -357,8 +369,7 @@ class MetaScheduler(threading.Thread):
start = time.time() start = time.time()
while p.is_alive() and ( while p.is_alive() and (not task.timeout or time.time() - start < task.timeout):
not task.timeout or time.time() - start < task.timeout):
if tout: if tout:
try: try:
logger.debug(' partial output saved') logger.debug(' partial output saved')
@@ -568,7 +579,7 @@ class Scheduler(MetaScheduler):
queue=0, queue=0,
distribution=None, distribution=None,
workers=0) workers=0)
) #dict holding statistics ) # dict holding statistics
from gluon import current from gluon import current
current._scheduler = self current._scheduler = self
@@ -740,7 +751,7 @@ class Scheduler(MetaScheduler):
contention and retries `assign_task` after 0.5 seconds contention and retries `assign_task` after 0.5 seconds
""" """
logger.debug('Assigning tasks...') logger.debug('Assigning tasks...')
db.commit() #db.commit() only for Mysql db.commit() # db.commit() only for Mysql
x = 0 x = 0
while x < 10: while x < 10:
try: try:
@@ -761,7 +772,7 @@ class Scheduler(MetaScheduler):
contention and retries `pop_task` after 0.5 seconds contention and retries `pop_task` after 0.5 seconds
""" """
db = self.db db = self.db
db.commit() #another nifty db.commit() only for Mysql db.commit() # another nifty db.commit() only for Mysql
x = 0 x = 0
while x < 10: while x < 10:
try: try:
@@ -1077,6 +1088,8 @@ class Scheduler(MetaScheduler):
#build workers as dict of groups #build workers as dict of groups
wkgroups = {} wkgroups = {}
for w in all_workers: for w in all_workers:
if w.worker_stats['status'] == 'RUNNING':
continue
group_names = w.group_names group_names = w.group_names
for gname in group_names: for gname in group_names:
if gname not in wkgroups: if gname not in wkgroups:
@@ -1090,8 +1103,9 @@ class Scheduler(MetaScheduler):
db( db(
(st.status.belongs((QUEUED, ASSIGNED))) & (st.status.belongs((QUEUED, ASSIGNED))) &
(st.stop_time < now) (st.stop_time < now)
).update(status=EXPIRED) ).update(status=EXPIRED)
#calculate dependencies
deps_with_no_deps = db( deps_with_no_deps = db(
(sd.can_visit == False) & (sd.can_visit == False) &
(~sd.task_child.belongs( (~sd.task_child.belongs(
@@ -1163,7 +1177,7 @@ class Scheduler(MetaScheduler):
if not task.task_name: if not task.task_name:
d['task_name'] = task.function_name d['task_name'] = task.function_name
db( db(
(st.id==task.id) & (st.id == task.id) &
(st.status.belongs((QUEUED, ASSIGNED))) (st.status.belongs((QUEUED, ASSIGNED)))
).update(**d) ).update(**d)
wkgroups[gname]['workers'][myw]['c'] += 1 wkgroups[gname]['workers'][myw]['c'] += 1
@@ -1207,8 +1221,8 @@ class Scheduler(MetaScheduler):
else: else:
for group in group_names: for group in group_names:
workers = self.db( workers = self.db(
(ws.group_names.contains(group)) & (ws.group_names.contains(group)) &
(~ws.status.belongs(exclusion)) (~ws.status.belongs(exclusion))
)._select(ws.id, limitby=(0,limit)) )._select(ws.id, limitby=(0,limit))
self.db(ws.id.belongs(workers)).update(status=action) self.db(ws.id.belongs(workers)).update(status=action)
@@ -1339,7 +1353,7 @@ class Scheduler(MetaScheduler):
**dict(orderby=orderby, **dict(orderby=orderby,
left=left, left=left,
limitby=(0, 1)) limitby=(0, 1))
).first() ).first()
if row and output: if row and output:
row.result = row.scheduler_run.run_result and \ row.result = row.scheduler_run.run_result and \
loads(row.scheduler_run.run_result, loads(row.scheduler_run.run_result,
+2
View File
@@ -100,6 +100,8 @@ def custom_json(o):
return str(o) return str(o)
elif isinstance(o, XmlComponent): elif isinstance(o, XmlComponent):
return str(o) return str(o)
elif isinstance(o, set):
return list(o)
elif hasattr(o, 'as_list') and callable(o.as_list): elif hasattr(o, 'as_list') and callable(o.as_list):
return o.as_list() return o.as_list()
elif hasattr(o, 'as_dict') and callable(o.as_dict): elif hasattr(o, 'as_dict') and callable(o.as_dict):
+15 -5
View File
@@ -1988,9 +1988,9 @@ class SQLFORM(FORM):
buttonback='icon leftarrow icon-arrow-left glyphicon glyphicon-arrow-left', buttonback='icon leftarrow icon-arrow-left glyphicon glyphicon-arrow-left',
buttonexport='icon downarrow icon-download glyphicon glyphicon-download', buttonexport='icon downarrow icon-download glyphicon glyphicon-download',
buttondelete='icon trash icon-trash glyphicon glyphicon-trash', buttondelete='icon trash icon-trash glyphicon glyphicon-trash',
buttonedit='icon pen icon-pencil glyphicon glyphicon-arrow-pencil', buttonedit='icon pen icon-pencil glyphicon glyphicon-pencil',
buttontable='icon rightarrow icon-arrow-right glyphicon glyphicon-arrow-right', buttontable='icon rightarrow icon-arrow-right glyphicon glyphicon-arrow-right',
buttonview='icon magnifier icon-zoom-in glyphicon glyphicon-arrow-zoom-in', buttonview='icon magnifier icon-zoom-in glyphicon glyphicon-zoom-in',
) )
elif not isinstance(ui, dict): elif not isinstance(ui, dict):
raise RuntimeError('SQLFORM.grid ui argument must be a dictionary') raise RuntimeError('SQLFORM.grid ui argument must be a dictionary')
@@ -2333,8 +2333,12 @@ class SQLFORM(FORM):
#fields but not virtual fields #fields but not virtual fields
sfields = reduce(lambda a, b: a + b, sfields = reduce(lambda a, b: a + b,
[[f for f in t if f.readable and not isinstance(f, Field.Virtual)] for t in tables]) [[f for f in t if f.readable and not isinstance(f, Field.Virtual)] for t in tables])
dbset = dbset(SQLFORM.build_query( #use custom_query using searchable
sfields, keywords)) if callable(searchable):
dbset = dbset(searchable(sfields, keywords))
else:
dbset = dbset(SQLFORM.build_query(
sfields, keywords))
rows = dbset.select(left=left, orderby=orderby, rows = dbset.select(left=left, orderby=orderby,
cacheable=True, *selectable_columns) cacheable=True, *selectable_columns)
except Exception, e: except Exception, e:
@@ -2349,7 +2353,9 @@ class SQLFORM(FORM):
# expcolumns is all cols to be exported including virtual fields # expcolumns is all cols to be exported including virtual fields
rows.colnames = expcolumns rows.colnames = expcolumns
oExp = clazz(rows) oExp = clazz(rows)
filename = '.'.join(('rows', oExp.file_ext)) export_filename = \
request.vars.get('_export_filename') or 'rows'
filename = '.'.join((export_filename, oExp.file_ext))
response.headers['Content-Type'] = oExp.content_type response.headers['Content-Type'] = oExp.content_type
response.headers['Content-Disposition'] = \ response.headers['Content-Disposition'] = \
'attachment;filename=' + filename + ';' 'attachment;filename=' + filename + ';'
@@ -2386,6 +2392,8 @@ class SQLFORM(FORM):
spanel_id = '%s_query_fields' % prefix spanel_id = '%s_query_fields' % prefix
sfields_id = '%s_query_panel' % prefix sfields_id = '%s_query_panel' % prefix
skeywords_id = '%s_keywords' % prefix skeywords_id = '%s_keywords' % prefix
## hidden fields to presever keywords in url after the submit
hidden_fields = [INPUT(_type='hidden', _value=value, _name=key) for key, value in request.get_vars.items() if key not in ['keywords', 'page']]
search_widget = lambda sfield, url: CAT(FORM( search_widget = lambda sfield, url: CAT(FORM(
INPUT(_name='keywords', _value=keywords, INPUT(_name='keywords', _value=keywords,
_id=skeywords_id,_class='form-control', _id=skeywords_id,_class='form-control',
@@ -2394,7 +2402,9 @@ class SQLFORM(FORM):
INPUT(_type='submit', _value=T('Search'), _class="btn btn-default"), INPUT(_type='submit', _value=T('Search'), _class="btn btn-default"),
INPUT(_type='submit', _value=T('Clear'), _class="btn btn-default", INPUT(_type='submit', _value=T('Clear'), _class="btn btn-default",
_onclick="jQuery('#%s').val('');" % skeywords_id), _onclick="jQuery('#%s').val('');" % skeywords_id),
*hidden_fields,
_method="GET", _action=url), search_menu) _method="GET", _action=url), search_menu)
# TODO vars from the url should be removed, they are not used by the submit
form = search_widget and search_widget(sfields, url()) or '' form = search_widget and search_widget(sfields, url()) or ''
console.append(add) console.append(add)
console.append(form) console.append(form)
+1 -1
View File
@@ -195,7 +195,7 @@ class Messages(Settings):
def __getattr__(self, key): def __getattr__(self, key):
value = self[key] value = self[key]
if isinstance(value, str): if isinstance(value, str):
return str(self.T(value)) return self.T(value)
return value return value
class FastStorage(dict): class FastStorage(dict):
+1 -1
View File
@@ -279,7 +279,7 @@ class TemplateParser(object):
self.context = context self.context = context
# allow optional alternative delimiters # allow optional alternative delimiters
if delimiters != self.default_delimiters: if delimiters != self.default_delimiters:
escaped_delimiters = (escape(delimiters[0]), escaped_delimiters = (escape(delimiters[0]),
escape(delimiters[1])) escape(delimiters[1]))
+1
View File
@@ -17,6 +17,7 @@ from test_utils import *
from test_contribs import * from test_contribs import *
from test_web import * from test_web import *
from test_dal import * from test_dal import *
from test_tools import *
if sys.version[:3] == '2.7': if sys.version[:3] == '2.7':
from test_old_doctests import * from test_old_doctests import *
+1 -1
View File
@@ -27,4 +27,4 @@ def fix_sys_path(current_path):
os.path.abspath(os.path.join(path, 'site-packages')), os.path.abspath(os.path.join(path, 'site-packages')),
os.path.abspath(os.path.join(path, 'gluon')), os.path.abspath(os.path.join(path, 'gluon')),
''] '']
[add_path_first(path) for path in paths] [add_path_first(path) for path in paths]
+8 -4
View File
@@ -37,7 +37,6 @@ class TestCache(unittest.TestCase):
def testCacheInRam(self): def testCacheInRam(self):
# defaults to mode='http' # defaults to mode='http'
cache = CacheInRam() cache = CacheInRam()
self.assertEqual(cache('a', lambda: 1, 0), 1) self.assertEqual(cache('a', lambda: 1, 0), 1)
self.assertEqual(cache('a', lambda: 2, 100), 1) self.assertEqual(cache('a', lambda: 2, 100), 1)
@@ -66,7 +65,6 @@ class TestCache(unittest.TestCase):
def testCacheOnDisk(self): def testCacheOnDisk(self):
# defaults to mode='http' # defaults to mode='http'
s = Storage({'application': 'admin', s = Storage({'application': 'admin',
'folder': 'applications/admin'}) 'folder': 'applications/admin'})
cache = CacheOnDisk(s) cache = CacheOnDisk(s)
@@ -102,8 +100,14 @@ class TestCache(unittest.TestCase):
self.assertEqual(prefix('a', lambda: 2, 100), 1) self.assertEqual(prefix('a', lambda: 2, 100), 1)
self.assertEqual(cache.ram('prefixa', lambda: 2, 100), 1) self.assertEqual(cache.ram('prefixa', lambda: 2, 100), 1)
def testRegex(self):
cache = CacheInRam()
self.assertEqual(cache('a1', lambda: 1, 0), 1)
self.assertEqual(cache('a2', lambda: 2, 100), 2)
cache.clear(regex=r'a*')
self.assertEqual(cache('a1', lambda: 2, 0), 2)
self.assertEqual(cache('a2', lambda: 3, 100), 3)
return
if __name__ == '__main__': if __name__ == '__main__':
setUpModule() # pre-python-2.7 setUpModule() # pre-python-2.7
+35 -3
View File
@@ -4,14 +4,24 @@
""" Unit tests for contribs """ """ Unit tests for contribs """
import unittest import unittest
import os
from fix_path import fix_sys_path from fix_path import fix_sys_path
fix_sys_path(__file__) fix_sys_path(__file__)
from gluon.storage import Storage
import gluon.contrib.fpdf as fpdf
import gluon.contrib.pyfpdf as pyfpdf
from gluon.contrib.appconfig import AppConfig
from utils import md5_hash
import contrib.fpdf as fpdf def setUpModule():
import contrib.pyfpdf as pyfpdf pass
def tearDownModule():
if os.path.isfile('appconfig.json'):
os.unlink('appconfig.json')
class TestContribs(unittest.TestCase): class TestContribs(unittest.TestCase):
@@ -35,6 +45,28 @@ class TestContribs(unittest.TestCase):
self.assertTrue(fpdf.FPDF_VERSION in pdf_out, 'version string') self.assertTrue(fpdf.FPDF_VERSION in pdf_out, 'version string')
self.assertTrue('hello world' in pdf_out, 'sample message') self.assertTrue('hello world' in pdf_out, 'sample message')
def test_appconfig(self):
"""
Test for the appconfig module
"""
from gluon import current
s = Storage({'application': 'admin',
'folder': 'applications/admin'})
current.request = s
simple_config = '{"config1" : "abc", "config2" : "bcd", "config3" : { "key1" : 1, "key2" : 2} }'
with open('appconfig.json', 'w') as g:
g.write(simple_config)
myappconfig = AppConfig('appconfig.json')
self.assertEqual(myappconfig['config1'], 'abc')
self.assertEqual(myappconfig['config2'], 'bcd')
self.assertEqual(myappconfig.take('config1'), 'abc')
self.assertEqual(myappconfig.take('config3.key1', cast=str), '1')
# once parsed, can't be casted to other types
self.assertEqual(myappconfig.take('config3.key1', cast=int), '1')
self.assertEqual(myappconfig.take('config3.key2'), 2)
current.request = {}
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
+22 -22
View File
@@ -131,7 +131,7 @@ class TestRouter(unittest.TestCase):
'http://domain.com/abc/def'), "/init/default/abc ['def']") 'http://domain.com/abc/def'), "/init/default/abc ['def']")
self.assertEqual(filter_url( self.assertEqual(filter_url(
'http://domain.com/index/a%20bc'), "/init/default/index ['a bc']") 'http://domain.com/index/a%20bc'), "/init/default/index ['a bc']")
self.assertEqual(filter_url('http://domain.com/welcome/static/path/to/static').replace('/', os.sep), self.assertEqual(filter_url('http://domain.com/welcome/static/path/to/static').replace('/', os.sep),
norm_root("%s/applications/welcome/static/path/to/static" % root)) norm_root("%s/applications/welcome/static/path/to/static" % root))
self.assertRaises(HTTP, filter_url, 'http://domain.com/welcome/static/bad/path/to/st~tic') self.assertRaises(HTTP, filter_url, 'http://domain.com/welcome/static/bad/path/to/st~tic')
try: try:
@@ -195,7 +195,7 @@ class TestRouter(unittest.TestCase):
norm_root('%s/applications/welcome/static/favicon.ico' % root)) norm_root('%s/applications/welcome/static/favicon.ico' % root))
self.assertEqual(filter_url('http://domain.com/static/abc'), self.assertEqual(filter_url('http://domain.com/static/abc'),
norm_root('%s/applications/welcome/static/abc' % root)) norm_root('%s/applications/welcome/static/abc' % root))
self.assertEqual(filter_url('http://domain.com/static/path/to/static').replace('/', os.sep), self.assertEqual(filter_url('http://domain.com/static/path/to/static').replace('/', os.sep),
norm_root("%s/applications/welcome/static/path/to/static" % root)) norm_root("%s/applications/welcome/static/path/to/static" % root))
# outgoing # outgoing
self.assertEqual(filter_url( self.assertEqual(filter_url(
@@ -1086,13 +1086,13 @@ class TestRouter(unittest.TestCase):
norm_root("%s/applications/admin/static/file" % root)) norm_root("%s/applications/admin/static/file" % root))
self.assertEqual(filter_url('http://domain.com/en/static/file'), self.assertEqual(filter_url('http://domain.com/en/static/file'),
norm_root("%s/applications/admin/static/file" % root)) norm_root("%s/applications/admin/static/file" % root))
self.assertEqual(filter_url('http://domain.com/examples/en/static/file'), self.assertEqual(filter_url('http://domain.com/examples/en/static/file'),
norm_root("%s/applications/examples/static/en/file" % root)) norm_root("%s/applications/examples/static/en/file" % root))
self.assertEqual(filter_url('http://domain.com/examples/static/file'), self.assertEqual(filter_url('http://domain.com/examples/static/file'),
norm_root("%s/applications/examples/static/en/file" % root)) norm_root("%s/applications/examples/static/en/file" % root))
self.assertEqual(filter_url('http://domain.com/examples/it/static/file'), self.assertEqual(filter_url('http://domain.com/examples/it/static/file'),
norm_root("%s/applications/examples/static/it/file" % root)) norm_root("%s/applications/examples/static/it/file" % root))
self.assertEqual(filter_url('http://domain.com/examples/it-it/static/file'), self.assertEqual(filter_url('http://domain.com/examples/it-it/static/file'),
norm_root("%s/applications/examples/static/file" % root)) norm_root("%s/applications/examples/static/file" % root))
self.assertEqual(filter_url('https://domain.com/admin/ctr/fcn', self.assertEqual(filter_url('https://domain.com/admin/ctr/fcn',
@@ -1188,19 +1188,19 @@ class TestRouter(unittest.TestCase):
norm_root("%s/applications/admin/static/file" % root)) norm_root("%s/applications/admin/static/file" % root))
self.assertEqual(filter_url('http://domain.com/en/static/file'), self.assertEqual(filter_url('http://domain.com/en/static/file'),
norm_root("%s/applications/admin/static/file" % root)) norm_root("%s/applications/admin/static/file" % root))
self.assertEqual(filter_url('http://domain.com/examples/en/static/file'), self.assertEqual(filter_url('http://domain.com/examples/en/static/file'),
norm_root("%s/applications/examples/static/en/file" % root)) norm_root("%s/applications/examples/static/en/file" % root))
self.assertEqual(filter_url('http://domain.com/examples/static/file'), self.assertEqual(filter_url('http://domain.com/examples/static/file'),
norm_root("%s/applications/examples/static/en/file" % root)) norm_root("%s/applications/examples/static/en/file" % root))
self.assertEqual(filter_url('http://domain.com/examples/it/static/file'), self.assertEqual(filter_url('http://domain.com/examples/it/static/file'),
norm_root("%s/applications/examples/static/it/file" % root)) norm_root("%s/applications/examples/static/it/file" % root))
self.assertEqual(filter_url('http://domain.com/examples/it-it/static/file'), self.assertEqual(filter_url('http://domain.com/examples/it-it/static/file'),
norm_root("%s/applications/examples/static/file" % root)) norm_root("%s/applications/examples/static/file" % root))
self.assertEqual(filter_url('http://domain.com/examples/static/en/file').replace('/', os.sep), self.assertEqual(filter_url('http://domain.com/examples/static/en/file').replace('/', os.sep),
norm_root("%s/applications/examples/static/en/file" % root)) norm_root("%s/applications/examples/static/en/file" % root))
self.assertEqual(filter_url('http://domain.com/examples/static/it/file').replace('/', os.sep), self.assertEqual(filter_url('http://domain.com/examples/static/it/file').replace('/', os.sep),
norm_root("%s/applications/examples/static/it/file" % root)) norm_root("%s/applications/examples/static/it/file" % root))
self.assertEqual(filter_url('http://domain.com/examples/static/it-it/file').replace('/', os.sep), self.assertEqual(filter_url('http://domain.com/examples/static/it-it/file').replace('/', os.sep),
norm_root("%s/applications/examples/static/it-it/file" % root)) norm_root("%s/applications/examples/static/it-it/file" % root))
def test_router_get_effective(self): def test_router_get_effective(self):
@@ -1267,14 +1267,14 @@ class TestRouter(unittest.TestCase):
''' '''
load(rdict=dict()) load(rdict=dict())
self.assertEqual(filter_url('http://domain.com/welcome/static/path/to/static').replace('/', os.sep), self.assertEqual(filter_url('http://domain.com/welcome/static/path/to/static').replace('/', os.sep),
norm_root("%s/applications/welcome/static/path/to/static" % root)) norm_root("%s/applications/welcome/static/path/to/static" % root))
self.assertRaises(HTTP, filter_url, 'http://domain.com/welcome/static/bad/path/to/st~tic') self.assertRaises(HTTP, filter_url, 'http://domain.com/welcome/static/bad/path/to/st~tic')
self.assertEqual(filter_url('http://domain.com/welcome/static/path/to--/static').replace('/', os.sep), self.assertEqual(filter_url('http://domain.com/welcome/static/path/to--/static').replace('/', os.sep),
norm_root("%s/applications/welcome/static/path/to--/static" % root)) norm_root("%s/applications/welcome/static/path/to--/static" % root))
self.assertEqual(filter_url('http://domain.com/welcome/static/path/==to--/static').replace('/', os.sep), self.assertEqual(filter_url('http://domain.com/welcome/static/path/==to--/static').replace('/', os.sep),
norm_root("%s/applications/welcome/static/path/==to--/static" % root)) norm_root("%s/applications/welcome/static/path/==to--/static" % root))
self.assertEqual(filter_url('http://domain.com/welcome/static/path/-+=@$%/static').replace('/', os.sep), self.assertEqual(filter_url('http://domain.com/welcome/static/path/-+=@$%/static').replace('/', os.sep),
norm_root("%s/applications/welcome/static/path/-+=@$%%/static" % root)) norm_root("%s/applications/welcome/static/path/-+=@$%%/static" % root))
self.assertRaises(HTTP, filter_url, 'http://domain.com/welcome/static/bad/path/to/.static') self.assertRaises(HTTP, filter_url, 'http://domain.com/welcome/static/bad/path/to/.static')
self.assertRaises(HTTP, filter_url, 'http://domain.com/welcome/static/bad/path/to/s..tatic') self.assertRaises(HTTP, filter_url, 'http://domain.com/welcome/static/bad/path/to/s..tatic')
@@ -1287,7 +1287,7 @@ class TestRouter(unittest.TestCase):
), ),
) )
load(rdict=router_static) load(rdict=router_static)
self.assertEqual(filter_url('http://domain.com/welcome/static/path/to/#static').replace('/', os.sep), self.assertEqual(filter_url('http://domain.com/welcome/static/path/to/#static').replace('/', os.sep),
norm_root("%s/applications/welcome/static/path/to/#static" % root)) norm_root("%s/applications/welcome/static/path/to/#static" % root))
router_static = dict( router_static = dict(
@@ -1296,23 +1296,23 @@ class TestRouter(unittest.TestCase):
), ),
) )
load(rdict=router_static) load(rdict=router_static)
self.assertEqual(filter_url('http://domain.com/welcome/static/path/to/static').replace('/', os.sep), self.assertEqual(filter_url('http://domain.com/welcome/static/path/to/static').replace('/', os.sep),
norm_root("%s/applications/welcome/static/path/to/static" % root)) norm_root("%s/applications/welcome/static/path/to/static" % root))
self.assertRaises(HTTP, filter_url, 'http://domain.com/welcome/static/bad/path/to/st~tic') self.assertRaises(HTTP, filter_url, 'http://domain.com/welcome/static/bad/path/to/st~tic')
self.assertEqual(filter_url('http://domain.com/welcome/static/path/to--/static').replace('/', os.sep), self.assertEqual(filter_url('http://domain.com/welcome/static/path/to--/static').replace('/', os.sep),
norm_root("%s/applications/welcome/static/path/to--/static" % root)) norm_root("%s/applications/welcome/static/path/to--/static" % root))
self.assertEqual(filter_url('http://domain.com/welcome/static/path/==to--/static').replace('/', os.sep), self.assertEqual(filter_url('http://domain.com/welcome/static/path/==to--/static').replace('/', os.sep),
norm_root("%s/applications/welcome/static/path/==to--/static" % root)) norm_root("%s/applications/welcome/static/path/==to--/static" % root))
self.assertEqual(filter_url('http://domain.com/welcome/static/path/-+=@$%/static').replace('/', os.sep), self.assertEqual(filter_url('http://domain.com/welcome/static/path/-+=@$%/static').replace('/', os.sep),
norm_root("%s/applications/welcome/static/path/-+=@$%%/static" % root)) norm_root("%s/applications/welcome/static/path/-+=@$%%/static" % root))
self.assertRaises(HTTP, filter_url, 'http://domain.com/welcome/static/bad/path/to//static') self.assertRaises(HTTP, filter_url, 'http://domain.com/welcome/static/bad/path/to//static')
self.assertEqual(filter_url('http://domain.com/welcome/static/path/to/#static').replace('/', os.sep), self.assertEqual(filter_url('http://domain.com/welcome/static/path/to/#static').replace('/', os.sep),
norm_root("%s/applications/welcome/static/path/to/#static" % root)) norm_root("%s/applications/welcome/static/path/to/#static" % root))
self.assertRaises(HTTP, filter_url, 'http://domain.com/welcome/static/bad/path/./static') self.assertRaises(HTTP, filter_url, 'http://domain.com/welcome/static/bad/path/./static')
self.assertRaises(HTTP, filter_url, 'http://domain.com/welcome/static/bad/path/../static') self.assertRaises(HTTP, filter_url, 'http://domain.com/welcome/static/bad/path/../static')
self.assertEqual(filter_url('http://domain.com/welcome/static/path/.../static').replace('/', os.sep), self.assertEqual(filter_url('http://domain.com/welcome/static/path/.../static').replace('/', os.sep),
norm_root("%s/applications/welcome/static/path/.../static" % root)) norm_root("%s/applications/welcome/static/path/.../static" % root))
self.assertEqual(filter_url('http://domain.com/welcome/static/path/to/.static').replace('/', os.sep), self.assertEqual(filter_url('http://domain.com/welcome/static/path/to/.static').replace('/', os.sep),
norm_root("%s/applications/welcome/static/path/to/.static" % root)) norm_root("%s/applications/welcome/static/path/to/.static" % root))
def test_router_args(self): def test_router_args(self):
+2 -2
View File
@@ -108,7 +108,7 @@ class TestRoutes(unittest.TestCase):
'http://domain.com/abc/def/ghi/jkl'), "/abc/def/ghi ['jkl']") 'http://domain.com/abc/def/ghi/jkl'), "/abc/def/ghi ['jkl']")
self.assertEqual(filter_url( self.assertEqual(filter_url(
'http://domain.com/abc/def/ghi/j%20kl'), "/abc/def/ghi ['j_kl']") 'http://domain.com/abc/def/ghi/j%20kl'), "/abc/def/ghi ['j_kl']")
self.assertEqual(filter_url('http://domain.com/welcome/static/path/to/static'), self.assertEqual(filter_url('http://domain.com/welcome/static/path/to/static'),
norm_root("%s/applications/welcome/static/path/to/static" % root)) norm_root("%s/applications/welcome/static/path/to/static" % root))
# no more necessary since explcit check for directory traversal attacks # no more necessary since explcit check for directory traversal attacks
""" """
@@ -174,7 +174,7 @@ default_application = 'defapp'
self.assertEqual(filter_url('http://domain.com/welcome/default/index/abc'), "/welcome/default/index ['abc']") self.assertEqual(filter_url('http://domain.com/welcome/default/index/abc'), "/welcome/default/index ['abc']")
self.assertEqual(filter_url('http://domain.com/welcome/static/abc'), self.assertEqual(filter_url('http://domain.com/welcome/static/abc'),
norm_root('%s/applications/welcome/static/abc' % root)) norm_root('%s/applications/welcome/static/abc' % root))
self.assertEqual(filter_url('http://domain.com/defapp/static/path/to/static'), self.assertEqual(filter_url('http://domain.com/defapp/static/path/to/static'),
norm_root("%s/applications/defapp/static/path/to/static" % root)) norm_root("%s/applications/defapp/static/path/to/static" % root))
def test_routes_raise(self): def test_routes_raise(self):
+83
View File
@@ -0,0 +1,83 @@
#!/bin/python
# -*- coding: utf-8 -*-
"""
Unit tests for gluon.tools
"""
import os
import sys
if sys.version < "2.7":
import unittest2 as unittest
else:
import unittest
from fix_path import fix_sys_path
fix_sys_path(__file__)
DEFAULT_URI = os.getenv('DB', 'sqlite:memory')
from gluon.dal import DAL, Field
from dal.objects import Table
from tools import Auth
from gluon.globals import Request, Response, Session
from storage import Storage
from languages import translator
from gluon.http import HTTP
python_version = sys.version[:3]
IS_IMAP = "imap" in DEFAULT_URI
@unittest.skipIf(IS_IMAP, "TODO: Imap raises 'Connection refused'")
class testAuth(unittest.TestCase):
def testRun(self):
# setup
request = Request(env={})
request.application = 'a'
request.controller = 'c'
request.function = 'f'
request.folder = 'applications/admin'
response = Response()
session = Session()
T = translator('', 'en')
session.connect(request, response)
from gluon.globals import current
current.request = request
current.response = response
current.session = session
current.T = T
db = DAL(DEFAULT_URI, check_reserved=['all'])
auth = Auth(db)
auth.define_tables(username=True, signature=False)
self.assertTrue('auth_user' in db)
self.assertTrue('auth_group' in db)
self.assertTrue('auth_membership' in db)
self.assertTrue('auth_permission' in db)
self.assertTrue('auth_event' in db)
db.define_table('t0', Field('tt'), auth.signature)
auth.enable_record_versioning(db)
self.assertTrue('t0_archive' in db)
for f in ['login', 'register', 'retrieve_password',
'retrieve_username']:
html_form = getattr(auth, f)().xml()
self.assertTrue('name="_formkey"' in html_form)
for f in ['logout', 'verify_email', 'reset_password',
'change_password', 'profile', 'groups']:
self.assertRaisesRegexp(HTTP, "303*", getattr(auth, f))
self.assertRaisesRegexp(HTTP, "401*", auth.impersonate)
try:
for t in ['t0_archive', 't0', 'auth_cas', 'auth_event',
'auth_membership', 'auth_permission', 'auth_group',
'auth_user']:
db[t].drop()
except SyntaxError as e:
# GAE doesn't support drop
pass
return
if __name__ == '__main__':
unittest.main()
+9 -5
View File
@@ -136,6 +136,7 @@ class Mail(object):
mail.settings.server mail.settings.server
mail.settings.sender mail.settings.sender
mail.settings.login mail.settings.login
mail.settings.timeout = 60 # seconds (default)
When server is 'logging', email is logged but not sent (debug mode) When server is 'logging', email is logged but not sent (debug mode)
@@ -265,6 +266,7 @@ class Mail(object):
settings.sender = sender settings.sender = sender
settings.login = login settings.login = login
settings.tls = tls settings.tls = tls
settings.timeout = 60 # seconds
settings.hostname = None settings.hostname = None
settings.ssl = False settings.ssl = False
settings.cipher_type = None settings.cipher_type = None
@@ -787,10 +789,11 @@ class Mail(object):
subject=subject, body=text, **xcc) subject=subject, body=text, **xcc)
else: else:
smtp_args = self.settings.server.split(':') smtp_args = self.settings.server.split(':')
kwargs = dict(timeout = self.settings.timeout)
if self.settings.ssl: if self.settings.ssl:
server = smtplib.SMTP_SSL(*smtp_args) server = smtplib.SMTP_SSL(*smtp_args, **kwargs)
else: else:
server = smtplib.SMTP(*smtp_args) server = smtplib.SMTP(*smtp_args, **kwargs)
if self.settings.tls and not self.settings.ssl: if self.settings.tls and not self.settings.ssl:
server.ehlo(self.settings.hostname) server.ehlo(self.settings.hostname)
server.starttls() server.starttls()
@@ -842,6 +845,7 @@ class Recaptcha(DIV):
comment = '', comment = '',
ajax=False ajax=False
): ):
request = request or current.request
self.request_vars = request and request.vars or current.request.vars self.request_vars = request and request.vars or current.request.vars
self.remote_addr = request.env.remote_addr self.remote_addr = request.env.remote_addr
self.public_key = public_key self.public_key = public_key
@@ -1257,7 +1261,8 @@ class Auth(object):
def __init__(self, environment=None, db=None, mailer=True, def __init__(self, environment=None, db=None, mailer=True,
hmac_key=None, controller='default', function='user', hmac_key=None, controller='default', function='user',
cas_provider=None, signature=True, secure=False, cas_provider=None, signature=True, secure=False,
csrf_prevention=True, propagate_extension=None): csrf_prevention=True, propagate_extension=None,
url_index=None):
## next two lines for backward compatibility ## next two lines for backward compatibility
if not db and environment and isinstance(environment, DAL): if not db and environment and isinstance(environment, DAL):
@@ -1294,7 +1299,7 @@ class Auth(object):
del session.auth del session.auth
# ## what happens after login? # ## what happens after login?
url_index = URL(controller, 'index') url_index = url_index or URL(controller, 'index')
url_login = URL(controller, function, args='login', url_login = URL(controller, function, args='login',
extension = propagate_extension) extension = propagate_extension)
# ## what happens after registration? # ## what happens after registration?
@@ -6164,4 +6169,3 @@ class Config(object):
if __name__ == '__main__': if __name__ == '__main__':
import doctest import doctest
doctest.testmod() doctest.testmod()
-1
View File
@@ -350,4 +350,3 @@ def getipaddrinfo(host):
and isinstance(addrinfo[4][0], basestring)] and isinstance(addrinfo[4][0], basestring)]
except socket.error: except socket.error:
return [] return []
+8 -9
View File
@@ -39,7 +39,7 @@ def run(options):
if options.ssl_certificate: if options.ssl_certificate:
ssl_args['certfile'] = options.ssl_certificate ssl_args['certfile'] = options.ssl_certificate
server = pywsgi.WSGIServer( server = pywsgi.WSGIServer(
address, application, address, application,
spawn=spawn, log=None, spawn=spawn, log=None,
**ssl_args **ssl_args
) )
@@ -59,7 +59,7 @@ def main():
default='<recycle>', default='<recycle>',
dest='password', dest='password',
help=msg) help=msg)
parser.add_option('-c', parser.add_option('-c',
'--ssl_certificate', '--ssl_certificate',
default='', default='',
@@ -71,32 +71,32 @@ def main():
default='', default='',
dest='ssl_private_key', dest='ssl_private_key',
help='file that contains ssl private key') help='file that contains ssl private key')
parser.add_option('-l', parser.add_option('-l',
'--logging', '--logging',
action='store_true', action='store_true',
default=False, default=False,
dest='logging', dest='logging',
help='log into httpserver.log') help='log into httpserver.log')
parser.add_option('-F', parser.add_option('-F',
'--profiler', '--profiler',
dest='profiler_dir', dest='profiler_dir',
default=None, default=None,
help='profiler dir') help='profiler dir')
parser.add_option('-i', parser.add_option('-i',
'--ip', '--ip',
default='127.0.0.1', default='127.0.0.1',
dest='ip', dest='ip',
help='ip address') help='ip address')
parser.add_option('-p', parser.add_option('-p',
'--port', '--port',
default='8000', default='8000',
dest='port', dest='port',
help='port number') help='port number')
parser.add_option('-w', parser.add_option('-w',
'--workers', '--workers',
default=None, default=None,
@@ -105,9 +105,8 @@ def main():
(options, args) = parser.parse_args() (options, args) = parser.parse_args()
print 'starting on %s:%s...' % ( print 'starting on %s:%s...' % (
options.ip, options.port) options.ip, options.port)
run(options) run(options)
if __name__ == '__main__': if __name__ == '__main__':
main() main()
+10 -10
View File
@@ -62,7 +62,7 @@ class refTable(object):
rowSeparator = headerChar * (len(prefix) +len(postfix) + sum(maxWidths) + rowSeparator = headerChar * (len(prefix) +len(postfix) + sum(maxWidths) +
len(delim) * (len(maxWidths) - 1)) len(delim) * (len(maxWidths) - 1))
justify = {'center': str.center, justify = {'center': str.center,
'right': str.rjust, 'right': str.rjust,
'left': str.ljust 'left': str.ljust
}[justify.lower()] }[justify.lower()]
@@ -85,12 +85,12 @@ class refTable(object):
hasHeader = False hasHeader = False
return output.getvalue() return output.getvalue()
def wrap_onspace(self, text, width): def wrap_onspace(self, text, width):
return reduce(lambda line, word, width=width: '%s%s%s' % ( return reduce(lambda line, word, width=width: '%s%s%s' % (
line, line,
' ' if len(line.rsplit('\n')[-1]+word.split('\n')[0])>=width else '\n', ' ' if len(line.rsplit('\n')[-1]+word.split('\n')[0])>=width else '\n',
word), text.split(' ')) word), text.split(' '))
def wrap_onspace_strict(self, text, width): def wrap_onspace_strict(self, text, width):
wordRegex = re.compile(r'\S{' + str(width) + r',}') wordRegex = re.compile(r'\S{' + str(width) + r',}')
@@ -232,7 +232,7 @@ class console:
fields.append(field.strip()) fields.append(field.strip())
if len(invalidParams) > 0: if len(invalidParams) > 0:
print('the following parameter(s) is not valid\n%s' % print('the following parameter(s) is not valid\n%s' %
','.join(invalidParams)) ','.join(invalidParams))
else: else:
try: try:
@@ -341,10 +341,10 @@ style choices:
print('%s has been created and populated with all available data from table %2\n' % (file, table)) print('%s has been created and populated with all available data from table %2\n' % (file, table))
except Exception, err: except Exception, err:
print("EXCEPTION: could not create table %s\n%s" % (table, err)) print("EXCEPTION: could not create table %s\n%s" % (table, err))
else: else:
print('the following fields are not valid [%s]' % (','.join(filedNotFound))) print('the following fields are not valid [%s]' % (','.join(filedNotFound)))
def cmd_help(self, *args): def cmd_help(self, *args):
'''-3|help|Show's help''' '''-3|help|Show's help'''
@@ -477,7 +477,7 @@ class setCopyDB():
def delete_DB_tables(self, storageFolder, storageType): def delete_DB_tables(self, storageFolder, storageType):
print 'delete_DB_tablesn\n\t%s\n\t%s' % (storageFolder, storageType) print 'delete_DB_tablesn\n\t%s\n\t%s' % (storageFolder, storageType)
dataFiles = [storageType, "sql.log"] dataFiles = [storageType, "sql.log"]
try: try:
for f in os.listdir(storageFolder): for f in os.listdir(storageFolder):
+1 -1
View File
@@ -136,7 +136,7 @@ def define_field(conn, table, field, pks):
else: else:
f['type'] = "'blob'" f['type'] = "'blob'"
f['comment'] = "'WARNING: Oracle Data Type %s was not mapped." % \ f['comment'] = "'WARNING: Oracle Data Type %s was not mapped." % \
str(field['DATA_TYPE']) + " Using 'blob' as fallback.'" str(field['DATA_TYPE']) + " Using 'blob' as fallback.'"
try: try:
if field['COLUMN_DEFAULT']: if field['COLUMN_DEFAULT']:
+5 -5
View File
@@ -30,7 +30,7 @@ def fix_links(html,prefix):
link = "{{=URL('static','%s/%s')}}" % (prefix,link) link = "{{=URL('static','%s/%s')}}" % (prefix,link)
return '%s="%s"' % (href,link) return '%s="%s"' % (href,link)
return regex_link.sub(fix,html) return regex_link.sub(fix,html)
def make_views(html_files,prefix): def make_views(html_files,prefix):
views = {} views = {}
layout_name = os.path.join(prefix,'layout.html') layout_name = os.path.join(prefix,'layout.html')
@@ -76,13 +76,13 @@ def recursive_overwrite(src, dest, ignore=None):
ignored = set() ignored = set()
for f in files: for f in files:
if f not in ignored: if f not in ignored:
recursive_overwrite(os.path.join(src, f), recursive_overwrite(os.path.join(src, f),
os.path.join(dest, f), os.path.join(dest, f),
ignore) ignore)
else: else:
shutil.copyfile(src, dest) shutil.copyfile(src, dest)
def convert(source, destination,prefix='imported'): def convert(source, destination,prefix='imported'):
html_files = glob.glob(os.path.join(source,'*.html')) html_files = glob.glob(os.path.join(source,'*.html'))
static_folder = os.path.join(destination,'static',prefix) static_folder = os.path.join(destination,'static',prefix)
recursive_overwrite(source,static_folder) recursive_overwrite(source,static_folder)
@@ -96,7 +96,7 @@ def convert(source, destination,prefix='imported'):
if not os.path.exists(os.path.split(fullname)[0]): if not os.path.exists(os.path.split(fullname)[0]):
os.makedirs(os.path.split(fullname)[0]) os.makedirs(os.path.split(fullname)[0])
open(fullname,'w').write(views[name]) open(fullname,'w').write(views[name])
convert(sys.argv[1],sys.argv[2]) convert(sys.argv[1],sys.argv[2])
+32 -33
View File
@@ -7,37 +7,37 @@ class LinuxService(ServiceBase):
ServiceBase.__init__(self, name, label, stdout, stderr) ServiceBase.__init__(self, name, label, stdout, stderr)
self.pidfile = '/tmp/%s.pid' % name self.pidfile = '/tmp/%s.pid' % name
self.config_file = '/etc/%s.conf' % name self.config_file = '/etc/%s.conf' % name
def daemonize(self): def daemonize(self):
""" """
do the UNIX double-fork magic, see Stevens' "Advanced do the UNIX double-fork magic, see Stevens' "Advanced
Programming in the UNIX Environment" for details (ISBN 0201563177) Programming in the UNIX Environment" for details (ISBN 0201563177)
http://www.erlenstar.demon.co.uk/unix/faq_2.html#SEC16 http://www.erlenstar.demon.co.uk/unix/faq_2.html#SEC16
""" """
try: try:
pid = os.fork() pid = os.fork()
if pid > 0: if pid > 0:
# exit first parent # exit first parent
sys.exit(0) sys.exit(0)
except OSError, e: except OSError, e:
sys.stderr.write("fork #1 failed: %d (%s)\n" % (e.errno, e.strerror)) sys.stderr.write("fork #1 failed: %d (%s)\n" % (e.errno, e.strerror))
return return
# decouple from parent environment # decouple from parent environment
os.chdir("/") os.chdir("/")
os.setsid() os.setsid()
os.umask(0) os.umask(0)
# do second fork # do second fork
try: try:
pid = os.fork() pid = os.fork()
if pid > 0: if pid > 0:
# exit from second parent # exit from second parent
sys.exit(0) sys.exit(0)
except OSError, e: except OSError, e:
sys.stderr.write("fork #2 failed: %d (%s)\n" % (e.errno, e.strerror)) sys.stderr.write("fork #2 failed: %d (%s)\n" % (e.errno, e.strerror))
return return
# redirect standard file descriptors # redirect standard file descriptors
sys.stdout.flush() sys.stdout.flush()
sys.stderr.flush() sys.stderr.flush()
@@ -47,25 +47,25 @@ class LinuxService(ServiceBase):
os.dup2(si.fileno(), sys.stdin.fileno()) os.dup2(si.fileno(), sys.stdin.fileno())
os.dup2(so.fileno(), sys.stdout.fileno()) os.dup2(so.fileno(), sys.stdout.fileno())
os.dup2(se.fileno(), sys.stderr.fileno()) os.dup2(se.fileno(), sys.stderr.fileno())
def getpid(self): def getpid(self):
# Check for a pidfile to see if the daemon already runs # Check for a pidfile to see if the daemon already runs
try: try:
pf = file(self.pidfile,'r') pf = file(self.pidfile,'r')
pid = int(pf.read().strip()) pid = int(pf.read().strip())
pf.close() pf.close()
except IOError: except IOError:
pid = None pid = None
return pid return pid
def status(self): def status(self):
pid = self.getpid() pid = self.getpid()
if pid: if pid:
return 'Service running with PID %s.' % pid return 'Service running with PID %s.' % pid
else: else:
return 'Service is not running.' return 'Service is not running.'
def check_permissions(self): def check_permissions(self):
if not os.geteuid() == 0: if not os.geteuid() == 0:
return (False, 'This script must be run with root permissions.') return (False, 'This script must be run with root permissions.')
@@ -77,12 +77,12 @@ class LinuxService(ServiceBase):
Start the daemon Start the daemon
""" """
pid = self.getpid() pid = self.getpid()
if pid: if pid:
message = "Service already running under PID %s\n" message = "Service already running under PID %s\n"
sys.stderr.write(message % self.pidfile) sys.stderr.write(message % self.pidfile)
return return
# Start the daemon # Start the daemon
self.daemonize() self.daemonize()
self.run() self.run()
@@ -92,13 +92,13 @@ class LinuxService(ServiceBase):
Stop the daemon Stop the daemon
""" """
pid = self.getpid() pid = self.getpid()
if not pid: if not pid:
message = "Service is not running\n" message = "Service is not running\n"
sys.stderr.write(message) sys.stderr.write(message)
return # not an error in a restart return # not an error in a restart
# Try killing the daemon process # Try killing the daemon process
try: try:
while 1: while 1:
os.kill(pid, SIGTERM) os.kill(pid, SIGTERM)
@@ -118,19 +118,19 @@ class LinuxService(ServiceBase):
""" """
self.stop() self.stop()
self.start() self.start()
def run(self): def run(self):
atexit.register(self.terminate) atexit.register(self.terminate)
args = self.load_configuration()[0] args = self.load_configuration()[0]
stdout = open(self.stdout, 'a+') stdout = open(self.stdout, 'a+')
stderr = open(self.stderr, 'a+') stderr = open(self.stderr, 'a+')
process = subprocess.Popen(args, stdout=stdout, stderr=stderr) process = subprocess.Popen(args, stdout=stdout, stderr=stderr)
file(self.pidfile,'w+').write("%s\n" % process.pid) file(self.pidfile,'w+').write("%s\n" % process.pid)
process.wait() process.wait()
self.terminate() self.terminate()
def terminate(self): def terminate(self):
try: try:
os.remove(self.pidfile) os.remove(self.pidfile)
@@ -152,7 +152,7 @@ class LinuxService(ServiceBase):
install_command = self.get_service_installer_command(env) install_command = self.get_service_installer_command(env)
result = self.run_command(*install_command) result = self.run_command(*install_command)
self.start() self.start()
def uninstall(self): def uninstall(self):
self.stop() self.stop()
env = self.detect_environment() env = self.detect_environment()
@@ -164,7 +164,7 @@ class LinuxService(ServiceBase):
# remove link to the script from the service directory # remove link to the script from the service directory
path = env['rc.d-path'] + self.name path = env['rc.d-path'] + self.name
os.remove(path) os.remove(path)
def detect_environment(self): def detect_environment(self):
""" """
Returns a dictionary of command/path to the required command-line applications. Returns a dictionary of command/path to the required command-line applications.
@@ -196,7 +196,7 @@ class LinuxService(ServiceBase):
env['rc.d-path'] = '/dev/null/' env['rc.d-path'] = '/dev/null/'
return env return env
def get_service_installer_command(self, env): def get_service_installer_command(self, env):
""" """
Returns list of args required to set a service to run on boot. Returns list of args required to set a service to run on boot.
@@ -218,4 +218,3 @@ class LinuxService(ServiceBase):
else: else:
cmd = env['update-rc.d'] cmd = env['update-rc.d']
return [cmd, self.name, 'remove'] return [cmd, self.name, 'remove']
+28 -28
View File
@@ -17,14 +17,14 @@ class ServiceBase(Base):
self.stdout = stdout self.stdout = stdout
self.stderr = stderr self.stderr = stderr
self.config_file = None self.config_file = None
def load_configuration(self): def load_configuration(self):
""" """
Loads the configuration required to build the command-line string Loads the configuration required to build the command-line string
for running web2py. Returns a tuple (command_args, config_dict). for running web2py. Returns a tuple (command_args, config_dict).
""" """
s = os.path.sep s = os.path.sep
default = dict( default = dict(
python = 'python', python = 'python',
web2py = os.path.join(s.join(__file__.split(s)[:-3]), 'web2py.py'), web2py = os.path.join(s.join(__file__.split(s)[:-3]), 'web2py.py'),
@@ -38,14 +38,14 @@ class ServiceBase(Base):
https_cert = '', https_cert = '',
password = '<recycle>', password = '<recycle>',
) )
config = default config = default
if self.config_file: if self.config_file:
try: try:
f = open(self.config_file, 'r') f = open(self.config_file, 'r')
lines = f.readlines() lines = f.readlines()
f.close() f.close()
for line in lines: for line in lines:
fields = line.split('=', 1) fields = line.split('=', 1)
if len(fields) == 2: if len(fields) == 2:
@@ -55,10 +55,10 @@ class ServiceBase(Base):
config[key] = value config[key] = value
except: except:
pass pass
web2py_path = os.path.dirname(config['web2py']) web2py_path = os.path.dirname(config['web2py'])
os.chdir(web2py_path) os.chdir(web2py_path)
args = [config['python'], config['web2py']] args = [config['python'], config['web2py']]
interfaces = [] interfaces = []
ports = [] ports = []
@@ -78,68 +78,68 @@ class ServiceBase(Base):
ports.append(ports) ports.append(ports)
if len(interfaces) == 0: if len(interfaces) == 0:
sys.exit('Configuration error. Must have settings for http and/or https') sys.exit('Configuration error. Must have settings for http and/or https')
password = config['password'] password = config['password']
if not password == '<recycle>': if not password == '<recycle>':
from gluon import main from gluon import main
for port in ports: for port in ports:
main.save_password(password, port) main.save_password(password, port)
password = '<recycle>' password = '<recycle>'
args.append('-a "%s"' % password) args.append('-a "%s"' % password)
interfaces = ';'.join(interfaces) interfaces = ';'.join(interfaces)
args.append('--interfaces=%s' % interfaces) args.append('--interfaces=%s' % interfaces)
if 'log_filename' in config.key(): if 'log_filename' in config.key():
log_filename = config['log_filename'] log_filename = config['log_filename']
args.append('--log_filename=%s' % log_filename) args.append('--log_filename=%s' % log_filename)
return (args, config) return (args, config)
def start(self): def start(self):
pass pass
def stop(self): def stop(self):
pass pass
def restart(self): def restart(self):
pass pass
def status(self): def status(self):
pass pass
def run(self): def run(self):
pass pass
def install(self): def install(self):
pass pass
def uninstall(self): def uninstall(self):
pass pass
def check_permissions(self): def check_permissions(self):
""" """
Does the script have permissions to install, uninstall, start, and stop services? Does the script have permissions to install, uninstall, start, and stop services?
Return value must be a tuple (True/False, error_message_if_False). Return value must be a tuple (True/False, error_message_if_False).
""" """
return (False, 'Permissions check not implemented') return (False, 'Permissions check not implemented')
class WebServerBase(Base): class WebServerBase(Base):
def install(self): def install(self):
pass pass
def uninstall(self): def uninstall(self):
pass pass
def get_service(): def get_service():
service_name = 'web2py' service_name = 'web2py'
service_label = 'web2py Service' service_label = 'web2py Service'
if sys.platform == 'linux2': if sys.platform == 'linux2':
from linux import LinuxService as Service from linux import LinuxService as Service
elif sys.platform == 'darwin': elif sys.platform == 'darwin':
# from mac import MacService as Service # from mac import MacService as Service
sys.exit('Mac OS X is not yet supported.\n') sys.exit('Mac OS X is not yet supported.\n')
@@ -148,16 +148,16 @@ def get_service():
sys.exit('Windows is not yet supported.\n') sys.exit('Windows is not yet supported.\n')
else: else:
sys.exit('The following platform is not supported: %s.\n' % sys.platform) sys.exit('The following platform is not supported: %s.\n' % sys.platform)
service = Service(service_name, service_label) service = Service(service_name, service_label)
return service return service
if __name__ == '__main__': if __name__ == '__main__':
service = get_service() service = get_service()
is_root, error_message = service.check_permissions() is_root, error_message = service.check_permissions()
if not is_root: if not is_root:
sys.exit(error_message) sys.exit(error_message)
if len(sys.argv) >= 2: if len(sys.argv) >= 2:
command = sys.argv[1] command = sys.argv[1]
if command == 'start': if command == 'start':
+2 -2
View File
@@ -20,12 +20,12 @@ Typical usage:
# Delete all sessions regardless of expiry and exit. # Delete all sessions regardless of expiry and exit.
python web2py.py -S app -M -R scripts/sessions2trash.py -A -o -x 0 python web2py.py -S app -M -R scripts/sessions2trash.py -A -o -x 0
# Delete session in a module (move to the modules folder) # Delete session in a module (move to the modules folder)
from sessions2trash import single_loop from sessions2trash import single_loop
def delete_sessions(): def delete_sessions():
single_loop() single_loop()
""" """
from __future__ import with_statement from __future__ import with_statement