Merge branch 'master' of github.com:web2py/web2py
This commit is contained in:
@@ -963,8 +963,7 @@ def edit_language():
|
||||
form = SPAN(strings['__corrupted__'], _class='error')
|
||||
return dict(filename=filename, form=form)
|
||||
|
||||
keys = sorted(strings.keys(), lambda x, y: cmp(
|
||||
unicode(x, 'utf-8').lower(), unicode(y, 'utf-8').lower()))
|
||||
keys = sorted(strings.keys(), key=lambda x: to_native(x).lower())
|
||||
rows = []
|
||||
rows.append(H2(T('Original/Translation')))
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
'%s %%{row} deleted': '%s %%{fila} %%{eliminada}',
|
||||
'%s %%{row} updated': '%s %%{fila} %%{actualizada}',
|
||||
'%s selected': '%s %%{seleccionado}',
|
||||
'%Y-%m-%d': '%d/%m/%A',
|
||||
'%Y-%m-%d %H:%M:%S': '%d/%m/%A %H:%M:%S',
|
||||
'%Y-%m-%d': '%d/%m/%Y',
|
||||
'%Y-%m-%d %H:%M:%S': '%d/%m/%Y %H:%M:%S',
|
||||
'(**%.0d MB**)': '(**%.0d MB**)',
|
||||
'(something like "it-it")': '(algo como "it-it")',
|
||||
'**%(items)s** %%{item(items)}, **%(bytes)s** %%{byte(bytes)}': '**%(items)s** %%{item(items)}, **%(bytes)s** %%{byte(bytes)}',
|
||||
|
||||
@@ -130,7 +130,7 @@ response.google_analytics_id = configuration.get('google.analytics_id')
|
||||
# -------------------------------------------------------------------------
|
||||
if configuration.get('scheduler.enabled'):
|
||||
from gluon.scheduler import Scheduler
|
||||
scheduler = Scheduler(db, heartbeat=configure.get('heartbeat'))
|
||||
scheduler = Scheduler(db, heartbeat=configuration.get('heartbeat'))
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Define your tables below (or better in another model file) for example
|
||||
|
||||
+4
-1
@@ -10,6 +10,10 @@ environment:
|
||||
COVERAGE_PROCESS_START: gluon/tests/coverage.ini
|
||||
PYTHON_ARCH: "64"
|
||||
|
||||
- PYTHON: "C:/Python36"
|
||||
COVERAGE_PROCESS_START: gluon/tests/coverage.ini
|
||||
PYTHON_ARCH: "64"
|
||||
|
||||
clone_depth: 50
|
||||
|
||||
init:
|
||||
@@ -20,7 +24,6 @@ install:
|
||||
- python -m ensurepip
|
||||
- pip install codecov
|
||||
- git submodule update --init --recursive
|
||||
- pip install pycrypto
|
||||
# Check that we have the expected version and architecture for Python
|
||||
- "python --version"
|
||||
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
|
||||
|
||||
+2
-2
@@ -26,7 +26,7 @@ if PY2:
|
||||
from email.MIMEText import MIMEText
|
||||
from email.Charset import add_charset, QP as charset_QP
|
||||
from urllib import FancyURLopener, urlencode, urlopen
|
||||
from urllib import quote as urllib_quote, unquote as urllib_unquote
|
||||
from urllib import quote as urllib_quote, unquote as urllib_unquote, quote_plus as urllib_quote_plus
|
||||
from string import maketrans
|
||||
from types import ClassType
|
||||
import cgi
|
||||
@@ -96,7 +96,7 @@ else:
|
||||
from email.header import Header
|
||||
from email.charset import Charset, add_charset, QP as charset_QP
|
||||
from urllib.request import FancyURLopener, urlopen
|
||||
from urllib.parse import quote as urllib_quote, unquote as urllib_unquote, urlencode
|
||||
from urllib.parse import quote as urllib_quote, unquote as urllib_unquote, urlencode, quote_plus as urllib_quote_plus
|
||||
from http import cookiejar as cookielib
|
||||
from xmlrpc.client import ProtocolError
|
||||
import html # warning, this is the python3 module and not the web2py html module
|
||||
|
||||
+7
-6
@@ -183,12 +183,13 @@ def serve_controller(request, response, session):
|
||||
response._view_environment.update(page)
|
||||
page = run_view_in(response._view_environment)
|
||||
|
||||
# logic to garbage collect after exec, not always, once every 100 requests
|
||||
global requests
|
||||
requests = ('requests' in globals()) and (requests + 1) % 100 or 0
|
||||
if not requests:
|
||||
gc.collect()
|
||||
# end garbage collection logic
|
||||
if not request.env.web2py_disable_garbage_collect:
|
||||
# logic to garbage collect after exec, not always, once every 100 requests
|
||||
global requests
|
||||
requests = ('requests' in globals()) and (requests + 1) % 100 or 0
|
||||
if not requests:
|
||||
gc.collect()
|
||||
# end garbage collection logic
|
||||
|
||||
# ##################################################
|
||||
# set default headers it not set
|
||||
|
||||
+4
-5
@@ -22,12 +22,11 @@ import re
|
||||
import logging
|
||||
import traceback
|
||||
import threading
|
||||
import urllib
|
||||
from gluon.storage import Storage, List
|
||||
from gluon.http import HTTP
|
||||
from gluon.fileutils import abspath, read_file
|
||||
from gluon.settings import global_settings
|
||||
from gluon._compat import urllib_unquote, urllib_quote, iteritems, xrange
|
||||
from gluon._compat import urllib_unquote, urllib_quote, iteritems, xrange, urllib_quote_plus
|
||||
|
||||
isdir = os.path.isdir
|
||||
isfile = os.path.isfile
|
||||
@@ -235,7 +234,7 @@ def try_rewrite_on_error(http_response, request, environ, ticket=None):
|
||||
path_info, query_string = uri, ''
|
||||
query_string += \
|
||||
'code=%s&ticket=%s&requested_uri=%s&request_url=%s' % \
|
||||
(status, ticket, urllib.quote_plus(
|
||||
(status, ticket, urllib_quote_plus(
|
||||
request.env.request_uri), request.url)
|
||||
if uri.startswith('http://') or uri.startswith('https://'):
|
||||
# make up a response
|
||||
@@ -270,12 +269,12 @@ def try_redirect_on_error(http_object, request, ticket=None):
|
||||
elif '?' in redir:
|
||||
url = '%s&code=%s&ticket=%s&requested_uri=%s&request_url=%s' % \
|
||||
(redir, status, ticket,
|
||||
urllib.quote_plus(request.env.request_uri),
|
||||
urllib_quote_plus(request.env.request_uri),
|
||||
request.url)
|
||||
else:
|
||||
url = '%s?code=%s&ticket=%s&requested_uri=%s&request_url=%s' % \
|
||||
(redir, status, ticket,
|
||||
urllib.quote_plus(request.env.request_uri),
|
||||
urllib_quote_plus(request.env.request_uri),
|
||||
request.url)
|
||||
return HTTP(303, 'You are being redirected <a href="%s">here</a>' % url, Location=url)
|
||||
return http_object
|
||||
|
||||
+3
-3
@@ -2498,9 +2498,9 @@ class Auth(AuthAPI):
|
||||
success = True
|
||||
|
||||
def build_response(body):
|
||||
return '<?xml version="1.0" encoding="UTF-8"?>\n' +\
|
||||
TAG['cas:serviceResponse'](
|
||||
body, **{'_xmlns:cas': 'http://www.yale.edu/tp/cas'}).xml()
|
||||
xml_body = to_native(TAG['cas:serviceResponse'](
|
||||
body, **{'_xmlns:cas': 'http://www.yale.edu/tp/cas'}).xml())
|
||||
return '<?xml version="1.0" encoding="UTF-8"?>\n' + xml_body
|
||||
if success:
|
||||
if version == 1:
|
||||
message = 'yes\n%s' % user[userfield]
|
||||
|
||||
Reference in New Issue
Block a user