Merge branch 'master' of git://github.com/web2py/web2py
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 2.8.2-stable+timestamp.2013.12.17.16.49.17
|
Version 2.8.2-stable+timestamp.2014.01.07.02.13.10
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
pgv = None
|
pgv = None
|
||||||
|
|
||||||
|
is_gae = request.env.web2py_runtime_gae or False
|
||||||
|
|
||||||
# ## critical --- make a copy of the environment
|
# ## critical --- make a copy of the environment
|
||||||
|
|
||||||
global_env = copy.copy(globals())
|
global_env = copy.copy(globals())
|
||||||
@@ -359,36 +361,43 @@ def state():
|
|||||||
|
|
||||||
|
|
||||||
def ccache():
|
def ccache():
|
||||||
cache.ram.initialize()
|
if is_gae:
|
||||||
cache.disk.initialize()
|
form = FORM(
|
||||||
|
P(TAG.BUTTON(T("Clear CACHE?"), _type="submit", _name="yes", _value="yes")))
|
||||||
|
else:
|
||||||
|
cache.ram.initialize()
|
||||||
|
cache.disk.initialize()
|
||||||
|
|
||||||
form = FORM(
|
form = FORM(
|
||||||
P(TAG.BUTTON(
|
P(TAG.BUTTON(
|
||||||
T("Clear CACHE?"), _type="submit", _name="yes", _value="yes")),
|
T("Clear CACHE?"), _type="submit", _name="yes", _value="yes")),
|
||||||
P(TAG.BUTTON(
|
P(TAG.BUTTON(
|
||||||
T("Clear RAM"), _type="submit", _name="ram", _value="ram")),
|
T("Clear RAM"), _type="submit", _name="ram", _value="ram")),
|
||||||
P(TAG.BUTTON(
|
P(TAG.BUTTON(
|
||||||
T("Clear DISK"), _type="submit", _name="disk", _value="disk")),
|
T("Clear DISK"), _type="submit", _name="disk", _value="disk")),
|
||||||
)
|
)
|
||||||
|
|
||||||
if form.accepts(request.vars, session):
|
if form.accepts(request.vars, session):
|
||||||
clear_ram = False
|
|
||||||
clear_disk = False
|
|
||||||
session.flash = ""
|
session.flash = ""
|
||||||
if request.vars.yes:
|
if is_gae:
|
||||||
clear_ram = clear_disk = True
|
if request.vars.yes:
|
||||||
if request.vars.ram:
|
cache.ram.clear()
|
||||||
clear_ram = True
|
session.flash += T("Cache Cleared")
|
||||||
if request.vars.disk:
|
else:
|
||||||
clear_disk = True
|
clear_ram = False
|
||||||
|
clear_disk = False
|
||||||
if clear_ram:
|
if request.vars.yes:
|
||||||
cache.ram.clear()
|
clear_ram = clear_disk = True
|
||||||
session.flash += T("Ram Cleared")
|
if request.vars.ram:
|
||||||
if clear_disk:
|
clear_ram = True
|
||||||
cache.disk.clear()
|
if request.vars.disk:
|
||||||
session.flash += T("Disk Cleared")
|
clear_disk = True
|
||||||
|
if clear_ram:
|
||||||
|
cache.ram.clear()
|
||||||
|
session.flash += T("Ram Cleared")
|
||||||
|
if clear_disk:
|
||||||
|
cache.disk.clear()
|
||||||
|
session.flash += T("Disk Cleared")
|
||||||
redirect(URL(r=request))
|
redirect(URL(r=request))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -414,6 +423,7 @@ def ccache():
|
|||||||
'oldest': time.time(),
|
'oldest': time.time(),
|
||||||
'keys': []
|
'keys': []
|
||||||
}
|
}
|
||||||
|
|
||||||
disk = copy.copy(ram)
|
disk = copy.copy(ram)
|
||||||
total = copy.copy(ram)
|
total = copy.copy(ram)
|
||||||
disk['keys'] = []
|
disk['keys'] = []
|
||||||
@@ -428,72 +438,81 @@ def ccache():
|
|||||||
|
|
||||||
return (hours, minutes, seconds)
|
return (hours, minutes, seconds)
|
||||||
|
|
||||||
for key, value in cache.ram.storage.iteritems():
|
if is_gae:
|
||||||
if isinstance(value, dict):
|
gae_stats = cache.ram.client.get_stats()
|
||||||
ram['hits'] = value['hit_total'] - value['misses']
|
try:
|
||||||
ram['misses'] = value['misses']
|
gae_stats['ratio'] = ((gae_stats['hits'] * 100) /
|
||||||
try:
|
(gae_stats['hits'] + gae_stats['misses']))
|
||||||
ram['ratio'] = ram['hits'] * 100 / value['hit_total']
|
except ZeroDivisionError:
|
||||||
except (KeyError, ZeroDivisionError):
|
gae_stats['ratio'] = T("?")
|
||||||
ram['ratio'] = 0
|
gae_stats['oldest'] = GetInHMS(time.time() - gae_stats['oldest_item_age'])
|
||||||
else:
|
total.update(gae_stats)
|
||||||
if hp:
|
else:
|
||||||
ram['bytes'] += hp.iso(value[1]).size
|
for key, value in cache.ram.storage.iteritems():
|
||||||
ram['objects'] += hp.iso(value[1]).count
|
|
||||||
ram['entries'] += 1
|
|
||||||
if value[0] < ram['oldest']:
|
|
||||||
ram['oldest'] = value[0]
|
|
||||||
ram['keys'].append((key, GetInHMS(time.time() - value[0])))
|
|
||||||
folder = os.path.join(request.folder,'cache')
|
|
||||||
if not os.path.exists(folder):
|
|
||||||
os.mkdir(folder)
|
|
||||||
locker = open(os.path.join(folder, 'cache.lock'), 'a')
|
|
||||||
portalocker.lock(locker, portalocker.LOCK_EX)
|
|
||||||
disk_storage = shelve.open(
|
|
||||||
os.path.join(folder, 'cache.shelve'))
|
|
||||||
try:
|
|
||||||
for key, value in disk_storage.items():
|
|
||||||
if isinstance(value, dict):
|
if isinstance(value, dict):
|
||||||
disk['hits'] = value['hit_total'] - value['misses']
|
ram['hits'] = value['hit_total'] - value['misses']
|
||||||
disk['misses'] = value['misses']
|
ram['misses'] = value['misses']
|
||||||
try:
|
try:
|
||||||
disk['ratio'] = disk['hits'] * 100 / value['hit_total']
|
ram['ratio'] = ram['hits'] * 100 / value['hit_total']
|
||||||
except (KeyError, ZeroDivisionError):
|
except (KeyError, ZeroDivisionError):
|
||||||
disk['ratio'] = 0
|
ram['ratio'] = 0
|
||||||
else:
|
else:
|
||||||
if hp:
|
if hp:
|
||||||
disk['bytes'] += hp.iso(value[1]).size
|
ram['bytes'] += hp.iso(value[1]).size
|
||||||
disk['objects'] += hp.iso(value[1]).count
|
ram['objects'] += hp.iso(value[1]).count
|
||||||
disk['entries'] += 1
|
ram['entries'] += 1
|
||||||
if value[0] < disk['oldest']:
|
if value[0] < ram['oldest']:
|
||||||
disk['oldest'] = value[0]
|
ram['oldest'] = value[0]
|
||||||
disk['keys'].append((key, GetInHMS(time.time() - value[0])))
|
ram['keys'].append((key, GetInHMS(time.time() - value[0])))
|
||||||
|
folder = os.path.join(request.folder,'cache')
|
||||||
|
if not os.path.exists(folder):
|
||||||
|
os.mkdir(folder)
|
||||||
|
locker = open(os.path.join(folder, 'cache.lock'), 'a')
|
||||||
|
portalocker.lock(locker, portalocker.LOCK_EX)
|
||||||
|
disk_storage = shelve.open(
|
||||||
|
os.path.join(folder, 'cache.shelve'))
|
||||||
|
try:
|
||||||
|
for key, value in disk_storage.items():
|
||||||
|
if isinstance(value, dict):
|
||||||
|
disk['hits'] = value['hit_total'] - value['misses']
|
||||||
|
disk['misses'] = value['misses']
|
||||||
|
try:
|
||||||
|
disk['ratio'] = disk['hits'] * 100 / value['hit_total']
|
||||||
|
except (KeyError, ZeroDivisionError):
|
||||||
|
disk['ratio'] = 0
|
||||||
|
else:
|
||||||
|
if hp:
|
||||||
|
disk['bytes'] += hp.iso(value[1]).size
|
||||||
|
disk['objects'] += hp.iso(value[1]).count
|
||||||
|
disk['entries'] += 1
|
||||||
|
if value[0] < disk['oldest']:
|
||||||
|
disk['oldest'] = value[0]
|
||||||
|
disk['keys'].append((key, GetInHMS(time.time() - value[0])))
|
||||||
|
finally:
|
||||||
|
portalocker.unlock(locker)
|
||||||
|
locker.close()
|
||||||
|
disk_storage.close()
|
||||||
|
|
||||||
finally:
|
total['entries'] = ram['entries'] + disk['entries']
|
||||||
portalocker.unlock(locker)
|
total['bytes'] = ram['bytes'] + disk['bytes']
|
||||||
locker.close()
|
total['objects'] = ram['objects'] + disk['objects']
|
||||||
disk_storage.close()
|
total['hits'] = ram['hits'] + disk['hits']
|
||||||
|
total['misses'] = ram['misses'] + disk['misses']
|
||||||
total['entries'] = ram['entries'] + disk['entries']
|
total['keys'] = ram['keys'] + disk['keys']
|
||||||
total['bytes'] = ram['bytes'] + disk['bytes']
|
try:
|
||||||
total['objects'] = ram['objects'] + disk['objects']
|
total['ratio'] = total['hits'] * 100 / (total['hits'] +
|
||||||
total['hits'] = ram['hits'] + disk['hits']
|
|
||||||
total['misses'] = ram['misses'] + disk['misses']
|
|
||||||
total['keys'] = ram['keys'] + disk['keys']
|
|
||||||
try:
|
|
||||||
total['ratio'] = total['hits'] * 100 / (total['hits'] +
|
|
||||||
total['misses'])
|
total['misses'])
|
||||||
except (KeyError, ZeroDivisionError):
|
except (KeyError, ZeroDivisionError):
|
||||||
total['ratio'] = 0
|
total['ratio'] = 0
|
||||||
|
|
||||||
if disk['oldest'] < ram['oldest']:
|
if disk['oldest'] < ram['oldest']:
|
||||||
total['oldest'] = disk['oldest']
|
total['oldest'] = disk['oldest']
|
||||||
else:
|
else:
|
||||||
total['oldest'] = ram['oldest']
|
total['oldest'] = ram['oldest']
|
||||||
|
|
||||||
ram['oldest'] = GetInHMS(time.time() - ram['oldest'])
|
ram['oldest'] = GetInHMS(time.time() - ram['oldest'])
|
||||||
disk['oldest'] = GetInHMS(time.time() - disk['oldest'])
|
disk['oldest'] = GetInHMS(time.time() - disk['oldest'])
|
||||||
total['oldest'] = GetInHMS(time.time() - total['oldest'])
|
total['oldest'] = GetInHMS(time.time() - total['oldest'])
|
||||||
|
|
||||||
def key_table(keys):
|
def key_table(keys):
|
||||||
return TABLE(
|
return TABLE(
|
||||||
@@ -502,9 +521,10 @@ def ccache():
|
|||||||
**dict(_class='cache-keys',
|
**dict(_class='cache-keys',
|
||||||
_style="border-collapse: separate; border-spacing: .5em;"))
|
_style="border-collapse: separate; border-spacing: .5em;"))
|
||||||
|
|
||||||
ram['keys'] = key_table(ram['keys'])
|
if not is_gae:
|
||||||
disk['keys'] = key_table(disk['keys'])
|
ram['keys'] = key_table(ram['keys'])
|
||||||
total['keys'] = key_table(total['keys'])
|
disk['keys'] = key_table(disk['keys'])
|
||||||
|
total['keys'] = key_table(total['keys'])
|
||||||
|
|
||||||
return dict(form=form, total=total,
|
return dict(form=form, total=total,
|
||||||
ram=ram, disk=disk, object_stats=hp != False)
|
ram=ram, disk=disk, object_stats=hp != False)
|
||||||
|
|||||||
@@ -574,10 +574,10 @@ def edit():
|
|||||||
# Load json only if it is ajax edited...
|
# Load json only if it is ajax edited...
|
||||||
app = get_app(request.vars.app)
|
app = get_app(request.vars.app)
|
||||||
app_path = apath(app, r=request)
|
app_path = apath(app, r=request)
|
||||||
editor_defaults={'theme':'web2py', 'editor': 'default', 'closetag': 'true', 'codefolding': 'false', 'tabwidth':'4', 'indentwithtabs':'false', 'linenumbers':'true', 'highlightline':'true'}
|
preferences={'theme':'web2py', 'editor': 'default', 'closetag': 'true', 'codefolding': 'false', 'tabwidth':'4', 'indentwithtabs':'false', 'linenumbers':'true', 'highlightline':'true'}
|
||||||
config = Config(os.path.join(request.folder, 'settings.cfg'),
|
config = Config(os.path.join(request.folder, 'settings.cfg'),
|
||||||
section='editor', default_values=editor_defaults)
|
section='editor', default_values={})
|
||||||
preferences = config.read()
|
preferences.update(config.read())
|
||||||
|
|
||||||
if not(request.ajax) and not(is_mobile):
|
if not(request.ajax) and not(is_mobile):
|
||||||
# return the scaffolding, the rest will be through ajax requests
|
# return the scaffolding, the rest will be through ajax requests
|
||||||
@@ -589,7 +589,7 @@ def edit():
|
|||||||
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 editor_defaults 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')
|
||||||
else:
|
else:
|
||||||
@@ -814,6 +814,22 @@ def todolist():
|
|||||||
|
|
||||||
return {'todo':output, 'app': app}
|
return {'todo':output, 'app': app}
|
||||||
|
|
||||||
|
def editor_sessions():
|
||||||
|
config = Config(os.path.join(request.folder, 'settings.cfg'),
|
||||||
|
section='editor_sessions', default_values={})
|
||||||
|
preferences = config.read()
|
||||||
|
|
||||||
|
if request.vars.session_name and request.vars.files:
|
||||||
|
session_name = request.vars.session_name
|
||||||
|
files = request.vars.files
|
||||||
|
preferences.update({session_name:','.join(files)})
|
||||||
|
if config.save(preferences.items()):
|
||||||
|
response.headers["web2py-component-flash"] = T('Session saved correctly')
|
||||||
|
else:
|
||||||
|
response.headers["web2py-component-flash"] = T('Session saved on session only')
|
||||||
|
|
||||||
|
return response.render('default/editor_sessions.html', {'editor_sessions':preferences})
|
||||||
|
|
||||||
def resolve():
|
def resolve():
|
||||||
"""
|
"""
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
'(version %s)': '(version %s)',
|
'(version %s)': '(version %s)',
|
||||||
'@markmin\x01(file **gluon/contrib/plural_rules/%s.py** is not found)': '(file **gluon/contrib/plural_rules/%s.py** is not found)',
|
'@markmin\x01(file **gluon/contrib/plural_rules/%s.py** is not found)': '(file **gluon/contrib/plural_rules/%s.py** is not found)',
|
||||||
'@markmin\x01An error occured, please [[reload %s]] the page': 'An error occured, please [[reload %s]] the page',
|
'@markmin\x01An error occured, please [[reload %s]] the page': 'An error occured, please [[reload %s]] the page',
|
||||||
|
'@markmin\x01Number of entries: **%s**': 'Number of entries: **%s**',
|
||||||
'@markmin\x01Searching: **%s** %%{file}': 'Searching: **%s** files',
|
'@markmin\x01Searching: **%s** %%{file}': 'Searching: **%s** files',
|
||||||
'A new version of web2py is available': 'Hay una nueva versión de web2py disponible',
|
'A new version of web2py is available': 'Hay una nueva versión de web2py disponible',
|
||||||
'A new version of web2py is available: %s': 'Hay una nueva versión de web2py disponible: %s',
|
'A new version of web2py is available: %s': 'Hay una nueva versión de web2py disponible: %s',
|
||||||
@@ -57,11 +58,13 @@
|
|||||||
'Autocomplete': 'Autocomplete',
|
'Autocomplete': 'Autocomplete',
|
||||||
'Autocomplete Python Code': 'Autocompletar código Python',
|
'Autocomplete Python Code': 'Autocompletar código Python',
|
||||||
'Available databases and tables': 'Bases de datos y tablas disponibles',
|
'Available databases and tables': 'Bases de datos y tablas disponibles',
|
||||||
|
'Available Databases and Tables': 'Available Databases and Tables',
|
||||||
'back': 'atrás',
|
'back': 'atrás',
|
||||||
'Back to the plugins list': 'Back to the plugins list',
|
'Back to the plugins list': 'Back to the plugins list',
|
||||||
'breakpoint': 'breakpoint',
|
'breakpoint': 'breakpoint',
|
||||||
'breakpoints': 'breakpoints',
|
'breakpoints': 'breakpoints',
|
||||||
'browse': 'buscar',
|
'browse': 'buscar',
|
||||||
|
'Cache': 'Cache',
|
||||||
'cache': 'cache',
|
'cache': 'cache',
|
||||||
'cache, errors and sessions cleaned': 'cache, errores y sesiones eliminados',
|
'cache, errors and sessions cleaned': 'cache, errores y sesiones eliminados',
|
||||||
'can be a git repo': 'puede ser un repositorio git',
|
'can be a git repo': 'puede ser un repositorio git',
|
||||||
@@ -79,6 +82,9 @@
|
|||||||
'Check to delete': 'Marque para eliminar',
|
'Check to delete': 'Marque para eliminar',
|
||||||
'Checking for upgrades...': 'Buscando actulizaciones...',
|
'Checking for upgrades...': 'Buscando actulizaciones...',
|
||||||
'Clean': 'limpiar',
|
'Clean': 'limpiar',
|
||||||
|
'Clear CACHE?': 'Clear CACHE?',
|
||||||
|
'Clear DISK': 'Clear DISK',
|
||||||
|
'Clear RAM': 'Clear RAM',
|
||||||
'click here for online examples': 'haga clic aquí para ver ejemplos en línea',
|
'click here for online examples': 'haga clic aquí para ver ejemplos en línea',
|
||||||
'click here for the administrative interface': 'haga clic aquí para usar la interfaz administrativa',
|
'click here for the administrative interface': 'haga clic aquí para usar la interfaz administrativa',
|
||||||
'Click row to expand traceback': 'Click row to expand traceback',
|
'Click row to expand traceback': 'Click row to expand traceback',
|
||||||
@@ -113,6 +119,7 @@
|
|||||||
'database': 'base de datos',
|
'database': 'base de datos',
|
||||||
'database %s select': 'selección en base de datos %s',
|
'database %s select': 'selección en base de datos %s',
|
||||||
'database administration': 'administración base de datos',
|
'database administration': 'administración base de datos',
|
||||||
|
'Database Administration (appadmin)': 'Database Administration (appadmin)',
|
||||||
'Date and Time': 'Fecha y Hora',
|
'Date and Time': 'Fecha y Hora',
|
||||||
'db': 'db',
|
'db': 'db',
|
||||||
'Debug': 'Debug',
|
'Debug': 'Debug',
|
||||||
@@ -135,6 +142,7 @@
|
|||||||
'details': 'detalles',
|
'details': 'detalles',
|
||||||
'direction: ltr': 'direction: ltr',
|
'direction: ltr': 'direction: ltr',
|
||||||
'Disable': 'Deshabilitar',
|
'Disable': 'Deshabilitar',
|
||||||
|
'DISK': 'DISK',
|
||||||
'docs': 'docs',
|
'docs': 'docs',
|
||||||
'Docs': 'Docs',
|
'Docs': 'Docs',
|
||||||
'Done!': 'Done!',
|
'Done!': 'Done!',
|
||||||
@@ -249,6 +257,7 @@
|
|||||||
'Lost Password': 'Contraseña perdida',
|
'Lost Password': 'Contraseña perdida',
|
||||||
'manage': 'gestionar',
|
'manage': 'gestionar',
|
||||||
'Manage': 'Gestionar',
|
'Manage': 'Gestionar',
|
||||||
|
'Manage Cache': 'Manage Cache',
|
||||||
'merge': 'combinar',
|
'merge': 'combinar',
|
||||||
'Models': 'Modelos',
|
'Models': 'Modelos',
|
||||||
'models': 'modelos',
|
'models': 'modelos',
|
||||||
@@ -282,6 +291,7 @@
|
|||||||
'or provide application url:': 'o provea URL de la aplicación:',
|
'or provide application url:': 'o provea URL de la aplicación:',
|
||||||
'Origin': 'Origen',
|
'Origin': 'Origen',
|
||||||
'Original/Translation': 'Original/Traducción',
|
'Original/Translation': 'Original/Traducción',
|
||||||
|
'Overview': 'Overview',
|
||||||
'Overwrite installed app': 'sobreescriba la aplicación instalada',
|
'Overwrite installed app': 'sobreescriba la aplicación instalada',
|
||||||
'Pack all': 'empaquetar todo',
|
'Pack all': 'empaquetar todo',
|
||||||
'Pack compiled': 'empaquete compiladas',
|
'Pack compiled': 'empaquete compiladas',
|
||||||
@@ -305,6 +315,7 @@
|
|||||||
'private files': 'archivos privados',
|
'private files': 'archivos privados',
|
||||||
'Project Progress': 'Project Progress',
|
'Project Progress': 'Project Progress',
|
||||||
'Query:': 'Consulta:',
|
'Query:': 'Consulta:',
|
||||||
|
'RAM': 'RAM',
|
||||||
'Rapid Search': 'Rapid Search',
|
'Rapid Search': 'Rapid Search',
|
||||||
'record': 'registro',
|
'record': 'registro',
|
||||||
'record does not exist': 'el registro no existe',
|
'record does not exist': 'el registro no existe',
|
||||||
@@ -356,6 +367,7 @@
|
|||||||
'Static': 'Static',
|
'Static': 'Static',
|
||||||
'static': 'estáticos',
|
'static': 'estáticos',
|
||||||
'Static files': 'Archivos estáticos',
|
'Static files': 'Archivos estáticos',
|
||||||
|
'Statistics': 'Statistics',
|
||||||
'step': 'step',
|
'step': 'step',
|
||||||
'stop': 'stop',
|
'stop': 'stop',
|
||||||
'submit': 'enviar',
|
'submit': 'enviar',
|
||||||
@@ -397,6 +409,7 @@
|
|||||||
'To emulate a breakpoint programatically, write:': 'To emulate a breakpoint programatically, write:',
|
'To emulate a breakpoint programatically, write:': 'To emulate a breakpoint programatically, write:',
|
||||||
'to use the debugger!': 'to use the debugger!',
|
'to use the debugger!': 'to use the debugger!',
|
||||||
'toggle breakpoint': 'alternar punto de ruptura',
|
'toggle breakpoint': 'alternar punto de ruptura',
|
||||||
|
'Toggle comment': 'Toggle comment',
|
||||||
'Toggle Fullscreen': 'Alternar pantalla completa',
|
'Toggle Fullscreen': 'Alternar pantalla completa',
|
||||||
'Traceback': 'Traceback',
|
'Traceback': 'Traceback',
|
||||||
'translation strings for the application': 'cadenas de caracteres de traducción para la aplicación',
|
'translation strings for the application': 'cadenas de caracteres de traducción para la aplicación',
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# coding: utf8
|
# -*- coding: utf-8 -*-
|
||||||
{
|
{
|
||||||
'!langcode!': 'it',
|
'!langcode!': 'it',
|
||||||
'!langname!': 'Italiano',
|
'!langname!': 'Italiano',
|
||||||
@@ -303,6 +303,7 @@
|
|||||||
'to previous version.': 'torna a versione precedente',
|
'to previous version.': 'torna a versione precedente',
|
||||||
'To create a plugin, name a file/folder plugin_[name]': 'Per creare un plugin, chiamare un file o cartella plugin_[nome]',
|
'To create a plugin, name a file/folder plugin_[name]': 'Per creare un plugin, chiamare un file o cartella plugin_[nome]',
|
||||||
'toggle breakpoint': 'toggle breakpoint',
|
'toggle breakpoint': 'toggle breakpoint',
|
||||||
|
'Toggle comment': 'Toggle comment',
|
||||||
'Toggle Fullscreen': 'Toggle Fullscreen',
|
'Toggle Fullscreen': 'Toggle Fullscreen',
|
||||||
'Traceback': 'Traceback',
|
'Traceback': 'Traceback',
|
||||||
'translation strings for the application': "stringhe di traduzioni per l'applicazione",
|
'translation strings for the application': "stringhe di traduzioni per l'applicazione",
|
||||||
|
|||||||
@@ -45,4 +45,4 @@ if 'adminLanguage' in request.cookies and not (request.cookies['adminLanguage']
|
|||||||
T.force(request.cookies['adminLanguage'].value)
|
T.force(request.cookies['adminLanguage'].value)
|
||||||
|
|
||||||
#set static_version
|
#set static_version
|
||||||
response.static_version = '2.7.3'
|
response.static_version = open('VERSION').read().split(' ',1)[1].split('-')[0]
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
[DEFAULT]
|
[DEFAULT]
|
||||||
theme = web2py
|
|
||||||
closetag = true
|
|
||||||
editor = default
|
|
||||||
|
|
||||||
[editor]
|
[editor]
|
||||||
theme = web2py
|
theme = web2py
|
||||||
editor = default
|
editor = default
|
||||||
closetag = true
|
closetag = true
|
||||||
|
|
||||||
|
[editor_sessions]
|
||||||
|
welcome = welcome/models/db.py,welcome/controllers/default.py,welcome/views/default/index.html
|
||||||
|
|
||||||
|
|||||||
@@ -260,7 +260,7 @@ function load_file(url, lineno) {
|
|||||||
if(typeof (json['plain_html']) !== undefined) {
|
if(typeof (json['plain_html']) !== undefined) {
|
||||||
if($('#' + json['id']).length === 0 || json['force'] === true) {
|
if($('#' + json['id']).length === 0 || json['force'] === true) {
|
||||||
// Create a tab and put the code in it
|
// Create a tab and put the code in it
|
||||||
var tab_header = '<li><a title="'+ json['filename'] +'" href="#' + json['id'] + '" data-toggle="tab"><button type="button" class="close">×</button>' + json['realfilename'] + '</a></li>';
|
var tab_header = '<li><a title="'+ json['filename'] +'" data-path="' + json['filename'] + '" href="#' + json['id'] + '" data-toggle="tab"><button type="button" class="close">×</button>' + json['realfilename'] + '</a></li>';
|
||||||
var tab_body = '<div id="' + json['id'] + '" class="tab-pane fade in " >' + json['plain_html'] + '</div>';
|
var tab_body = '<div id="' + json['id'] + '" class="tab-pane fade in " >' + json['plain_html'] + '</div>';
|
||||||
if(json['force'] === false) {
|
if(json['force'] === false) {
|
||||||
$('#myTabContent').append($(tab_body)); // First load the body
|
$('#myTabContent').append($(tab_body)); // First load the body
|
||||||
|
|||||||
@@ -20,10 +20,10 @@ jQuery(function(){
|
|||||||
function hoverMenu(){
|
function hoverMenu(){
|
||||||
jQuery('ul.nav a.dropdown-toggle').parent().hover(function(){
|
jQuery('ul.nav a.dropdown-toggle').parent().hover(function(){
|
||||||
adjust_height_of_collapsed_nav();
|
adjust_height_of_collapsed_nav();
|
||||||
mi = jQuery(this).addClass('open');
|
var mi = jQuery(this).addClass('open');
|
||||||
mi.children('.dropdown-menu').stop(true, true).delay(200).fadeIn(400);
|
mi.children('.dropdown-menu').stop(true, true).delay(200).fadeIn(400);
|
||||||
}, function(){
|
}, function(){
|
||||||
mi = jQuery(this);
|
var mi = jQuery(this);
|
||||||
mi.children('.dropdown-menu').stop(true, true).delay(200).fadeOut(function(){mi.removeClass('open')});
|
mi.children('.dropdown-menu').stop(true, true).delay(200).fadeOut(function(){mi.removeClass('open')});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,13 +116,15 @@
|
|||||||
|
|
||||||
|
|
||||||
{{elif request.function == 'ccache':}}
|
{{elif request.function == 'ccache':}}
|
||||||
<h2>{{T("Cache")}}</h2>
|
<h2>{{=T("Cache")}}</h2>
|
||||||
<div class="list">
|
|
||||||
|
|
||||||
<div class="list-header">
|
<div class="list-header">
|
||||||
<h3>{{T("Statistics")}}</h3>
|
<h3>{{=T("Statistics")}}</h3>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{if request.env.web2py_runtime_gae:}}
|
||||||
|
{{=BEAUTIFY(total)}}
|
||||||
|
{{else:}}
|
||||||
|
<div class="list">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<h4>{{=T("Overview")}}</h4>
|
<h4>{{=T("Overview")}}</h4>
|
||||||
<p>{{=T.M("Number of entries: **%s**", total['entries'])}}</p>
|
<p>{{=T.M("Number of entries: **%s**", total['entries'])}}</p>
|
||||||
@@ -210,6 +212,8 @@
|
|||||||
{{pass}}
|
{{pass}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{pass}}
|
||||||
|
|
||||||
<div class="list-header">
|
<div class="list-header">
|
||||||
<h3>{{=T("Manage Cache")}}</h3>
|
<h3>{{=T("Manage Cache")}}</h3>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -208,6 +208,9 @@ $(document).on('click', 'a.font_button', function (e) {
|
|||||||
|
|
||||||
<div class='row-fluid'>
|
<div class='row-fluid'>
|
||||||
<div class="right controls btn-toolbar pull-right">
|
<div class="right controls btn-toolbar pull-right">
|
||||||
|
|
||||||
|
{{=LOAD('default', 'editor_sessions', ajax=True, _class='btn-group')}}
|
||||||
|
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<a class="button btn" onclick="$('#files').toggle(); return false" href="#">Files toggle</a>
|
<a class="button btn" onclick="$('#files').toggle(); return false" href="#">Files toggle</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -314,5 +317,28 @@ $(document).ready(function() {
|
|||||||
load_file(datum.link);
|
load_file(datum.link);
|
||||||
$(this).val('');
|
$(this).val('');
|
||||||
});
|
});
|
||||||
|
/* handlers to manage editor sessions
|
||||||
|
*/
|
||||||
|
$(document).on('click', '#save_session', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
var session_name=prompt("Session name","{{=app}}");
|
||||||
|
|
||||||
|
if (session_name!==null) {
|
||||||
|
files = $("[data-path]").map(function(){return $(this).data("path");}).get();
|
||||||
|
data = JSON.stringify({ files: files, session_name:session_name});
|
||||||
|
$.ajaxSetup({contentType: "application/json"});
|
||||||
|
$.web2py.ajax_page("POST", "{{=URL('default', 'editor_sessions')}}", data, 'manage_sessions');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$(document).on('click', '#saved_sessions a[data-files]', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
files = $(this).data('files');
|
||||||
|
array_files = files.split(',');
|
||||||
|
$.each(array_files, function(index, value) {
|
||||||
|
url = "{{=URL('default','edit')}}/" + value;
|
||||||
|
load_file(url);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<!-- end "edit" block -->
|
<!-- end "edit" block -->
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<div class="btn-group" id='manage_sessions'>
|
||||||
|
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">Saved session <span class="caret"></span></a>
|
||||||
|
<ul class="dropdown-menu" id="saved_sessions">
|
||||||
|
{{for name, files in editor_sessions.items():}}
|
||||||
|
<li><a href="" data-files='{{=files}}'>{{=name}}</a></li>
|
||||||
|
{{pass}}
|
||||||
|
<li class="divider"></li>
|
||||||
|
<li><a id="save_session" href="">Save current session</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
@@ -16,6 +16,8 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
pgv = None
|
pgv = None
|
||||||
|
|
||||||
|
is_gae = request.env.web2py_runtime_gae or False
|
||||||
|
|
||||||
# ## critical --- make a copy of the environment
|
# ## critical --- make a copy of the environment
|
||||||
|
|
||||||
global_env = copy.copy(globals())
|
global_env = copy.copy(globals())
|
||||||
@@ -359,36 +361,43 @@ def state():
|
|||||||
|
|
||||||
|
|
||||||
def ccache():
|
def ccache():
|
||||||
cache.ram.initialize()
|
if is_gae:
|
||||||
cache.disk.initialize()
|
form = FORM(
|
||||||
|
P(TAG.BUTTON(T("Clear CACHE?"), _type="submit", _name="yes", _value="yes")))
|
||||||
|
else:
|
||||||
|
cache.ram.initialize()
|
||||||
|
cache.disk.initialize()
|
||||||
|
|
||||||
form = FORM(
|
form = FORM(
|
||||||
P(TAG.BUTTON(
|
P(TAG.BUTTON(
|
||||||
T("Clear CACHE?"), _type="submit", _name="yes", _value="yes")),
|
T("Clear CACHE?"), _type="submit", _name="yes", _value="yes")),
|
||||||
P(TAG.BUTTON(
|
P(TAG.BUTTON(
|
||||||
T("Clear RAM"), _type="submit", _name="ram", _value="ram")),
|
T("Clear RAM"), _type="submit", _name="ram", _value="ram")),
|
||||||
P(TAG.BUTTON(
|
P(TAG.BUTTON(
|
||||||
T("Clear DISK"), _type="submit", _name="disk", _value="disk")),
|
T("Clear DISK"), _type="submit", _name="disk", _value="disk")),
|
||||||
)
|
)
|
||||||
|
|
||||||
if form.accepts(request.vars, session):
|
if form.accepts(request.vars, session):
|
||||||
clear_ram = False
|
|
||||||
clear_disk = False
|
|
||||||
session.flash = ""
|
session.flash = ""
|
||||||
if request.vars.yes:
|
if is_gae:
|
||||||
clear_ram = clear_disk = True
|
if request.vars.yes:
|
||||||
if request.vars.ram:
|
cache.ram.clear()
|
||||||
clear_ram = True
|
session.flash += T("Cache Cleared")
|
||||||
if request.vars.disk:
|
else:
|
||||||
clear_disk = True
|
clear_ram = False
|
||||||
|
clear_disk = False
|
||||||
if clear_ram:
|
if request.vars.yes:
|
||||||
cache.ram.clear()
|
clear_ram = clear_disk = True
|
||||||
session.flash += T("Ram Cleared")
|
if request.vars.ram:
|
||||||
if clear_disk:
|
clear_ram = True
|
||||||
cache.disk.clear()
|
if request.vars.disk:
|
||||||
session.flash += T("Disk Cleared")
|
clear_disk = True
|
||||||
|
if clear_ram:
|
||||||
|
cache.ram.clear()
|
||||||
|
session.flash += T("Ram Cleared")
|
||||||
|
if clear_disk:
|
||||||
|
cache.disk.clear()
|
||||||
|
session.flash += T("Disk Cleared")
|
||||||
redirect(URL(r=request))
|
redirect(URL(r=request))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -414,6 +423,7 @@ def ccache():
|
|||||||
'oldest': time.time(),
|
'oldest': time.time(),
|
||||||
'keys': []
|
'keys': []
|
||||||
}
|
}
|
||||||
|
|
||||||
disk = copy.copy(ram)
|
disk = copy.copy(ram)
|
||||||
total = copy.copy(ram)
|
total = copy.copy(ram)
|
||||||
disk['keys'] = []
|
disk['keys'] = []
|
||||||
@@ -428,72 +438,81 @@ def ccache():
|
|||||||
|
|
||||||
return (hours, minutes, seconds)
|
return (hours, minutes, seconds)
|
||||||
|
|
||||||
for key, value in cache.ram.storage.iteritems():
|
if is_gae:
|
||||||
if isinstance(value, dict):
|
gae_stats = cache.ram.client.get_stats()
|
||||||
ram['hits'] = value['hit_total'] - value['misses']
|
try:
|
||||||
ram['misses'] = value['misses']
|
gae_stats['ratio'] = ((gae_stats['hits'] * 100) /
|
||||||
try:
|
(gae_stats['hits'] + gae_stats['misses']))
|
||||||
ram['ratio'] = ram['hits'] * 100 / value['hit_total']
|
except ZeroDivisionError:
|
||||||
except (KeyError, ZeroDivisionError):
|
gae_stats['ratio'] = T("?")
|
||||||
ram['ratio'] = 0
|
gae_stats['oldest'] = GetInHMS(time.time() - gae_stats['oldest_item_age'])
|
||||||
else:
|
total.update(gae_stats)
|
||||||
if hp:
|
else:
|
||||||
ram['bytes'] += hp.iso(value[1]).size
|
for key, value in cache.ram.storage.iteritems():
|
||||||
ram['objects'] += hp.iso(value[1]).count
|
|
||||||
ram['entries'] += 1
|
|
||||||
if value[0] < ram['oldest']:
|
|
||||||
ram['oldest'] = value[0]
|
|
||||||
ram['keys'].append((key, GetInHMS(time.time() - value[0])))
|
|
||||||
folder = os.path.join(request.folder,'cache')
|
|
||||||
if not os.path.exists(folder):
|
|
||||||
os.mkdir(folder)
|
|
||||||
locker = open(os.path.join(folder, 'cache.lock'), 'a')
|
|
||||||
portalocker.lock(locker, portalocker.LOCK_EX)
|
|
||||||
disk_storage = shelve.open(
|
|
||||||
os.path.join(folder, 'cache.shelve'))
|
|
||||||
try:
|
|
||||||
for key, value in disk_storage.items():
|
|
||||||
if isinstance(value, dict):
|
if isinstance(value, dict):
|
||||||
disk['hits'] = value['hit_total'] - value['misses']
|
ram['hits'] = value['hit_total'] - value['misses']
|
||||||
disk['misses'] = value['misses']
|
ram['misses'] = value['misses']
|
||||||
try:
|
try:
|
||||||
disk['ratio'] = disk['hits'] * 100 / value['hit_total']
|
ram['ratio'] = ram['hits'] * 100 / value['hit_total']
|
||||||
except (KeyError, ZeroDivisionError):
|
except (KeyError, ZeroDivisionError):
|
||||||
disk['ratio'] = 0
|
ram['ratio'] = 0
|
||||||
else:
|
else:
|
||||||
if hp:
|
if hp:
|
||||||
disk['bytes'] += hp.iso(value[1]).size
|
ram['bytes'] += hp.iso(value[1]).size
|
||||||
disk['objects'] += hp.iso(value[1]).count
|
ram['objects'] += hp.iso(value[1]).count
|
||||||
disk['entries'] += 1
|
ram['entries'] += 1
|
||||||
if value[0] < disk['oldest']:
|
if value[0] < ram['oldest']:
|
||||||
disk['oldest'] = value[0]
|
ram['oldest'] = value[0]
|
||||||
disk['keys'].append((key, GetInHMS(time.time() - value[0])))
|
ram['keys'].append((key, GetInHMS(time.time() - value[0])))
|
||||||
|
folder = os.path.join(request.folder,'cache')
|
||||||
|
if not os.path.exists(folder):
|
||||||
|
os.mkdir(folder)
|
||||||
|
locker = open(os.path.join(folder, 'cache.lock'), 'a')
|
||||||
|
portalocker.lock(locker, portalocker.LOCK_EX)
|
||||||
|
disk_storage = shelve.open(
|
||||||
|
os.path.join(folder, 'cache.shelve'))
|
||||||
|
try:
|
||||||
|
for key, value in disk_storage.items():
|
||||||
|
if isinstance(value, dict):
|
||||||
|
disk['hits'] = value['hit_total'] - value['misses']
|
||||||
|
disk['misses'] = value['misses']
|
||||||
|
try:
|
||||||
|
disk['ratio'] = disk['hits'] * 100 / value['hit_total']
|
||||||
|
except (KeyError, ZeroDivisionError):
|
||||||
|
disk['ratio'] = 0
|
||||||
|
else:
|
||||||
|
if hp:
|
||||||
|
disk['bytes'] += hp.iso(value[1]).size
|
||||||
|
disk['objects'] += hp.iso(value[1]).count
|
||||||
|
disk['entries'] += 1
|
||||||
|
if value[0] < disk['oldest']:
|
||||||
|
disk['oldest'] = value[0]
|
||||||
|
disk['keys'].append((key, GetInHMS(time.time() - value[0])))
|
||||||
|
finally:
|
||||||
|
portalocker.unlock(locker)
|
||||||
|
locker.close()
|
||||||
|
disk_storage.close()
|
||||||
|
|
||||||
finally:
|
total['entries'] = ram['entries'] + disk['entries']
|
||||||
portalocker.unlock(locker)
|
total['bytes'] = ram['bytes'] + disk['bytes']
|
||||||
locker.close()
|
total['objects'] = ram['objects'] + disk['objects']
|
||||||
disk_storage.close()
|
total['hits'] = ram['hits'] + disk['hits']
|
||||||
|
total['misses'] = ram['misses'] + disk['misses']
|
||||||
total['entries'] = ram['entries'] + disk['entries']
|
total['keys'] = ram['keys'] + disk['keys']
|
||||||
total['bytes'] = ram['bytes'] + disk['bytes']
|
try:
|
||||||
total['objects'] = ram['objects'] + disk['objects']
|
total['ratio'] = total['hits'] * 100 / (total['hits'] +
|
||||||
total['hits'] = ram['hits'] + disk['hits']
|
|
||||||
total['misses'] = ram['misses'] + disk['misses']
|
|
||||||
total['keys'] = ram['keys'] + disk['keys']
|
|
||||||
try:
|
|
||||||
total['ratio'] = total['hits'] * 100 / (total['hits'] +
|
|
||||||
total['misses'])
|
total['misses'])
|
||||||
except (KeyError, ZeroDivisionError):
|
except (KeyError, ZeroDivisionError):
|
||||||
total['ratio'] = 0
|
total['ratio'] = 0
|
||||||
|
|
||||||
if disk['oldest'] < ram['oldest']:
|
if disk['oldest'] < ram['oldest']:
|
||||||
total['oldest'] = disk['oldest']
|
total['oldest'] = disk['oldest']
|
||||||
else:
|
else:
|
||||||
total['oldest'] = ram['oldest']
|
total['oldest'] = ram['oldest']
|
||||||
|
|
||||||
ram['oldest'] = GetInHMS(time.time() - ram['oldest'])
|
ram['oldest'] = GetInHMS(time.time() - ram['oldest'])
|
||||||
disk['oldest'] = GetInHMS(time.time() - disk['oldest'])
|
disk['oldest'] = GetInHMS(time.time() - disk['oldest'])
|
||||||
total['oldest'] = GetInHMS(time.time() - total['oldest'])
|
total['oldest'] = GetInHMS(time.time() - total['oldest'])
|
||||||
|
|
||||||
def key_table(keys):
|
def key_table(keys):
|
||||||
return TABLE(
|
return TABLE(
|
||||||
@@ -502,9 +521,10 @@ def ccache():
|
|||||||
**dict(_class='cache-keys',
|
**dict(_class='cache-keys',
|
||||||
_style="border-collapse: separate; border-spacing: .5em;"))
|
_style="border-collapse: separate; border-spacing: .5em;"))
|
||||||
|
|
||||||
ram['keys'] = key_table(ram['keys'])
|
if not is_gae:
|
||||||
disk['keys'] = key_table(disk['keys'])
|
ram['keys'] = key_table(ram['keys'])
|
||||||
total['keys'] = key_table(total['keys'])
|
disk['keys'] = key_table(disk['keys'])
|
||||||
|
total['keys'] = key_table(total['keys'])
|
||||||
|
|
||||||
return dict(form=form, total=total,
|
return dict(form=form, total=total,
|
||||||
ram=ram, disk=disk, object_stats=hp != False)
|
ram=ram, disk=disk, object_stats=hp != False)
|
||||||
|
|||||||
@@ -20,10 +20,10 @@ jQuery(function(){
|
|||||||
function hoverMenu(){
|
function hoverMenu(){
|
||||||
jQuery('ul.nav a.dropdown-toggle').parent().hover(function(){
|
jQuery('ul.nav a.dropdown-toggle').parent().hover(function(){
|
||||||
adjust_height_of_collapsed_nav();
|
adjust_height_of_collapsed_nav();
|
||||||
mi = jQuery(this).addClass('open');
|
var mi = jQuery(this).addClass('open');
|
||||||
mi.children('.dropdown-menu').stop(true, true).delay(200).fadeIn(400);
|
mi.children('.dropdown-menu').stop(true, true).delay(200).fadeIn(400);
|
||||||
}, function(){
|
}, function(){
|
||||||
mi = jQuery(this);
|
var mi = jQuery(this);
|
||||||
mi.children('.dropdown-menu').stop(true, true).delay(200).fadeOut(function(){mi.removeClass('open')});
|
mi.children('.dropdown-menu').stop(true, true).delay(200).fadeOut(function(){mi.removeClass('open')});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -116,13 +116,15 @@
|
|||||||
|
|
||||||
|
|
||||||
{{elif request.function == 'ccache':}}
|
{{elif request.function == 'ccache':}}
|
||||||
<h2>{{T("Cache")}}</h2>
|
<h2>{{=T("Cache")}}</h2>
|
||||||
<div class="list">
|
|
||||||
|
|
||||||
<div class="list-header">
|
<div class="list-header">
|
||||||
<h3>{{T("Statistics")}}</h3>
|
<h3>{{=T("Statistics")}}</h3>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{if request.env.web2py_runtime_gae:}}
|
||||||
|
{{=BEAUTIFY(total)}}
|
||||||
|
{{else:}}
|
||||||
|
<div class="list">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<h4>{{=T("Overview")}}</h4>
|
<h4>{{=T("Overview")}}</h4>
|
||||||
<p>{{=T.M("Number of entries: **%s**", total['entries'])}}</p>
|
<p>{{=T.M("Number of entries: **%s**", total['entries'])}}</p>
|
||||||
@@ -210,6 +212,8 @@
|
|||||||
{{pass}}
|
{{pass}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{pass}}
|
||||||
|
|
||||||
<div class="list-header">
|
<div class="list-header">
|
||||||
<h3>{{=T("Manage Cache")}}</h3>
|
<h3>{{=T("Manage Cache")}}</h3>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
pgv = None
|
pgv = None
|
||||||
|
|
||||||
|
is_gae = request.env.web2py_runtime_gae or False
|
||||||
|
|
||||||
# ## critical --- make a copy of the environment
|
# ## critical --- make a copy of the environment
|
||||||
|
|
||||||
global_env = copy.copy(globals())
|
global_env = copy.copy(globals())
|
||||||
@@ -359,36 +361,43 @@ def state():
|
|||||||
|
|
||||||
|
|
||||||
def ccache():
|
def ccache():
|
||||||
cache.ram.initialize()
|
if is_gae:
|
||||||
cache.disk.initialize()
|
form = FORM(
|
||||||
|
P(TAG.BUTTON(T("Clear CACHE?"), _type="submit", _name="yes", _value="yes")))
|
||||||
|
else:
|
||||||
|
cache.ram.initialize()
|
||||||
|
cache.disk.initialize()
|
||||||
|
|
||||||
form = FORM(
|
form = FORM(
|
||||||
P(TAG.BUTTON(
|
P(TAG.BUTTON(
|
||||||
T("Clear CACHE?"), _type="submit", _name="yes", _value="yes")),
|
T("Clear CACHE?"), _type="submit", _name="yes", _value="yes")),
|
||||||
P(TAG.BUTTON(
|
P(TAG.BUTTON(
|
||||||
T("Clear RAM"), _type="submit", _name="ram", _value="ram")),
|
T("Clear RAM"), _type="submit", _name="ram", _value="ram")),
|
||||||
P(TAG.BUTTON(
|
P(TAG.BUTTON(
|
||||||
T("Clear DISK"), _type="submit", _name="disk", _value="disk")),
|
T("Clear DISK"), _type="submit", _name="disk", _value="disk")),
|
||||||
)
|
)
|
||||||
|
|
||||||
if form.accepts(request.vars, session):
|
if form.accepts(request.vars, session):
|
||||||
clear_ram = False
|
|
||||||
clear_disk = False
|
|
||||||
session.flash = ""
|
session.flash = ""
|
||||||
if request.vars.yes:
|
if is_gae:
|
||||||
clear_ram = clear_disk = True
|
if request.vars.yes:
|
||||||
if request.vars.ram:
|
cache.ram.clear()
|
||||||
clear_ram = True
|
session.flash += T("Cache Cleared")
|
||||||
if request.vars.disk:
|
else:
|
||||||
clear_disk = True
|
clear_ram = False
|
||||||
|
clear_disk = False
|
||||||
if clear_ram:
|
if request.vars.yes:
|
||||||
cache.ram.clear()
|
clear_ram = clear_disk = True
|
||||||
session.flash += T("Ram Cleared")
|
if request.vars.ram:
|
||||||
if clear_disk:
|
clear_ram = True
|
||||||
cache.disk.clear()
|
if request.vars.disk:
|
||||||
session.flash += T("Disk Cleared")
|
clear_disk = True
|
||||||
|
if clear_ram:
|
||||||
|
cache.ram.clear()
|
||||||
|
session.flash += T("Ram Cleared")
|
||||||
|
if clear_disk:
|
||||||
|
cache.disk.clear()
|
||||||
|
session.flash += T("Disk Cleared")
|
||||||
redirect(URL(r=request))
|
redirect(URL(r=request))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -414,6 +423,7 @@ def ccache():
|
|||||||
'oldest': time.time(),
|
'oldest': time.time(),
|
||||||
'keys': []
|
'keys': []
|
||||||
}
|
}
|
||||||
|
|
||||||
disk = copy.copy(ram)
|
disk = copy.copy(ram)
|
||||||
total = copy.copy(ram)
|
total = copy.copy(ram)
|
||||||
disk['keys'] = []
|
disk['keys'] = []
|
||||||
@@ -428,72 +438,81 @@ def ccache():
|
|||||||
|
|
||||||
return (hours, minutes, seconds)
|
return (hours, minutes, seconds)
|
||||||
|
|
||||||
for key, value in cache.ram.storage.iteritems():
|
if is_gae:
|
||||||
if isinstance(value, dict):
|
gae_stats = cache.ram.client.get_stats()
|
||||||
ram['hits'] = value['hit_total'] - value['misses']
|
try:
|
||||||
ram['misses'] = value['misses']
|
gae_stats['ratio'] = ((gae_stats['hits'] * 100) /
|
||||||
try:
|
(gae_stats['hits'] + gae_stats['misses']))
|
||||||
ram['ratio'] = ram['hits'] * 100 / value['hit_total']
|
except ZeroDivisionError:
|
||||||
except (KeyError, ZeroDivisionError):
|
gae_stats['ratio'] = T("?")
|
||||||
ram['ratio'] = 0
|
gae_stats['oldest'] = GetInHMS(time.time() - gae_stats['oldest_item_age'])
|
||||||
else:
|
total.update(gae_stats)
|
||||||
if hp:
|
else:
|
||||||
ram['bytes'] += hp.iso(value[1]).size
|
for key, value in cache.ram.storage.iteritems():
|
||||||
ram['objects'] += hp.iso(value[1]).count
|
|
||||||
ram['entries'] += 1
|
|
||||||
if value[0] < ram['oldest']:
|
|
||||||
ram['oldest'] = value[0]
|
|
||||||
ram['keys'].append((key, GetInHMS(time.time() - value[0])))
|
|
||||||
folder = os.path.join(request.folder,'cache')
|
|
||||||
if not os.path.exists(folder):
|
|
||||||
os.mkdir(folder)
|
|
||||||
locker = open(os.path.join(folder, 'cache.lock'), 'a')
|
|
||||||
portalocker.lock(locker, portalocker.LOCK_EX)
|
|
||||||
disk_storage = shelve.open(
|
|
||||||
os.path.join(folder, 'cache.shelve'))
|
|
||||||
try:
|
|
||||||
for key, value in disk_storage.items():
|
|
||||||
if isinstance(value, dict):
|
if isinstance(value, dict):
|
||||||
disk['hits'] = value['hit_total'] - value['misses']
|
ram['hits'] = value['hit_total'] - value['misses']
|
||||||
disk['misses'] = value['misses']
|
ram['misses'] = value['misses']
|
||||||
try:
|
try:
|
||||||
disk['ratio'] = disk['hits'] * 100 / value['hit_total']
|
ram['ratio'] = ram['hits'] * 100 / value['hit_total']
|
||||||
except (KeyError, ZeroDivisionError):
|
except (KeyError, ZeroDivisionError):
|
||||||
disk['ratio'] = 0
|
ram['ratio'] = 0
|
||||||
else:
|
else:
|
||||||
if hp:
|
if hp:
|
||||||
disk['bytes'] += hp.iso(value[1]).size
|
ram['bytes'] += hp.iso(value[1]).size
|
||||||
disk['objects'] += hp.iso(value[1]).count
|
ram['objects'] += hp.iso(value[1]).count
|
||||||
disk['entries'] += 1
|
ram['entries'] += 1
|
||||||
if value[0] < disk['oldest']:
|
if value[0] < ram['oldest']:
|
||||||
disk['oldest'] = value[0]
|
ram['oldest'] = value[0]
|
||||||
disk['keys'].append((key, GetInHMS(time.time() - value[0])))
|
ram['keys'].append((key, GetInHMS(time.time() - value[0])))
|
||||||
|
folder = os.path.join(request.folder,'cache')
|
||||||
|
if not os.path.exists(folder):
|
||||||
|
os.mkdir(folder)
|
||||||
|
locker = open(os.path.join(folder, 'cache.lock'), 'a')
|
||||||
|
portalocker.lock(locker, portalocker.LOCK_EX)
|
||||||
|
disk_storage = shelve.open(
|
||||||
|
os.path.join(folder, 'cache.shelve'))
|
||||||
|
try:
|
||||||
|
for key, value in disk_storage.items():
|
||||||
|
if isinstance(value, dict):
|
||||||
|
disk['hits'] = value['hit_total'] - value['misses']
|
||||||
|
disk['misses'] = value['misses']
|
||||||
|
try:
|
||||||
|
disk['ratio'] = disk['hits'] * 100 / value['hit_total']
|
||||||
|
except (KeyError, ZeroDivisionError):
|
||||||
|
disk['ratio'] = 0
|
||||||
|
else:
|
||||||
|
if hp:
|
||||||
|
disk['bytes'] += hp.iso(value[1]).size
|
||||||
|
disk['objects'] += hp.iso(value[1]).count
|
||||||
|
disk['entries'] += 1
|
||||||
|
if value[0] < disk['oldest']:
|
||||||
|
disk['oldest'] = value[0]
|
||||||
|
disk['keys'].append((key, GetInHMS(time.time() - value[0])))
|
||||||
|
finally:
|
||||||
|
portalocker.unlock(locker)
|
||||||
|
locker.close()
|
||||||
|
disk_storage.close()
|
||||||
|
|
||||||
finally:
|
total['entries'] = ram['entries'] + disk['entries']
|
||||||
portalocker.unlock(locker)
|
total['bytes'] = ram['bytes'] + disk['bytes']
|
||||||
locker.close()
|
total['objects'] = ram['objects'] + disk['objects']
|
||||||
disk_storage.close()
|
total['hits'] = ram['hits'] + disk['hits']
|
||||||
|
total['misses'] = ram['misses'] + disk['misses']
|
||||||
total['entries'] = ram['entries'] + disk['entries']
|
total['keys'] = ram['keys'] + disk['keys']
|
||||||
total['bytes'] = ram['bytes'] + disk['bytes']
|
try:
|
||||||
total['objects'] = ram['objects'] + disk['objects']
|
total['ratio'] = total['hits'] * 100 / (total['hits'] +
|
||||||
total['hits'] = ram['hits'] + disk['hits']
|
|
||||||
total['misses'] = ram['misses'] + disk['misses']
|
|
||||||
total['keys'] = ram['keys'] + disk['keys']
|
|
||||||
try:
|
|
||||||
total['ratio'] = total['hits'] * 100 / (total['hits'] +
|
|
||||||
total['misses'])
|
total['misses'])
|
||||||
except (KeyError, ZeroDivisionError):
|
except (KeyError, ZeroDivisionError):
|
||||||
total['ratio'] = 0
|
total['ratio'] = 0
|
||||||
|
|
||||||
if disk['oldest'] < ram['oldest']:
|
if disk['oldest'] < ram['oldest']:
|
||||||
total['oldest'] = disk['oldest']
|
total['oldest'] = disk['oldest']
|
||||||
else:
|
else:
|
||||||
total['oldest'] = ram['oldest']
|
total['oldest'] = ram['oldest']
|
||||||
|
|
||||||
ram['oldest'] = GetInHMS(time.time() - ram['oldest'])
|
ram['oldest'] = GetInHMS(time.time() - ram['oldest'])
|
||||||
disk['oldest'] = GetInHMS(time.time() - disk['oldest'])
|
disk['oldest'] = GetInHMS(time.time() - disk['oldest'])
|
||||||
total['oldest'] = GetInHMS(time.time() - total['oldest'])
|
total['oldest'] = GetInHMS(time.time() - total['oldest'])
|
||||||
|
|
||||||
def key_table(keys):
|
def key_table(keys):
|
||||||
return TABLE(
|
return TABLE(
|
||||||
@@ -502,9 +521,10 @@ def ccache():
|
|||||||
**dict(_class='cache-keys',
|
**dict(_class='cache-keys',
|
||||||
_style="border-collapse: separate; border-spacing: .5em;"))
|
_style="border-collapse: separate; border-spacing: .5em;"))
|
||||||
|
|
||||||
ram['keys'] = key_table(ram['keys'])
|
if not is_gae:
|
||||||
disk['keys'] = key_table(disk['keys'])
|
ram['keys'] = key_table(ram['keys'])
|
||||||
total['keys'] = key_table(total['keys'])
|
disk['keys'] = key_table(disk['keys'])
|
||||||
|
total['keys'] = key_table(total['keys'])
|
||||||
|
|
||||||
return dict(form=form, total=total,
|
return dict(form=form, total=total,
|
||||||
ram=ram, disk=disk, object_stats=hp != False)
|
ram=ram, disk=disk, object_stats=hp != False)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# coding: utf-8
|
# -*- coding: utf-8 -*-
|
||||||
{
|
{
|
||||||
'!langcode!': 'es',
|
'!langcode!': 'es',
|
||||||
'!langname!': 'Español',
|
'!langname!': 'Español',
|
||||||
@@ -10,6 +10,7 @@
|
|||||||
'%Y-%m-%d %H:%M:%S': '%d/%m/%Y %H:%M:%S',
|
'%Y-%m-%d %H:%M:%S': '%d/%m/%Y %H:%M:%S',
|
||||||
'(something like "it-it")': '(algo como "eso-eso")',
|
'(something like "it-it")': '(algo como "eso-eso")',
|
||||||
'@markmin\x01An error occured, please [[reload %s]] the page': 'Ha ocurrido un error, por favor [[recargar %s]] la página',
|
'@markmin\x01An error occured, please [[reload %s]] the page': 'Ha ocurrido un error, por favor [[recargar %s]] la página',
|
||||||
|
'@markmin\x01Number of entries: **%s**': 'Number of entries: **%s**',
|
||||||
'A new version of web2py is available': 'Hay una nueva versión de web2py disponible',
|
'A new version of web2py is available': 'Hay una nueva versión de web2py disponible',
|
||||||
'A new version of web2py is available: %s': 'Hay una nueva versión de web2py disponible: %s',
|
'A new version of web2py is available: %s': 'Hay una nueva versión de web2py disponible: %s',
|
||||||
'About': 'Acerca de',
|
'About': 'Acerca de',
|
||||||
@@ -91,6 +92,7 @@
|
|||||||
'Database': 'Base de datos',
|
'Database': 'Base de datos',
|
||||||
'Database %s select': 'selección en base de datos %s',
|
'Database %s select': 'selección en base de datos %s',
|
||||||
'database administration': 'administración base de datos',
|
'database administration': 'administración base de datos',
|
||||||
|
'Database Administration (appadmin)': 'Database Administration (appadmin)',
|
||||||
'Date and Time': 'Fecha y Hora',
|
'Date and Time': 'Fecha y Hora',
|
||||||
'db': 'bdd',
|
'db': 'bdd',
|
||||||
'DB Model': 'Modelo BDD',
|
'DB Model': 'Modelo BDD',
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ audio {width:200px}
|
|||||||
.hidden {display:none;visibility:visible}
|
.hidden {display:none;visibility:visible}
|
||||||
.right {float:right; text-align:right}
|
.right {float:right; text-align:right}
|
||||||
.left {float:left; text-align:left}
|
.left {float:left; text-align:left}
|
||||||
.center {width:100; text-align:center; vertical-align:middle}
|
.center {width:100%; text-align:center; vertical-align:middle}
|
||||||
/** end **/
|
/** end **/
|
||||||
|
|
||||||
/* Sticky footer begin */
|
/* Sticky footer begin */
|
||||||
|
|||||||
@@ -20,10 +20,10 @@ jQuery(function(){
|
|||||||
function hoverMenu(){
|
function hoverMenu(){
|
||||||
jQuery('ul.nav a.dropdown-toggle').parent().hover(function(){
|
jQuery('ul.nav a.dropdown-toggle').parent().hover(function(){
|
||||||
adjust_height_of_collapsed_nav();
|
adjust_height_of_collapsed_nav();
|
||||||
mi = jQuery(this).addClass('open');
|
var mi = jQuery(this).addClass('open');
|
||||||
mi.children('.dropdown-menu').stop(true, true).delay(200).fadeIn(400);
|
mi.children('.dropdown-menu').stop(true, true).delay(200).fadeIn(400);
|
||||||
}, function(){
|
}, function(){
|
||||||
mi = jQuery(this);
|
var mi = jQuery(this);
|
||||||
mi.children('.dropdown-menu').stop(true, true).delay(200).fadeOut(function(){mi.removeClass('open')});
|
mi.children('.dropdown-menu').stop(true, true).delay(200).fadeOut(function(){mi.removeClass('open')});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,13 +116,15 @@
|
|||||||
|
|
||||||
|
|
||||||
{{elif request.function == 'ccache':}}
|
{{elif request.function == 'ccache':}}
|
||||||
<h2>{{T("Cache")}}</h2>
|
<h2>{{=T("Cache")}}</h2>
|
||||||
<div class="list">
|
|
||||||
|
|
||||||
<div class="list-header">
|
<div class="list-header">
|
||||||
<h3>{{T("Statistics")}}</h3>
|
<h3>{{=T("Statistics")}}</h3>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{if request.env.web2py_runtime_gae:}}
|
||||||
|
{{=BEAUTIFY(total)}}
|
||||||
|
{{else:}}
|
||||||
|
<div class="list">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<h4>{{=T("Overview")}}</h4>
|
<h4>{{=T("Overview")}}</h4>
|
||||||
<p>{{=T.M("Number of entries: **%s**", total['entries'])}}</p>
|
<p>{{=T.M("Number of entries: **%s**", total['entries'])}}</p>
|
||||||
@@ -210,6 +212,8 @@
|
|||||||
{{pass}}
|
{{pass}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{pass}}
|
||||||
|
|
||||||
<div class="list-header">
|
<div class="list-header">
|
||||||
<h3>{{=T("Manage Cache")}}</h3>
|
<h3>{{=T("Manage Cache")}}</h3>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -48,9 +48,11 @@
|
|||||||
# default_language
|
# default_language
|
||||||
# The language code (for example: en, it-it) optionally appears in the URL following
|
# The language code (for example: en, it-it) optionally appears in the URL following
|
||||||
# the application (which may be omitted). For incoming URLs, the code is copied to
|
# the application (which may be omitted). For incoming URLs, the code is copied to
|
||||||
# request.language; for outgoing URLs it is taken from request.language.
|
# request.uri_language; for outgoing URLs it is taken from request.uri_language.
|
||||||
# If languages=None, language support is disabled.
|
# If languages=None, language support is disabled.
|
||||||
# The default_language, if any, is omitted from the URL.
|
# The default_language, if any, is omitted from the URL.
|
||||||
|
# To use the incoming language in your application, add this line to one of your models files:
|
||||||
|
# if request.uri_language: T.force(request.uri_language)
|
||||||
# root_static: list of static files accessed from root (by default, favicon.ico & robots.txt)
|
# root_static: list of static files accessed from root (by default, favicon.ico & robots.txt)
|
||||||
# (mapped to the default application's static/ directory)
|
# (mapped to the default application's static/ directory)
|
||||||
# Each default (including domain-mapped) application has its own root-static files.
|
# Each default (including domain-mapped) application has its own root-static files.
|
||||||
|
|||||||
+1
-1
@@ -528,7 +528,7 @@ def run_models_in(environment):
|
|||||||
models_to_run = None
|
models_to_run = None
|
||||||
for model in models:
|
for model in models:
|
||||||
if response.models_to_run != models_to_run:
|
if response.models_to_run != models_to_run:
|
||||||
regex = models_to_run = response.models_to_run
|
regex = models_to_run = response.models_to_run[:]
|
||||||
if isinstance(regex, list):
|
if isinstance(regex, list):
|
||||||
regex = re_compile('|'.join(regex))
|
regex = re_compile('|'.join(regex))
|
||||||
if models_to_run:
|
if models_to_run:
|
||||||
|
|||||||
@@ -98,27 +98,32 @@ class RPXAccount(object):
|
|||||||
def login_form(self):
|
def login_form(self):
|
||||||
request = self.request
|
request = self.request
|
||||||
args = request.args
|
args = request.args
|
||||||
if self.embed:
|
rpxform = """
|
||||||
JANRAIN_URL = \
|
<script type="text/javascript">
|
||||||
"https://%s.rpxnow.com/openid/embed?token_url=%s&language_preference=%s"
|
(function() {
|
||||||
rpxform = IFRAME(
|
if (typeof window.janrain !== 'object') window.janrain = {};
|
||||||
_src=JANRAIN_URL % (
|
if (typeof window.janrain.settings !== 'object') window.janrain.settings = {};
|
||||||
self.domain, self.token_url, self.language),
|
janrain.settings.tokenUrl = '%s';
|
||||||
_scrolling="no",
|
function isReady() { janrain.ready = true; };
|
||||||
_frameborder="no",
|
if (document.addEventListener) {
|
||||||
_style="width:400px;height:240px;")
|
document.addEventListener("DOMContentLoaded", isReady, false);
|
||||||
else:
|
} else {
|
||||||
JANRAIN_URL = \
|
window.attachEvent('onload', isReady);
|
||||||
"https://%s.rpxnow.com/openid/v2/signin?token_url=%s"
|
}
|
||||||
rpxform = DIV(SCRIPT(_src="https://rpxnow.com/openid/v2/widget",
|
var e = document.createElement('script');
|
||||||
_type="text/javascript"),
|
e.type = 'text/javascript';
|
||||||
SCRIPT("RPXNOW.overlay = true;",
|
e.id = 'janrainAuthWidget';
|
||||||
"RPXNOW.language_preference = '%s';" % self.language,
|
if (document.location.protocol === 'https:') {
|
||||||
"RPXNOW.realm = '%s';" % self.domain,
|
e.src = 'https://rpxnow.com/js/lib/%s/engage.js';
|
||||||
"RPXNOW.token_url = '%s';" % self.token_url,
|
} else {
|
||||||
"RPXNOW.show();",
|
e.src = 'http://widget-cdn.rpxnow.com/js/lib/%s/engage.js';
|
||||||
_type="text/javascript"))
|
}
|
||||||
return rpxform
|
var s = document.getElementsByTagName('script')[0];
|
||||||
|
s.parentNode.insertBefore(e, s);
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
<div id="janrainEngageEmbed"></div>""" % (self.token_url, self.domain, self.domain)
|
||||||
|
return XML(rpxform)
|
||||||
|
|
||||||
|
|
||||||
def use_janrain(auth, filename='private/janrain.key', **kwargs):
|
def use_janrain(auth, filename='private/janrain.key', **kwargs):
|
||||||
|
|||||||
@@ -266,5 +266,5 @@ def populate_generator(table, default=True, compute=False, contents={}):
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
ell = Learner()
|
ell = Learner()
|
||||||
ell.loadd(eval(IUP))
|
ell.loadd(IUP)
|
||||||
print ell.generate(1000, prefix=None)
|
print ell.generate(1000, prefix=None)
|
||||||
|
|||||||
+5
-2
@@ -8189,8 +8189,8 @@ def index():
|
|||||||
limits = (offset,long(vars.get('limit',None) or 1000)+offset)
|
limits = (offset,long(vars.get('limit',None) or 1000)+offset)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
return Row({'status':400,'error':'invalid limits','response':None})
|
return Row({'status':400,'error':'invalid limits','response':None})
|
||||||
if count > limits[1]-limits[0]:
|
#if count > limits[1]-limits[0]:
|
||||||
return Row({'status':400,'error':'too many records','response':None})
|
# return Row({'status':400,'error':'too many records','response':None})
|
||||||
try:
|
try:
|
||||||
response = dbset.select(limitby=limits,orderby=orderby,*fields)
|
response = dbset.select(limitby=limits,orderby=orderby,*fields)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
@@ -8453,6 +8453,9 @@ def index():
|
|||||||
columns = adapter.cursor.description
|
columns = adapter.cursor.description
|
||||||
# reduce the column info down to just the field names
|
# reduce the column info down to just the field names
|
||||||
fields = colnames or [f[0] for f in columns]
|
fields = colnames or [f[0] for f in columns]
|
||||||
|
if len(fields) != len(set(fields)):
|
||||||
|
raise RuntimeError("Result set includes duplicate column names. Specify unique column names using the 'colnames' argument")
|
||||||
|
|
||||||
# will hold our finished resultset in a list
|
# will hold our finished resultset in a list
|
||||||
data = adapter._fetchall()
|
data = adapter._fetchall()
|
||||||
# convert the list for each row into a dictionary so it's
|
# convert the list for each row into a dictionary so it's
|
||||||
|
|||||||
+2
-1
@@ -3204,7 +3204,8 @@ class ExporterHTML(ExportClass):
|
|||||||
ExportClass.__init__(self, rows)
|
ExportClass.__init__(self, rows)
|
||||||
|
|
||||||
def export(self):
|
def export(self):
|
||||||
return '<html>\n<head>\n<meta http-equiv="content-type" content="text/html; charset=UTF-8" />\n</head>\n<body>\n%s\n</body>\n</html>' % (self.rows.xml() or '')
|
xml = self.rows.xml() if self.rows else ''
|
||||||
|
return '<html>\n<head>\n<meta http-equiv="content-type" content="text/html; charset=UTF-8" />\n</head>\n<body>\n%s\n</body>\n</html>' % (xml or '')
|
||||||
|
|
||||||
class ExporterXML(ExportClass):
|
class ExporterXML(ExportClass):
|
||||||
label = 'XML'
|
label = 'XML'
|
||||||
|
|||||||
+2
-2
@@ -2112,7 +2112,7 @@ class Auth(object):
|
|||||||
success = False
|
success = False
|
||||||
if row:
|
if row:
|
||||||
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.fields else 'email'
|
||||||
# If ticket is a service Ticket and RENEW flag respected
|
# If ticket is a service Ticket and RENEW flag respected
|
||||||
if ticket[0:3] == 'ST-' and \
|
if ticket[0:3] == 'ST-' and \
|
||||||
not ((row.renew and renew) ^ renew):
|
not ((row.renew and renew) ^ renew):
|
||||||
@@ -5893,7 +5893,7 @@ class Wiki(object):
|
|||||||
class Config(object):
|
class Config(object):
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
filename,
|
filename,
|
||||||
section,
|
section,
|
||||||
default_values={}
|
default_values={}
|
||||||
):
|
):
|
||||||
|
|||||||
+1
-1
@@ -458,7 +458,7 @@ class IS_IN_SET(Validator):
|
|||||||
|
|
||||||
|
|
||||||
regex1 = re.compile('\w+\.\w+')
|
regex1 = re.compile('\w+\.\w+')
|
||||||
regex2 = re.compile('%\((?P<name>[^\)]+)\)s')
|
regex2 = re.compile('%\((?P<name>[^\)]+)\)(\d*\.\d*)?[a-zA-Z]')
|
||||||
|
|
||||||
|
|
||||||
class IS_IN_DB(Validator):
|
class IS_IN_DB(Validator):
|
||||||
|
|||||||
Reference in New Issue
Block a user