This commit is contained in:
mdipierro
2015-01-17 00:07:10 -06:00
parent fe34d78578
commit 5bc5d0496e
44 changed files with 1934 additions and 1930 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
+1 -1
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.9.12-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
+1 -1
View File
@@ -1 +1 @@
Version 2.9.12-beta+timestamp.2015.01.15.09.58.09 Version 2.9.12-stable+timestamp.2015.01.17.00.07.04
+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
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)
+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
+1 -1
View File
@@ -11,7 +11,7 @@ Web2Py framework modules
""" """
__all__ = ['A', 'B', 'BEAUTIFY', 'BODY', 'BR', 'CAT', 'CENTER', 'CLEANUP', 'CODE', 'CRYPT', 'DAL', 'DIV', 'EM', 'EMBED', 'FIELDSET', 'FORM', 'Field', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'HEAD', 'HR', 'HTML', 'HTTP', 'I', 'IFRAME', 'IMG', 'INPUT', 'IS_ALPHANUMERIC', 'IS_DATE', 'IS_DATETIME', 'IS_DATETIME_IN_RANGE', 'IS_DATE_IN_RANGE', 'IS_DECIMAL_IN_RANGE', 'IS_EMAIL', 'IS_LIST_OF_EMAILS', 'IS_EMPTY_OR', 'IS_EQUAL_TO', 'IS_EXPR', 'IS_FLOAT_IN_RANGE', 'IS_IMAGE', 'IS_JSON', 'IS_INT_IN_RANGE', 'IS_IN_DB', 'IS_IN_SET', 'IS_IPV4', 'IS_LENGTH', 'IS_LIST_OF', 'IS_LOWER', 'IS_MATCH', 'IS_NOT_EMPTY', 'IS_NOT_IN_DB', 'IS_NULL_OR', 'IS_SLUG', 'IS_STRONG', 'IS_TIME', 'IS_UPLOAD_FILENAME', 'IS_UPPER', 'IS_URL', 'LABEL', 'LEGEND', 'LI', 'LINK', 'LOAD', 'MARKMIN', 'MENU', 'META', 'OBJECT', 'OL', 'ON', 'OPTGROUP', 'OPTION', 'P', 'PRE', 'SCRIPT', 'SELECT', 'SPAN', 'SQLFORM', 'SQLTABLE', 'STRONG', 'STYLE', 'TABLE', 'TAG', 'TBODY', 'TD', 'TEXTAREA', 'TFOOT', 'TH', 'THEAD', 'TITLE', 'TR', 'TT', 'UL', 'URL', 'XHTML', 'XML', 'redirect', 'current', 'embed64'] __all__ = ['A', 'B', 'BEAUTIFY', 'BODY', 'BR', 'CAT', 'CENTER', 'CLEANUP', 'CODE', 'CRYPT', 'DAL', 'DIV', 'EM', 'EMBED', 'FIELDSET', 'FORM', 'Field', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'HEAD', 'HR', 'HTML', 'HTTP', 'I', 'IFRAME', 'IMG', 'INPUT', 'IS_ALPHANUMERIC', 'IS_DATE', 'IS_DATETIME', 'IS_DATETIME_IN_RANGE', 'IS_DATE_IN_RANGE', 'IS_DECIMAL_IN_RANGE', 'IS_EMAIL', 'IS_LIST_OF_EMAILS', 'IS_EMPTY_OR', 'IS_EQUAL_TO', 'IS_EXPR', 'IS_FLOAT_IN_RANGE', 'IS_IMAGE', 'IS_JSON', 'IS_INT_IN_RANGE', 'IS_IN_DB', 'IS_IN_SET', 'IS_IPV4', 'IS_LENGTH', 'IS_LIST_OF', 'IS_LOWER', 'IS_MATCH', 'IS_NOT_EMPTY', 'IS_NOT_IN_DB', 'IS_NULL_OR', 'IS_SLUG', 'IS_STRONG', 'IS_TIME', 'IS_UPLOAD_FILENAME', 'IS_UPPER', 'IS_URL', 'LABEL', 'LEGEND', 'LI', 'LINK', 'LOAD', 'MARKMIN', 'MENU', 'META', 'OBJECT', 'OL', 'ON', 'OPTGROUP', 'OPTION', 'P', 'PRE', 'SCRIPT', 'SELECT', 'SPAN', 'SQLFORM', 'SQLTABLE', 'STRONG', 'STYLE', 'TABLE', 'TAG', 'TBODY', 'TD', 'TEXTAREA', 'TFOOT', 'TH', 'THEAD', 'TITLE', 'TR', 'TT', 'UL', 'URL', 'XHTML', 'XML', 'redirect', 'current', 'embed64']
from globals import current from globals import current
from html import * from html import *
from validators import * from validators import *
+693 -693
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -407,7 +407,7 @@ def build_environment(request, response, session, store_current=True):
# Enable standard conditional models (i.e., /*.py, /[controller]/*.py, and # Enable standard conditional models (i.e., /*.py, /[controller]/*.py, and
# /[controller]/[function]/*.py) # /[controller]/[function]/*.py)
response.models_to_run = [ response.models_to_run = [
r'^\w+\.py$', r'^\w+\.py$',
r'^%s/\w+\.py$' % request.controller, r'^%s/\w+\.py$' % request.controller,
r'^%s/%s/\w+\.py$' % (request.controller, request.function) r'^%s/%s/\w+\.py$' % (request.controller, request.function)
] ]
@@ -514,7 +514,7 @@ def compile_controllers(folder):
for function in exposed: for function in exposed:
command = data + "\nresponse._vars=response._caller(%s)\n" % \ command = data + "\nresponse._vars=response._caller(%s)\n" % \
function function
filename = pjoin(folder, 'compiled', filename = pjoin(folder, 'compiled',
'controllers.%s.%s.py' % (fname[:-3],function)) 'controllers.%s.%s.py' % (fname[:-3],function))
write_file(filename, command) write_file(filename, command)
save_pyc(filename) save_pyc(filename)
+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},
}, },
} }
+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
+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
+2 -2
View File
@@ -228,7 +228,7 @@ if not 'google' in DRIVERS:
DRIVERS.append('imaplib') DRIVERS.append('imaplib')
except: except:
LOGGER.debug('no IMAP driver imaplib') LOGGER.debug('no IMAP driver imaplib')
GAEDecimalProperty = None GAEDecimalProperty = None
NDBDecimalProperty = None NDBDecimalProperty = None
else: else:
@@ -302,7 +302,7 @@ else:
return decimal.Decimal(value) return decimal.Decimal(value)
raise TypeError("Property %s must be a Decimal or string."\ raise TypeError("Property %s must be a Decimal or string."\
% self._name) % self._name)
psycopg2_adapt = None psycopg2_adapt = None
cx_Oracle = None cx_Oracle = None
pyodbc = None pyodbc = None
+3 -4
View File
@@ -427,7 +427,7 @@ class Table(object):
for tn in db._adapter.tables(query) for tn in db._adapter.tables(query)
if tn == name or getattr(db[tn],'_ot',None)==name]) if tn == name or getattr(db[tn],'_ot',None)==name])
query = self._common_filter query = self._common_filter
if query: if query:
self._common_filter = \ self._common_filter = \
lambda q: reduce(AND, [query(q), newquery(q)]) lambda q: reduce(AND, [query(q), newquery(q)])
else: else:
@@ -692,7 +692,7 @@ class Table(object):
if not (value is None or isinstance(value, str)): if not (value is None or isinstance(value, str)):
if hasattr(value, 'file') and hasattr(value, 'filename'): if hasattr(value, 'file') and hasattr(value, 'filename'):
new_name = field.store(value.file, filename=value.filename) new_name = field.store(value.file, filename=value.filename)
elif isinstance(value,dict): elif isinstance(value,dict):
if 'data' in value and 'filename' in value: if 'data' in value and 'filename' in value:
stream = StringIO.StringIO(value['data']) stream = StringIO.StringIO(value['data'])
new_name = field.store(stream, filename=value['filename']) new_name = field.store(stream, filename=value['filename'])
@@ -2569,7 +2569,7 @@ class Rows(object):
:param render: whether we will render the fields using their represent :param render: whether we will render the fields using their represent
(default False) can be a list of fields to render or (default False) can be a list of fields to render or
True to render all. True to render all.
""" """
roots = [] roots = []
drows = {} drows = {}
rows = list(self.render(fields=None if render is True else render)) if render else self rows = list(self.render(fields=None if render is True else render)) if render else self
@@ -2703,4 +2703,3 @@ class Rows(object):
# for consistent naming yet backwards compatible # for consistent naming yet backwards compatible
as_csv = __str__ as_csv = __str__
json = as_json json = as_json
+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)
+1 -1
View File
@@ -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):
+2 -2
View File
@@ -365,8 +365,8 @@ def wsgibase(environ, responder):
client = client, client = client,
folder = abspath('applications', app) + os.sep, folder = abspath('applications', app) + os.sep,
ajax = x_req_with == 'xmlhttprequest', ajax = x_req_with == 'xmlhttprequest',
cid = env.http_web2py_component_element, cid = env.http_web2py_component_element,
is_local = (env.remote_addr in local_hosts and is_local = (env.remote_addr in local_hosts and
client == env.remote_addr), client == env.remote_addr),
is_shell = cmd_opts and cmd_opts.shell, is_shell = cmd_opts and cmd_opts.shell,
is_sheduler = cmd_opts and cmd_opts.scheduler, is_sheduler = cmd_opts and cmd_opts.scheduler,
+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()
+1 -1
View File
@@ -129,7 +129,7 @@ def env(
request.function) request.function)
if global_settings.cmd_options: if global_settings.cmd_options:
ip = global_settings.cmd_options.ip ip = global_settings.cmd_options.ip
port = global_settings.cmd_options.port port = global_settings.cmd_options.port
else: else:
ip, port = '127.0.0.1', '8000' ip, port = '127.0.0.1', '8000'
request.env.http_host = '%s:%s' % (ip,port) request.env.http_host = '%s:%s' % (ip,port)
+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 -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]
+1 -1
View File
@@ -65,7 +65,7 @@ class TestContribs(unittest.TestCase):
self.assertEqual(myappconfig.take('config3.key1', cast=int), '1') self.assertEqual(myappconfig.take('config3.key1', cast=int), '1')
self.assertEqual(myappconfig.take('config3.key2'), 2) self.assertEqual(myappconfig.take('config3.key2'), 2)
current.request = {} current.request = {}
if __name__ == '__main__': if __name__ == '__main__':
+1 -2
View File
@@ -1388,7 +1388,7 @@ class TestQuoting(unittest.TestCase):
class TestTableAndFieldCase(unittest.TestCase): class TestTableAndFieldCase(unittest.TestCase):
""" """
at the Python level we should not allow db.C and db.c because of .table conflicts on windows at the Python level we should not allow db.C and db.c because of .table conflicts on windows
but it should be possible to map two different names into distinct tables "c" and "C" at the Python level but it should be possible to map two different names into distinct tables "c" and "C" at the Python level
By default Python models names should be mapped into lower case table names and assume case insensitivity. By default Python models names should be mapped into lower case table names and assume case insensitivity.
""" """
@@ -1406,4 +1406,3 @@ class TestQuotesByDefault(unittest.TestCase):
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
tearDownModule() tearDownModule()
+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):
+31 -32
View File
@@ -173,7 +173,7 @@ class Mail(object):
chain of email certificate. It can be a chain of email certificate. It can be a
string containing the certs to. (PEM format) string containing the certs to. (PEM format)
x509_nocerts : if True then no attached certificate in mail x509_nocerts : if True then no attached certificate in mail
x509_crypt_certfiles: the certificates file or strings to encrypt x509_crypt_certfiles: the certificates file or strings to encrypt
the messages with can be a file name / the messages with can be a file name /
string or a list of file names / string or a list of file names /
strings (PEM format) strings (PEM format)
@@ -342,7 +342,7 @@ class Mail(object):
from_address: address to appear in the 'From:' header, this is not from_address: address to appear in the 'From:' header, this is not
the envelope sender. If not specified the sender will be used the envelope sender. If not specified the sender will be used
cipher_type : cipher_type :
gpg - need a python-pyme package and gpgme lib gpg - need a python-pyme package and gpgme lib
x509 - smime x509 - smime
gpg_home : you can set a GNUPGHOME environment variable gpg_home : you can set a GNUPGHOME environment variable
@@ -361,8 +361,8 @@ class Mail(object):
chain of email certificate. It can be a chain of email certificate. It can be a
string containing the certs to. (PEM format) string containing the certs to. (PEM format)
x509_nocerts : if True then no attached certificate in mail x509_nocerts : if True then no attached certificate in mail
x509_crypt_certfiles: the certificates file or strings to encrypt x509_crypt_certfiles: the certificates file or strings to encrypt
the messages with can be a file name / string or the messages with can be a file name / string or
a list of file names / strings (PEM format) a list of file names / strings (PEM format)
Examples: Examples:
Send plain text message to single address:: Send plain text message to single address::
@@ -1351,7 +1351,7 @@ class Auth(object):
reset_password_onvalidation = [], reset_password_onvalidation = [],
reset_password_onaccept = [], reset_password_onaccept = [],
hmac_key = hmac_key, hmac_key = hmac_key,
formstyle = current.response.formstyle, formstyle = current.response.formstyle,
) )
settings.lock_keys = True settings.lock_keys = True
@@ -2345,7 +2345,7 @@ class Auth(object):
items = snext.split('/') items = snext.split('/')
if '//' in snext and items[2] != request.env.http_host: if '//' in snext and items[2] != request.env.http_host:
snext = None snext = None
if snext: if snext:
session._auth_next = snext session._auth_next = snext
elif session._auth_next: elif session._auth_next:
@@ -2433,20 +2433,20 @@ class Auth(object):
separator=settings.label_separator, separator=settings.label_separator,
extra_fields = extra_fields, extra_fields = extra_fields,
) )
captcha = settings.login_captcha or \ captcha = settings.login_captcha or \
(settings.login_captcha != False and settings.captcha) (settings.login_captcha != False and settings.captcha)
if captcha: if captcha:
addrow(form, captcha.label, captcha, captcha.comment, addrow(form, captcha.label, captcha, captcha.comment,
settings.formstyle, 'captcha__row') settings.formstyle, 'captcha__row')
accepted_form = False accepted_form = False
if form.accepts(request, session if self.csrf_prevention else None, if form.accepts(request, session if self.csrf_prevention else None,
formname='login', dbio=False, formname='login', dbio=False,
onvalidation=onvalidation, onvalidation=onvalidation,
hideerror=settings.hideerror): hideerror=settings.hideerror):
accepted_form = True accepted_form = True
# check for username in db # check for username in db
entered_username = form.vars[username] entered_username = form.vars[username]
@@ -2464,7 +2464,7 @@ class Auth(object):
elif temp_user.registration_key in ('disabled', 'blocked'): elif temp_user.registration_key in ('disabled', 'blocked'):
response.flash = self.messages.login_disabled response.flash = self.messages.login_disabled
return form return form
elif (not temp_user.registration_key is None elif (not temp_user.registration_key is None
and temp_user.registration_key.strip()): and temp_user.registration_key.strip()):
response.flash = \ response.flash = \
self.messages.registration_verifying self.messages.registration_verifying
@@ -2512,11 +2512,11 @@ class Auth(object):
redirect( redirect(
self.url(args=request.args, vars=request.get_vars), self.url(args=request.args, vars=request.get_vars),
client_side=settings.client_side) client_side=settings.client_side)
else: # use a central authentication server else: # use a central authentication server
cas = settings.login_form cas = settings.login_form
cas_user = cas.get_user() cas_user = cas.get_user()
if cas_user: if cas_user:
cas_user[passfield] = None cas_user[passfield] = None
user = self.get_or_create_user( user = self.get_or_create_user(
@@ -2532,7 +2532,7 @@ class Auth(object):
# Extra login logic for two-factor authentication # Extra login logic for two-factor authentication
################################################# #################################################
# If the 'user' variable has a value, this means that the first # If the 'user' variable has a value, this means that the first
# authentication step was successful (i.e. user provided correct # authentication step was successful (i.e. user provided correct
# username and password at the first challenge). # username and password at the first challenge).
# Check if this user is signed up for two-factor authentication # Check if this user is signed up for two-factor authentication
@@ -2545,7 +2545,7 @@ class Auth(object):
if session.auth_two_factor_enabled: if session.auth_two_factor_enabled:
form = SQLFORM.factory( form = SQLFORM.factory(
Field('authentication_code', Field('authentication_code',
required=True, required=True,
comment='This code was emailed to you and is required for login.'), comment='This code was emailed to you and is required for login.'),
hidden=dict(_next=next), hidden=dict(_next=next),
formstyle=settings.formstyle, formstyle=settings.formstyle,
@@ -2564,8 +2564,8 @@ class Auth(object):
session.auth_two_factor_tries_left = 3 # Allow user to try up to 4 times session.auth_two_factor_tries_left = 3 # Allow user to try up to 4 times
# TODO: Add some error checking to handle cases where email cannot be sent # TODO: Add some error checking to handle cases where email cannot be sent
self.settings.mailer.send( self.settings.mailer.send(
to=user.email, to=user.email,
subject="Two-step Login Authentication Code", subject="Two-step Login Authentication Code",
message="Your temporary login code is {0}".format(session.auth_two_factor)) message="Your temporary login code is {0}".format(session.auth_two_factor))
if form.accepts(request, session if self.csrf_prevention else None, if form.accepts(request, session if self.csrf_prevention else None,
formname='login', dbio=False, formname='login', dbio=False,
@@ -2580,15 +2580,15 @@ class Auth(object):
# normal. # normal.
if user is None or user == session.auth_two_factor_user: if user is None or user == session.auth_two_factor_user:
user = session.auth_two_factor_user user = session.auth_two_factor_user
# For security, because the username stored in the # For security, because the username stored in the
# session somehow does not match the just validated # session somehow does not match the just validated
# user. Should not be possible without session stealing # user. Should not be possible without session stealing
# which is hard with SSL. # which is hard with SSL.
elif user != session.auth_two_factor_user: elif user != session.auth_two_factor_user:
user = None user = None
# Either way, the user and code associated with this session should # Either way, the user and code associated with this session should
# be removed. This handles cases where the session login may have # be removed. This handles cases where the session login may have
# expired but browser window is open, so the old session key and # expired but browser window is open, so the old session key and
# session usernamem will still exist # session usernamem will still exist
self._reset_two_factor_auth(session) self._reset_two_factor_auth(session)
else: else:
@@ -2636,11 +2636,11 @@ class Auth(object):
""" """
Logouts and redirects to login Logouts and redirects to login
""" """
# Clear out 2-step authentication information if user logs # Clear out 2-step authentication information if user logs
# out. This information is also cleared on successful login. # out. This information is also cleared on successful login.
self._reset_two_factor_auth(current.session) self._reset_two_factor_auth(current.session)
if next is DEFAULT: if next is DEFAULT:
next = self.get_vars_next() or self.settings.logout_next next = self.get_vars_next() or self.settings.logout_next
if onlogout is DEFAULT: if onlogout is DEFAULT:
@@ -2791,7 +2791,7 @@ class Auth(object):
else: else:
next = replace_id(next, form) next = replace_id(next, form)
redirect(next, client_side=self.settings.client_side) redirect(next, client_side=self.settings.client_side)
return form return form
def is_logged_in(self): def is_logged_in(self):
@@ -3091,7 +3091,7 @@ class Auth(object):
if log is DEFAULT: if log is DEFAULT:
log = self.messages['reset_password_log'] log = self.messages['reset_password_log']
userfield = self.settings.login_userfield or 'username' \ userfield = self.settings.login_userfield or 'username' \
if 'username' in table_user.fields else 'email' if 'username' in table_user.fields else 'email'
if userfield=='email': if userfield=='email':
table_user.email.requires = [ table_user.email.requires = [
IS_EMAIL(error_message=self.messages.invalid_email), IS_EMAIL(error_message=self.messages.invalid_email),
@@ -3197,11 +3197,11 @@ class Auth(object):
log = self.messages['change_password_log'] log = self.messages['change_password_log']
passfield = self.settings.password_field passfield = self.settings.password_field
requires = table_user[passfield].requires requires = table_user[passfield].requires
if not isinstance(requires,(list, tuple)): if not isinstance(requires,(list, tuple)):
requires = [requires] requires = [requires]
requires = filter(lambda t:isinstance(t,CRYPT), requires) requires = filter(lambda t:isinstance(t,CRYPT), requires)
if requires: if requires:
requires[0].min_length = 0 requires[0].min_length = 0
form = SQLFORM.factory( form = SQLFORM.factory(
Field('old_password', 'password', requires=requires, Field('old_password', 'password', requires=requires,
label=self.messages.old_password), label=self.messages.old_password),
@@ -3753,7 +3753,7 @@ class Auth(object):
archive_current=False, archive_current=False,
fields=None): fields=None):
""" """
If you have a table (db.mytable) that needs full revision history you If you have a table (db.mytable) that needs full revision history you
can just do:: can just do::
form=crud.update(db.mytable,myrecord,onaccept=auth.archive) form=crud.update(db.mytable,myrecord,onaccept=auth.archive)
@@ -5371,8 +5371,8 @@ class Expose(object):
base = base or os.path.join(current.request.folder, 'static') base = base or os.path.join(current.request.folder, 'static')
basename = basename or current.request.function basename = basename or current.request.function
self.basename = basename self.basename = basename
if current.request.raw_args: if current.request.raw_args:
self.args = [arg for arg in current.request.raw_args.split('/') if arg] self.args = [arg for arg in current.request.raw_args.split('/') if arg]
else: else:
self.args = [arg for arg in current.request.args if args] self.args = [arg for arg in current.request.args if args]
@@ -5696,8 +5696,8 @@ class Wiki(object):
def automenu(self): def automenu(self):
"""adds the menu if not present""" """adds the menu if not present"""
if (not self.wiki_menu_items and if (not self.wiki_menu_items and
self.settings.controller and self.settings.controller and
self.settings.function): self.settings.function):
self.wiki_menu_items = self.menu(self.settings.controller, self.wiki_menu_items = self.menu(self.settings.controller,
self.settings.function) self.settings.function)
@@ -6169,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