Merge branch 'master' of github.com:web2py/web2py

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