Merge branch 'master' of github.com:web2py/web2py
This commit is contained in:
@@ -15,7 +15,7 @@ from gluon.utils import web2py_uuid
|
|||||||
from gluon.tools import Config
|
from gluon.tools import Config
|
||||||
from gluon.compileapp import find_exposed_functions
|
from gluon.compileapp import find_exposed_functions
|
||||||
from glob import glob
|
from glob import glob
|
||||||
from pydal._compat import iteritems, PY2, pickle, xrange, urlopen, to_bytes, StringIO, to_native
|
from gluon._compat import iteritems, PY2, pickle, xrange, urlopen, to_bytes, StringIO, to_native
|
||||||
import shutil
|
import shutil
|
||||||
import platform
|
import platform
|
||||||
|
|
||||||
@@ -1087,11 +1087,11 @@ def design():
|
|||||||
redirect(URL('design', args=app))
|
redirect(URL('design', args=app))
|
||||||
else:
|
else:
|
||||||
session.flash = \
|
session.flash = \
|
||||||
T('unable to create application "%s"', request.vars.filename)
|
T('unable to install plugin "%s"', filename)
|
||||||
redirect(URL(r=request))
|
redirect(URL(r=request, args=app))
|
||||||
elif isinstance(request.vars.pluginfile, str):
|
elif isinstance(request.vars.pluginfile, str):
|
||||||
session.flash = T('plugin not specified')
|
session.flash = T('plugin not specified')
|
||||||
redirect(URL(r=request))
|
redirect(URL(r=request, args=app))
|
||||||
|
|
||||||
# If we have only pyc files it means that
|
# If we have only pyc files it means that
|
||||||
# we cannot design
|
# we cannot design
|
||||||
|
|||||||
@@ -129,7 +129,7 @@
|
|||||||
<li>You can create an app with a name that already exists.</li>
|
<li>You can create an app with a name that already exists.</li>
|
||||||
<li>If you do not have an email server set email server to "logging".</li>
|
<li>If you do not have an email server set email server to "logging".</li>
|
||||||
<li>If you want to use Janrain Engage for login: 1) Sign up for a <a href="http://www.janrain.com/products/engage">Janrain Engage</a> account; 2) Register you hostname, domain, and obtain an api key; 3) Set Login Config above to "domain:api_key".</li>
|
<li>If you want to use Janrain Engage for login: 1) Sign up for a <a href="http://www.janrain.com/products/engage">Janrain Engage</a> account; 2) Register you hostname, domain, and obtain an api key; 3) Set Login Config above to "domain:api_key".</li>
|
||||||
<li>ATTENTION: you can use the wizard to download plugins BUT we cannot guarantee the stability or backward compatibility of plugins. Moreover plugins may conflict with each other. Anyway, we do recommend installing plugin "wiki" with adds CMS like capabilities to your app.</li>
|
<li>ATTENTION: you can use the wizard to download plugins BUT we cannot guarantee the stability or backward compatibility of plugins. Moreover plugins may conflict with each other. Anyway, we do recommend installing plugin "wiki" which adds CMS-like capabilities to your app.</li>
|
||||||
</ul>
|
</ul>
|
||||||
{{elif request.function=='step2':}}
|
{{elif request.function=='step2':}}
|
||||||
<ul class="unstyled">
|
<ul class="unstyled">
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import datetime
|
|||||||
import copy
|
import copy
|
||||||
import gluon.contenttype
|
import gluon.contenttype
|
||||||
import gluon.fileutils
|
import gluon.fileutils
|
||||||
from pydal._compat import iteritems
|
from gluon._compat import iteritems
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import pygraphviz as pgv
|
import pygraphviz as pgv
|
||||||
|
|||||||
@@ -0,0 +1,157 @@
|
|||||||
|
import sys
|
||||||
|
import hashlib
|
||||||
|
import os
|
||||||
|
|
||||||
|
PY2 = sys.version_info[0] == 2
|
||||||
|
|
||||||
|
_identity = lambda x: x
|
||||||
|
|
||||||
|
if PY2:
|
||||||
|
import cPickle as pickle
|
||||||
|
from cStringIO import StringIO
|
||||||
|
import copy_reg as copyreg
|
||||||
|
from HTMLParser import HTMLParser
|
||||||
|
import urlparse
|
||||||
|
from htmlentitydefs import entitydefs, name2codepoint
|
||||||
|
import __builtin__ as builtin
|
||||||
|
import thread
|
||||||
|
import Cookie
|
||||||
|
import urllib2
|
||||||
|
import Queue
|
||||||
|
import ConfigParser as configparser
|
||||||
|
from email.MIMEBase import MIMEBase
|
||||||
|
from email.Header import Header
|
||||||
|
from email import Encoders, Charset
|
||||||
|
from email.MIMEMultipart import MIMEMultipart
|
||||||
|
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 string import maketrans
|
||||||
|
from types import ClassType
|
||||||
|
import cgi
|
||||||
|
import cookielib
|
||||||
|
BytesIO = StringIO
|
||||||
|
reduce = reduce
|
||||||
|
hashlib_md5 = hashlib.md5
|
||||||
|
iterkeys = lambda d: d.iterkeys()
|
||||||
|
itervalues = lambda d: d.itervalues()
|
||||||
|
iteritems = lambda d: d.iteritems()
|
||||||
|
integer_types = (int, long)
|
||||||
|
string_types = (str, unicode)
|
||||||
|
text_type = unicode
|
||||||
|
basestring = basestring
|
||||||
|
xrange = xrange
|
||||||
|
long = long
|
||||||
|
unichr = unichr
|
||||||
|
unicodeT = unicode
|
||||||
|
|
||||||
|
def implements_bool(cls):
|
||||||
|
cls.__nonzero__ = cls.__bool__
|
||||||
|
del cls.__bool__
|
||||||
|
return cls
|
||||||
|
|
||||||
|
def implements_iterator(cls):
|
||||||
|
cls.next = cls.__next__
|
||||||
|
del cls.__next__
|
||||||
|
return cls
|
||||||
|
|
||||||
|
def to_bytes(obj, charset='utf-8', errors='strict'):
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
if isinstance(obj, (bytes, bytearray, buffer)):
|
||||||
|
return bytes(obj)
|
||||||
|
if isinstance(obj, unicode):
|
||||||
|
return obj.encode(charset, errors)
|
||||||
|
raise TypeError('Expected bytes')
|
||||||
|
|
||||||
|
def to_native(obj, charset='utf8', errors='strict'):
|
||||||
|
if obj is None or isinstance(obj, str):
|
||||||
|
return obj
|
||||||
|
return obj.encode(charset, errors)
|
||||||
|
|
||||||
|
|
||||||
|
else:
|
||||||
|
import pickle
|
||||||
|
from io import StringIO, BytesIO
|
||||||
|
import copyreg
|
||||||
|
from functools import reduce
|
||||||
|
from html.parser import HTMLParser
|
||||||
|
from http import cookies as Cookie
|
||||||
|
from urllib import parse as urlparse
|
||||||
|
from urllib import request as urllib2
|
||||||
|
from html.entities import entitydefs, name2codepoint
|
||||||
|
import builtins as builtin
|
||||||
|
import _thread as thread
|
||||||
|
import configparser
|
||||||
|
import queue as Queue
|
||||||
|
from email.mime.base import MIMEBase
|
||||||
|
from email.mime.multipart import MIMEMultipart
|
||||||
|
from email.mime.text import MIMEText
|
||||||
|
from email import encoders as Encoders
|
||||||
|
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 http import cookiejar as cookielib
|
||||||
|
import html # warning, this is the python3 module and not the web2py html module
|
||||||
|
hashlib_md5 = lambda s: hashlib.md5(bytes(s, 'utf8'))
|
||||||
|
iterkeys = lambda d: iter(d.keys())
|
||||||
|
itervalues = lambda d: iter(d.values())
|
||||||
|
iteritems = lambda d: iter(d.items())
|
||||||
|
integer_types = (int,)
|
||||||
|
string_types = (str,)
|
||||||
|
text_type = str
|
||||||
|
basestring = str
|
||||||
|
xrange = range
|
||||||
|
long = int
|
||||||
|
unichr = chr
|
||||||
|
unicodeT = str
|
||||||
|
maketrans = str.maketrans
|
||||||
|
ClassType = type
|
||||||
|
|
||||||
|
implements_iterator = _identity
|
||||||
|
implements_bool = _identity
|
||||||
|
|
||||||
|
def to_bytes(obj, charset='utf-8', errors='strict'):
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
if isinstance(obj, (bytes, bytearray, memoryview)):
|
||||||
|
return bytes(obj)
|
||||||
|
if isinstance(obj, str):
|
||||||
|
return obj.encode(charset, errors)
|
||||||
|
raise TypeError('Expected bytes')
|
||||||
|
|
||||||
|
def to_native(obj, charset='utf8', errors='strict'):
|
||||||
|
if obj is None or isinstance(obj, str):
|
||||||
|
return obj
|
||||||
|
return obj.decode(charset, errors)
|
||||||
|
|
||||||
|
|
||||||
|
def with_metaclass(meta, *bases):
|
||||||
|
"""Create a base class with a metaclass."""
|
||||||
|
# This requires a bit of explanation: the basic idea is to make a dummy
|
||||||
|
# metaclass for one level of class instantiation that replaces itself with
|
||||||
|
# the actual metaclass.
|
||||||
|
class metaclass(meta):
|
||||||
|
__call__ = type.__call__
|
||||||
|
__init__ = type.__init__
|
||||||
|
|
||||||
|
def __new__(cls, name, this_bases, d):
|
||||||
|
if this_bases is None:
|
||||||
|
return type.__new__(cls, name, (), d)
|
||||||
|
return meta(name, bases, d)
|
||||||
|
return metaclass('temporary_class', None, {})
|
||||||
|
|
||||||
|
|
||||||
|
def to_unicode(obj, charset='utf-8', errors='strict'):
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
if not isinstance(obj, bytes):
|
||||||
|
return text_type(obj)
|
||||||
|
return obj.decode(charset, errors)
|
||||||
|
|
||||||
|
|
||||||
|
# shortcuts
|
||||||
|
pjoin = os.path.join
|
||||||
|
exists = os.path.exists
|
||||||
+1
-1
@@ -22,7 +22,7 @@ from gluon.fileutils import read_file, write_file, parse_version
|
|||||||
from gluon.restricted import RestrictedError
|
from gluon.restricted import RestrictedError
|
||||||
from gluon.settings import global_settings
|
from gluon.settings import global_settings
|
||||||
from gluon.cache import CacheOnDisk
|
from gluon.cache import CacheOnDisk
|
||||||
from pydal._compat import urlopen, to_native
|
from gluon._compat import urlopen, to_native
|
||||||
|
|
||||||
if not global_settings.web2py_runtime_gae:
|
if not global_settings.web2py_runtime_gae:
|
||||||
import site
|
import site
|
||||||
|
|||||||
+1
-1
@@ -40,7 +40,7 @@ except ImportError:
|
|||||||
have_settings = False
|
have_settings = False
|
||||||
|
|
||||||
from pydal.contrib import portalocker
|
from pydal.contrib import portalocker
|
||||||
from pydal._compat import pickle, thread, to_bytes, to_native, hashlib_md5
|
from gluon._compat import pickle, thread, to_bytes, to_native, hashlib_md5
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import psutil
|
import psutil
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@ Note:
|
|||||||
|
|
||||||
from os import stat
|
from os import stat
|
||||||
from gluon.fileutils import read_file
|
from gluon.fileutils import read_file
|
||||||
from pydal._compat import thread
|
from gluon._compat import thread
|
||||||
|
|
||||||
cfs = {} # for speed-up
|
cfs = {} # for speed-up
|
||||||
cfs_lock = thread.allocate_lock() # and thread safety
|
cfs_lock = thread.allocate_lock() # and thread safety
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@ import fnmatch
|
|||||||
import os
|
import os
|
||||||
import copy
|
import copy
|
||||||
import random
|
import random
|
||||||
from pydal._compat import builtin, PY2, unicodeT, to_native, to_bytes, iteritems, basestring, reduce, xrange, long
|
from gluon._compat import builtin, PY2, unicodeT, to_native, to_bytes, iteritems, basestring, reduce, xrange, long
|
||||||
from gluon.storage import Storage, List
|
from gluon.storage import Storage, List
|
||||||
from gluon.template import parse_template
|
from gluon.template import parse_template
|
||||||
from gluon.restricted import restricted, compile2
|
from gluon.restricted import restricted, compile2
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ Additions:
|
|||||||
- .pickle: application/python-pickle
|
- .pickle: application/python-pickle
|
||||||
- .w2p': application/w2p
|
- .w2p': application/w2p
|
||||||
"""
|
"""
|
||||||
from pydal._compat import to_native
|
from gluon._compat import to_native
|
||||||
|
|
||||||
__all__ = ['contenttype']
|
__all__ = ['contenttype']
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ is restarted (or reload=True is passed).
|
|||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from pydal._compat import thread, configparser
|
from gluon._compat import thread, configparser
|
||||||
from gluon.globals import current
|
from gluon.globals import current
|
||||||
|
|
||||||
locker = thread.allocate_lock()
|
locker = thread.allocate_lock()
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ revision3.com
|
|||||||
viddler.com
|
viddler.com
|
||||||
"""
|
"""
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
from pydal._compat import FancyURLopener, urllib_quote
|
from gluon._compat import FancyURLopener, urllib_quote
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import cgi
|
import cgi
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import re
|
import re
|
||||||
import urllib
|
import urllib
|
||||||
from pydal._compat import maketrans, urllib_quote, unicodeT, to_bytes, to_native, xrange
|
from gluon._compat import maketrans, urllib_quote, unicodeT, to_bytes, to_native, xrange
|
||||||
from gluon.utils import local_html_escape as escape
|
from gluon.utils import local_html_escape as escape
|
||||||
from ast import parse as ast_parse
|
from ast import parse as ast_parse
|
||||||
import ast
|
import ast
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
An interactive, stateful AJAX shell that runs Python code on the server.
|
An interactive, stateful AJAX shell that runs Python code on the server.
|
||||||
"""
|
"""
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
from pydal._compat import ClassType, pickle, StringIO
|
from gluon._compat import ClassType, pickle, StringIO
|
||||||
import logging
|
import logging
|
||||||
import new
|
import new
|
||||||
import sys
|
import sys
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ mostly for testing purposes
|
|||||||
Some examples at the bottom.
|
Some examples at the bottom.
|
||||||
"""
|
"""
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
from pydal._compat import urllib2, cookielib, iteritems, to_native, urlencode, to_bytes
|
from gluon._compat import urllib2, cookielib, iteritems, to_native, urlencode, to_bytes
|
||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
Support for smart import syntax for web2py applications
|
Support for smart import syntax for web2py applications
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
"""
|
"""
|
||||||
from pydal._compat import builtin, unicodeT, PY2, to_native
|
from gluon._compat import builtin, unicodeT, PY2, to_native
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import threading
|
import threading
|
||||||
|
|||||||
+1
-1
@@ -14,7 +14,7 @@ Debugger support classes
|
|||||||
import logging
|
import logging
|
||||||
import pdb
|
import pdb
|
||||||
import sys
|
import sys
|
||||||
from pydal._compat import Queue
|
from gluon._compat import Queue
|
||||||
|
|
||||||
logger = logging.getLogger("web2py")
|
logger = logging.getLogger("web2py")
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@ import logging
|
|||||||
from gluon.http import HTTP
|
from gluon.http import HTTP
|
||||||
from gzip import open as gzopen
|
from gzip import open as gzopen
|
||||||
from gluon.recfile import generate
|
from gluon.recfile import generate
|
||||||
from pydal._compat import PY2
|
from gluon._compat import PY2
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
'parse_version',
|
'parse_version',
|
||||||
|
|||||||
+2
-2
@@ -13,7 +13,7 @@ Contains the classes for the global used variables:
|
|||||||
- Session
|
- Session
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from pydal._compat import pickle, StringIO, copyreg, Cookie, urlparse, PY2, iteritems, to_unicode, to_native, unicodeT
|
from gluon._compat import pickle, StringIO, copyreg, Cookie, urlparse, PY2, iteritems, to_unicode, to_native, unicodeT
|
||||||
from gluon.storage import Storage, List
|
from gluon.storage import Storage, List
|
||||||
from gluon.streamer import streamer, stream_file_or_304_or_206, DEFAULT_CHUNK_SIZE
|
from gluon.streamer import streamer, stream_file_or_304_or_206, DEFAULT_CHUNK_SIZE
|
||||||
from gluon.contenttype import contenttype
|
from gluon.contenttype import contenttype
|
||||||
@@ -436,7 +436,7 @@ class Response(Storage):
|
|||||||
self._vars.update(b)
|
self._vars.update(b)
|
||||||
self._view_environment.update(self._vars)
|
self._view_environment.update(self._vars)
|
||||||
if view:
|
if view:
|
||||||
from pydal._compat import StringIO
|
from gluon._compat import StringIO
|
||||||
(obody, oview) = (self.body, self.view)
|
(obody, oview) = (self.body, self.view)
|
||||||
(self.body, self.view) = (StringIO(), view)
|
(self.body, self.view) = (StringIO(), view)
|
||||||
run_view_in(self._view_environment)
|
run_view_in(self._view_environment)
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@
|
|||||||
| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
|
| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
|
||||||
"""
|
"""
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
from pydal._compat import xrange
|
from gluon._compat import xrange
|
||||||
from gluon.utils import local_html_escape
|
from gluon.utils import local_html_escape
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ import urllib
|
|||||||
import base64
|
import base64
|
||||||
from gluon import sanitizer, decoder
|
from gluon import sanitizer, decoder
|
||||||
import itertools
|
import itertools
|
||||||
from pydal._compat import reduce, pickle, copyreg, HTMLParser, name2codepoint, iteritems, unichr, unicodeT, urllib_quote, to_bytes, to_native, to_unicode, basestring, urlencode, implements_bool
|
from gluon._compat import reduce, pickle, copyreg, HTMLParser, name2codepoint, iteritems, unichr, unicodeT, urllib_quote, to_bytes, to_native, to_unicode, basestring, urlencode, implements_bool
|
||||||
from gluon.utils import local_html_escape
|
from gluon.utils import local_html_escape
|
||||||
import marshal
|
import marshal
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ HTTP statuses helpers
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
from pydal._compat import iteritems
|
from gluon._compat import iteritems
|
||||||
|
|
||||||
__all__ = ['HTTP', 'redirect']
|
__all__ = ['HTTP', 'redirect']
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@ from threading import RLock
|
|||||||
from gluon.utf8 import Utf8
|
from gluon.utf8 import Utf8
|
||||||
from gluon.utils import local_html_escape
|
from gluon.utils import local_html_escape
|
||||||
|
|
||||||
from pydal._compat import copyreg, PY2, maketrans, iterkeys, unicodeT, to_unicode, to_bytes, iteritems, to_native, pjoin
|
from gluon._compat import copyreg, PY2, maketrans, iterkeys, unicodeT, to_unicode, to_bytes, iteritems, to_native, pjoin
|
||||||
from pydal.contrib.portalocker import read_locked, LockedFile
|
from pydal.contrib.portalocker import read_locked, LockedFile
|
||||||
|
|
||||||
from gluon.fileutils import listdir
|
from gluon.fileutils import listdir
|
||||||
|
|||||||
+1
-1
@@ -25,7 +25,7 @@ import socket
|
|||||||
import random
|
import random
|
||||||
import string
|
import string
|
||||||
|
|
||||||
from pydal._compat import Cookie, urllib2
|
from gluon._compat import Cookie, urllib2
|
||||||
#from thread import allocate_lock
|
#from thread import allocate_lock
|
||||||
|
|
||||||
from gluon.fileutils import abspath, write_file
|
from gluon.fileutils import abspath, write_file
|
||||||
|
|||||||
+1
-1
Submodule gluon/packages/dal updated: 79ec4e99d0...77e0d3f386
+1
-1
@@ -10,7 +10,7 @@ Generates names for cache and session files
|
|||||||
--------------------------------------------
|
--------------------------------------------
|
||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
from pydal._compat import builtin
|
from gluon._compat import builtin
|
||||||
|
|
||||||
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:
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ Restricted environment to execute application's code
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
from pydal._compat import pickle, ClassType
|
from gluon._compat import pickle, ClassType
|
||||||
import traceback
|
import traceback
|
||||||
import types
|
import types
|
||||||
import os
|
import os
|
||||||
|
|||||||
+1
-1
@@ -27,7 +27,7 @@ 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 pydal._compat import urllib_unquote, urllib_quote, iteritems, xrange
|
from gluon._compat import urllib_unquote, urllib_quote, iteritems, xrange
|
||||||
|
|
||||||
isdir = os.path.isdir
|
isdir = os.path.isdir
|
||||||
isfile = os.path.isfile
|
isfile = os.path.isfile
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ import errno
|
|||||||
import socket
|
import socket
|
||||||
import logging
|
import logging
|
||||||
import platform
|
import platform
|
||||||
from pydal._compat import iteritems, to_bytes, StringIO, urllib_unquote
|
from gluon._compat import iteritems, to_bytes, StringIO, urllib_unquote
|
||||||
|
|
||||||
# Define Constants
|
# Define Constants
|
||||||
VERSION = '1.2.6'
|
VERSION = '1.2.6'
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ Cross-site scripting (XSS) defense
|
|||||||
-----------------------------------
|
-----------------------------------
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from pydal._compat import HTMLParser, urlparse, entitydefs, basestring
|
from gluon._compat import HTMLParser, urlparse, entitydefs, basestring
|
||||||
from cgi import escape
|
from cgi import escape
|
||||||
from formatter import AbstractFormatter
|
from formatter import AbstractFormatter
|
||||||
from xml.sax.saxutils import quoteattr
|
from xml.sax.saxutils import quoteattr
|
||||||
|
|||||||
+1
-1
@@ -29,7 +29,7 @@ from json import loads, dumps
|
|||||||
from gluon import DAL, Field, IS_NOT_EMPTY, IS_IN_SET, IS_NOT_IN_DB, IS_EMPTY_OR
|
from gluon import DAL, Field, IS_NOT_EMPTY, IS_IN_SET, IS_NOT_IN_DB, IS_EMPTY_OR
|
||||||
from gluon import IS_INT_IN_RANGE, IS_DATETIME, IS_IN_DB
|
from gluon import IS_INT_IN_RANGE, IS_DATETIME, IS_IN_DB
|
||||||
from gluon.utils import web2py_uuid
|
from gluon.utils import web2py_uuid
|
||||||
from pydal._compat import Queue, long, iteritems
|
from gluon._compat import Queue, long, iteritems
|
||||||
from gluon.storage import Storage
|
from gluon.storage import Storage
|
||||||
|
|
||||||
USAGE = """
|
USAGE = """
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ from gluon.html import TAG, XmlComponent, xmlescape
|
|||||||
from gluon.languages import lazyT
|
from gluon.languages import lazyT
|
||||||
import gluon.contrib.rss2 as rss2
|
import gluon.contrib.rss2 as rss2
|
||||||
import json as json_parser
|
import json as json_parser
|
||||||
from pydal._compat import long, to_native, unicodeT
|
from gluon._compat import long, to_native, unicodeT
|
||||||
|
|
||||||
have_yaml = True
|
have_yaml = True
|
||||||
try:
|
try:
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import platform
|
import platform
|
||||||
from gluon.storage import Storage
|
from gluon.storage import Storage
|
||||||
from pydal._compat import PY2
|
from gluon._compat import PY2
|
||||||
|
|
||||||
global_settings = Storage()
|
global_settings = Storage()
|
||||||
settings = global_settings # legacy compatibility
|
settings = global_settings # legacy compatibility
|
||||||
|
|||||||
+1
-1
@@ -30,7 +30,7 @@ from gluon.globals import Request, Response, Session
|
|||||||
from gluon.storage import Storage, List
|
from gluon.storage import Storage, List
|
||||||
from gluon.admin import w2p_unpack
|
from gluon.admin import w2p_unpack
|
||||||
from pydal.base import BaseAdapter
|
from pydal.base import BaseAdapter
|
||||||
from pydal._compat import iteritems, ClassType
|
from gluon._compat import iteritems, ClassType
|
||||||
|
|
||||||
logger = logging.getLogger("web2py")
|
logger = logging.getLogger("web2py")
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@ import urllib
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from pydal._compat import StringIO, unichr, urllib_quote, iteritems, basestring, long, unicodeT, to_native
|
from gluon._compat import StringIO, unichr, urllib_quote, iteritems, basestring, long, unicodeT, to_native
|
||||||
from gluon.http import HTTP, redirect
|
from gluon.http import HTTP, redirect
|
||||||
from gluon.html import XmlComponent, truncate_string
|
from gluon.html import XmlComponent, truncate_string
|
||||||
from gluon.html import XML, SPAN, TAG, A, DIV, CAT, UL, LI, TEXTAREA, BR, IMG
|
from gluon.html import XML, SPAN, TAG, A, DIV, CAT, UL, LI, TEXTAREA, BR, IMG
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@ Provides:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from pydal.contrib import portalocker
|
from pydal.contrib import portalocker
|
||||||
from pydal._compat import copyreg, pickle, PY2
|
from gluon._compat import copyreg, pickle, PY2
|
||||||
|
|
||||||
__all__ = ['List', 'Storage', 'Settings', 'Messages',
|
__all__ = ['List', 'Storage', 'Settings', 'Messages',
|
||||||
'StorageList', 'load_storage', 'save_storage']
|
'StorageList', 'load_storage', 'save_storage']
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@ import re
|
|||||||
import errno
|
import errno
|
||||||
from gluon.http import HTTP
|
from gluon.http import HTTP
|
||||||
from gluon.contenttype import contenttype
|
from gluon.contenttype import contenttype
|
||||||
from pydal._compat import PY2
|
from gluon._compat import PY2
|
||||||
|
|
||||||
|
|
||||||
regex_start_range = re.compile('\d+(?=\-)')
|
regex_start_range = re.compile('\d+(?=\-)')
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@ import os
|
|||||||
import cgi
|
import cgi
|
||||||
import logging
|
import logging
|
||||||
from re import compile, sub, escape, DOTALL
|
from re import compile, sub, escape, DOTALL
|
||||||
from pydal._compat import StringIO, unicodeT, to_unicode, to_bytes, to_native
|
from gluon._compat import StringIO, unicodeT, to_unicode, to_bytes, to_native
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# have web2py
|
# have web2py
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ from .test_languages import *
|
|||||||
from .test_compileapp import *
|
from .test_compileapp import *
|
||||||
from .test_appadmin import *
|
from .test_appadmin import *
|
||||||
from .test_web import *
|
from .test_web import *
|
||||||
|
from .test_sqlhtml import *
|
||||||
|
|
||||||
if sys.version[:3] == '2.7':
|
if sys.version[:3] == '2.7':
|
||||||
from .test_is_url import *
|
from .test_is_url import *
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ from .fix_path import fix_sys_path
|
|||||||
fix_sys_path(__file__)
|
fix_sys_path(__file__)
|
||||||
|
|
||||||
from gluon.contenttype import contenttype
|
from gluon.contenttype import contenttype
|
||||||
from pydal._compat import iteritems
|
from gluon._compat import iteritems
|
||||||
|
|
||||||
class TestContentType(unittest.TestCase):
|
class TestContentType(unittest.TestCase):
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import os
|
|||||||
from .fix_path import fix_sys_path
|
from .fix_path import fix_sys_path
|
||||||
|
|
||||||
fix_sys_path(__file__)
|
fix_sys_path(__file__)
|
||||||
from pydal._compat import to_bytes
|
from gluon._compat import to_bytes
|
||||||
from gluon.storage import Storage
|
from gluon.storage import Storage
|
||||||
from gluon.contrib import fpdf as fpdf
|
from gluon.contrib import fpdf as fpdf
|
||||||
from gluon.contrib import pyfpdf as pyfpdf
|
from gluon.contrib import pyfpdf as pyfpdf
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class TestDALSubclass(unittest.TestCase):
|
|||||||
db.close()
|
db.close()
|
||||||
|
|
||||||
def testSerialization(self):
|
def testSerialization(self):
|
||||||
from pydal._compat import pickle
|
from gluon._compat import pickle
|
||||||
db = DAL(check_reserved=['all'])
|
db = DAL(check_reserved=['all'])
|
||||||
db.define_table('t_a', Field('f_a'))
|
db.define_table('t_a', Field('f_a'))
|
||||||
db.t_a.insert(f_a='test')
|
db.t_a.insert(f_a='test')
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ fix_sys_path(__file__)
|
|||||||
|
|
||||||
from gluon.globals import Request, Response, Session
|
from gluon.globals import Request, Response, Session
|
||||||
from gluon import URL
|
from gluon import URL
|
||||||
from pydal._compat import basestring
|
from gluon._compat import basestring
|
||||||
|
|
||||||
def setup_clean_session():
|
def setup_clean_session():
|
||||||
request = Request(env={})
|
request = Request(env={})
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ from gluon.html import STYLE, TABLE, TR, TD, TAG, TBODY, THEAD, TEXTAREA, TFOOT,
|
|||||||
from gluon.storage import Storage
|
from gluon.storage import Storage
|
||||||
from gluon.html import XML_pickle, XML_unpickle
|
from gluon.html import XML_pickle, XML_unpickle
|
||||||
from gluon.html import TAG_pickler, TAG_unpickler
|
from gluon.html import TAG_pickler, TAG_unpickler
|
||||||
from pydal._compat import xrange, PY2, to_native
|
from gluon._compat import xrange, PY2, to_native
|
||||||
|
|
||||||
class TestBareHelpers(unittest.TestCase):
|
class TestBareHelpers(unittest.TestCase):
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ from .fix_path import fix_sys_path
|
|||||||
fix_sys_path(__file__)
|
fix_sys_path(__file__)
|
||||||
|
|
||||||
from gluon import languages
|
from gluon import languages
|
||||||
from pydal._compat import PY2
|
from gluon._compat import PY2
|
||||||
|
|
||||||
MP_WORKING = 0
|
MP_WORKING = 0
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ from gluon.fileutils import abspath
|
|||||||
from gluon.settings import global_settings
|
from gluon.settings import global_settings
|
||||||
from gluon.http import HTTP
|
from gluon.http import HTTP
|
||||||
from gluon.storage import Storage
|
from gluon.storage import Storage
|
||||||
from pydal._compat import to_bytes, to_native, PY2
|
from gluon._compat import to_bytes, to_native, PY2
|
||||||
|
|
||||||
logger = None
|
logger = None
|
||||||
oldcwd = None
|
oldcwd = None
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ from gluon.fileutils import abspath
|
|||||||
from gluon.settings import global_settings
|
from gluon.settings import global_settings
|
||||||
from gluon.http import HTTP
|
from gluon.http import HTTP
|
||||||
from gluon.storage import Storage
|
from gluon.storage import Storage
|
||||||
from pydal._compat import to_bytes
|
from gluon._compat import to_bytes
|
||||||
|
|
||||||
logger = None
|
logger = None
|
||||||
oldcwd = None
|
oldcwd = None
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -10,7 +10,7 @@ fix_sys_path(__file__)
|
|||||||
|
|
||||||
from gluon.storage import Storage, StorageList, List
|
from gluon.storage import Storage, StorageList, List
|
||||||
from gluon.http import HTTP
|
from gluon.http import HTTP
|
||||||
from pydal._compat import pickle
|
from gluon._compat import pickle
|
||||||
|
|
||||||
|
|
||||||
class TestStorage(unittest.TestCase):
|
class TestStorage(unittest.TestCase):
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ class TestTemplate(unittest.TestCase):
|
|||||||
def testWithDummyFileSystem(self):
|
def testWithDummyFileSystem(self):
|
||||||
from os.path import join as pjoin
|
from os.path import join as pjoin
|
||||||
import contextlib
|
import contextlib
|
||||||
from pydal._compat import StringIO
|
from gluon._compat import StringIO
|
||||||
from gluon.restricted import RestrictedError
|
from gluon.restricted import RestrictedError
|
||||||
|
|
||||||
@contextlib.contextmanager
|
@contextlib.contextmanager
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ from gluon.dal import DAL, Field
|
|||||||
from pydal.objects import Table
|
from pydal.objects import Table
|
||||||
from gluon import tools
|
from gluon import tools
|
||||||
from gluon.tools import Auth, Mail, Recaptcha, Recaptcha2, prettydate, Expose
|
from gluon.tools import Auth, Mail, Recaptcha, Recaptcha2, prettydate, Expose
|
||||||
from pydal._compat import PY2
|
from gluon._compat import PY2
|
||||||
from gluon.globals import Request, Response, Session
|
from gluon.globals import Request, Response, Session
|
||||||
from gluon.storage import Storage
|
from gluon.storage import Storage
|
||||||
from gluon.languages import translator
|
from gluon.languages import translator
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ fix_sys_path(__file__)
|
|||||||
|
|
||||||
|
|
||||||
from gluon.validators import *
|
from gluon.validators import *
|
||||||
from pydal._compat import PY2, to_bytes
|
from gluon._compat import PY2, to_bytes
|
||||||
|
|
||||||
class TestValidators(unittest.TestCase):
|
class TestValidators(unittest.TestCase):
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ from .fix_path import fix_sys_path
|
|||||||
fix_sys_path(__file__)
|
fix_sys_path(__file__)
|
||||||
|
|
||||||
from gluon.contrib.webclient import WebClient
|
from gluon.contrib.webclient import WebClient
|
||||||
from pydal._compat import urllib2, PY2
|
from gluon._compat import urllib2, PY2
|
||||||
|
|
||||||
webserverprocess = None
|
webserverprocess = None
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ Auth, Mail, PluginManager and various utilities
|
|||||||
|
|
||||||
import base64
|
import base64
|
||||||
from functools import reduce
|
from functools import reduce
|
||||||
from pydal._compat import pickle, thread, urllib2, Cookie, StringIO, configparser, MIMEBase, MIMEMultipart, \
|
from gluon._compat import pickle, thread, urllib2, Cookie, StringIO, configparser, MIMEBase, MIMEMultipart, \
|
||||||
MIMEText, Encoders, Charset, long, urllib_quote, iteritems, to_bytes, to_native, add_charset, \
|
MIMEText, Encoders, Charset, long, urllib_quote, iteritems, to_bytes, to_native, add_charset, \
|
||||||
charset_QP, basestring, unicodeT, to_unicode
|
charset_QP, basestring, unicodeT, to_unicode
|
||||||
import datetime
|
import datetime
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ Utilities and class for UTF8 strings managing
|
|||||||
----------------------------------------------
|
----------------------------------------------
|
||||||
"""
|
"""
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
from pydal._compat import builtin as __builtin__, unicodeT, iteritems, to_unicode, to_native
|
from gluon._compat import builtin as __builtin__, unicodeT, iteritems, to_unicode, to_native
|
||||||
|
|
||||||
__all__ = ['Utf8']
|
__all__ = ['Utf8']
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ import logging
|
|||||||
import socket
|
import socket
|
||||||
import base64
|
import base64
|
||||||
import zlib
|
import zlib
|
||||||
from pydal._compat import basestring, pickle, PY2, xrange, to_bytes, to_native
|
from gluon._compat import basestring, pickle, PY2, xrange, to_bytes, to_native
|
||||||
|
|
||||||
_struct_2_long_long = struct.Struct('=QQ')
|
_struct_2_long_long = struct.Struct('=QQ')
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@ import urllib
|
|||||||
import struct
|
import struct
|
||||||
import decimal
|
import decimal
|
||||||
import unicodedata
|
import unicodedata
|
||||||
from pydal._compat import StringIO, long, unicodeT, to_unicode, urllib_unquote, unichr, to_bytes, PY2, to_unicode, to_native
|
from gluon._compat import StringIO, long, unicodeT, to_unicode, urllib_unquote, unichr, to_bytes, PY2, to_unicode, to_native
|
||||||
from gluon.utils import simple_hash, web2py_uuid, DIGEST_ALG_BY_SIZE
|
from gluon.utils import simple_hash, web2py_uuid, DIGEST_ALG_BY_SIZE
|
||||||
from pydal.objects import Field, FieldVirtual, FieldMethod
|
from pydal.objects import Field, FieldVirtual, FieldMethod
|
||||||
from functools import reduce
|
from functools import reduce
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@ from __future__ import print_function
|
|||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
import sys
|
import sys
|
||||||
from pydal._compat import StringIO, thread, xrange
|
from gluon._compat import StringIO, thread, xrange
|
||||||
import time
|
import time
|
||||||
import threading
|
import threading
|
||||||
import os
|
import os
|
||||||
|
|||||||
Reference in New Issue
Block a user