R-2.6.1
This commit is contained in:
@@ -30,7 +30,7 @@ update:
|
|||||||
echo "remember that pymysql was tweaked"
|
echo "remember that pymysql was tweaked"
|
||||||
src:
|
src:
|
||||||
### Use semantic versioning
|
### Use semantic versioning
|
||||||
echo 'Version 2.6.0-development+timestamp.'`date +%Y.%m.%d.%H.%M.%S` > VERSION
|
echo 'Version 2.6.1-stable+timestamp.'`date +%Y.%m.%d.%H.%M.%S` > VERSION
|
||||||
### rm -f all junk files
|
### rm -f all junk files
|
||||||
make clean
|
make clean
|
||||||
### clean up baisc apps
|
### clean up baisc apps
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
Version 2.6.0-development+timestamp.2013.09.12.16.30.52
|
Version 2.6.1-stable+timestamp.2013.09.12.17.08.08
|
||||||
|
|||||||
+6
-6
@@ -12,12 +12,12 @@ import traceback
|
|||||||
import zipfile
|
import zipfile
|
||||||
import urllib
|
import urllib
|
||||||
from shutil import rmtree
|
from shutil import rmtree
|
||||||
from utils import web2py_uuid
|
from gluon.utils import web2py_uuid
|
||||||
from fileutils import w2p_pack, w2p_unpack, w2p_pack_plugin, w2p_unpack_plugin
|
from gluon.fileutils import w2p_pack, w2p_unpack, w2p_pack_plugin, w2p_unpack_plugin
|
||||||
from fileutils import up, fix_newlines, abspath, recursive_unlink
|
from gluon.fileutils import up, fix_newlines, abspath, recursive_unlink
|
||||||
from fileutils import read_file, write_file, parse_version
|
from gluon.fileutils import read_file, write_file, parse_version
|
||||||
from restricted import RestrictedError
|
from gluon.restricted import RestrictedError
|
||||||
from settings import global_settings
|
from gluon.settings import global_settings
|
||||||
|
|
||||||
|
|
||||||
if not global_settings.web2py_runtime_gae:
|
if not global_settings.web2py_runtime_gae:
|
||||||
|
|||||||
+2
-2
@@ -30,7 +30,7 @@ import re
|
|||||||
import hashlib
|
import hashlib
|
||||||
import datetime
|
import datetime
|
||||||
try:
|
try:
|
||||||
import settings
|
from gluon import settings
|
||||||
have_settings = True
|
have_settings = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
have_settings = False
|
have_settings = False
|
||||||
@@ -423,7 +423,7 @@ class Cache(object):
|
|||||||
"""
|
"""
|
||||||
# GAE will have a special caching
|
# GAE will have a special caching
|
||||||
if have_settings and settings.global_settings.web2py_runtime_gae:
|
if have_settings and settings.global_settings.web2py_runtime_gae:
|
||||||
from contrib.gae_memcache import MemcacheClient
|
from gluon.contrib.gae_memcache import MemcacheClient
|
||||||
self.ram = self.disk = MemcacheClient(request)
|
self.ram = self.disk = MemcacheClient(request)
|
||||||
else:
|
else:
|
||||||
# Otherwise use ram (and try also disk)
|
# Otherwise use ram (and try also disk)
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@ FOR INTERNAL USE ONLY
|
|||||||
from os import stat
|
from os import stat
|
||||||
import thread
|
import thread
|
||||||
import logging
|
import logging
|
||||||
from fileutils import read_file
|
from gluon.fileutils import read_file
|
||||||
|
|
||||||
cfs = {} # for speed-up
|
cfs = {} # for speed-up
|
||||||
cfs_lock = thread.allocate_lock() # and thread safety
|
cfs_lock = thread.allocate_lock() # and thread safety
|
||||||
|
|||||||
+16
-16
@@ -18,27 +18,27 @@ import os
|
|||||||
import copy
|
import copy
|
||||||
import random
|
import random
|
||||||
import __builtin__
|
import __builtin__
|
||||||
from storage import Storage, List
|
from gluon.storage import Storage, List
|
||||||
from template import parse_template
|
from gluon.template import parse_template
|
||||||
from restricted import restricted, compile2
|
from gluon.restricted import restricted, compile2
|
||||||
from fileutils import mktree, listdir, read_file, write_file
|
from gluon.fileutils import mktree, listdir, read_file, write_file
|
||||||
from myregex import regex_expose
|
from gluon.myregex import regex_expose
|
||||||
from languages import translator
|
from gluon.languages import translator
|
||||||
from dal import BaseAdapter, SQLDB, SQLField, DAL, Field
|
from gluon.dal import BaseAdapter, SQLDB, SQLField, DAL, Field
|
||||||
from sqlhtml import SQLFORM, SQLTABLE
|
from gluon.sqlhtml import SQLFORM, SQLTABLE
|
||||||
from cache import Cache
|
from gluon.cache import Cache
|
||||||
from globals import current, Response
|
from gluon.globals import current, Response
|
||||||
import settings
|
from gluon import settings
|
||||||
from cfs import getcfs
|
from gluon.cfs import getcfs
|
||||||
import html
|
from gluon import html
|
||||||
import validators
|
from gluon import validators
|
||||||
from http import HTTP, redirect
|
from gluon.http import HTTP, redirect
|
||||||
import marshal
|
import marshal
|
||||||
import shutil
|
import shutil
|
||||||
import imp
|
import imp
|
||||||
import logging
|
import logging
|
||||||
logger = logging.getLogger("web2py")
|
logger = logging.getLogger("web2py")
|
||||||
import rewrite
|
from gluon import rewrite
|
||||||
from custom_import import custom_import_install
|
from custom_import import custom_import_install
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
+6
-6
@@ -210,7 +210,7 @@ pjoin = os.path.join
|
|||||||
# following checks allow the use of dal without web2py, as a standalone module
|
# following checks allow the use of dal without web2py, as a standalone module
|
||||||
###################################################################################
|
###################################################################################
|
||||||
try:
|
try:
|
||||||
from utils import web2py_uuid
|
from gluon.utils import web2py_uuid
|
||||||
except (ImportError, SystemError):
|
except (ImportError, SystemError):
|
||||||
import uuid
|
import uuid
|
||||||
def web2py_uuid(): return str(uuid.uuid4())
|
def web2py_uuid(): return str(uuid.uuid4())
|
||||||
@@ -222,7 +222,7 @@ except ImportError:
|
|||||||
have_portalocker = False
|
have_portalocker = False
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import serializers
|
from gluon import serializers
|
||||||
have_serializers = True
|
have_serializers = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
have_serializers = False
|
have_serializers = False
|
||||||
@@ -235,7 +235,7 @@ except ImportError:
|
|||||||
simplejson = None
|
simplejson = None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import validators
|
from gluon import validators
|
||||||
have_validators = True
|
have_validators = True
|
||||||
except (ImportError, SyntaxError):
|
except (ImportError, SyntaxError):
|
||||||
have_validators = False
|
have_validators = False
|
||||||
@@ -298,7 +298,7 @@ if not 'google' in DRIVERS:
|
|||||||
try:
|
try:
|
||||||
# first try contrib driver, then from site-packages (if installed)
|
# first try contrib driver, then from site-packages (if installed)
|
||||||
try:
|
try:
|
||||||
import contrib.pymysql as pymysql
|
import gluon.contrib.pymysql as pymysql
|
||||||
# monkeypatch pymysql because they havent fixed the bug:
|
# monkeypatch pymysql because they havent fixed the bug:
|
||||||
# https://github.com/petehunt/PyMySQL/issues/86
|
# https://github.com/petehunt/PyMySQL/issues/86
|
||||||
pymysql.ESCAPE_REGEX = re.compile("'")
|
pymysql.ESCAPE_REGEX = re.compile("'")
|
||||||
@@ -327,7 +327,7 @@ if not 'google' in DRIVERS:
|
|||||||
try:
|
try:
|
||||||
# first try contrib driver, then from site-packages (if installed)
|
# first try contrib driver, then from site-packages (if installed)
|
||||||
try:
|
try:
|
||||||
import contrib.pg8000.dbapi as pg8000
|
import gluon.contrib.pg8000.dbapi as pg8000
|
||||||
except ImportError:
|
except ImportError:
|
||||||
import pg8000.dbapi as pg8000
|
import pg8000.dbapi as pg8000
|
||||||
DRIVERS.append('PostgreSQL(pg8000)')
|
DRIVERS.append('PostgreSQL(pg8000)')
|
||||||
@@ -345,7 +345,7 @@ if not 'google' in DRIVERS:
|
|||||||
import pyodbc
|
import pyodbc
|
||||||
except ImportError:
|
except ImportError:
|
||||||
try:
|
try:
|
||||||
import contrib.pypyodbc as pyodbc
|
import gluon.contrib.pypyodbc as pyodbc
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
raise ImportError(str(e))
|
raise ImportError(str(e))
|
||||||
DRIVERS.append('MSSQL(pyodbc)')
|
DRIVERS.append('MSSQL(pyodbc)')
|
||||||
|
|||||||
+14
-14
@@ -14,17 +14,17 @@ Contains the classes for the global used variables:
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from storage import Storage, List
|
from gluon.storage import Storage, List
|
||||||
from 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 xmlrpc import handler
|
from gluon.xmlrpc import handler
|
||||||
from contenttype import contenttype
|
from gluon.contenttype import contenttype
|
||||||
from html import xmlescape, TABLE, TR, PRE, URL
|
from gluon.html import xmlescape, TABLE, TR, PRE, URL
|
||||||
from http import HTTP, redirect
|
from gluon.http import HTTP, redirect
|
||||||
from fileutils import up
|
from gluon.fileutils import up
|
||||||
from serializers import json, custom_json
|
from gluon.serializers import json, custom_json
|
||||||
import settings
|
import gluon.settings as settings
|
||||||
from utils import web2py_uuid, secure_dumps, secure_loads
|
from gluon.utils import web2py_uuid, secure_dumps, secure_loads
|
||||||
from settings import global_settings
|
from gluon.settings import global_settings
|
||||||
import hashlib
|
import hashlib
|
||||||
import portalocker
|
import portalocker
|
||||||
import cPickle
|
import cPickle
|
||||||
@@ -41,8 +41,8 @@ import threading
|
|||||||
import cgi
|
import cgi
|
||||||
import copy
|
import copy
|
||||||
import tempfile
|
import tempfile
|
||||||
from cache import CacheInRam
|
from gluon.cache import CacheInRam
|
||||||
from fileutils import copystream
|
from gluon.fileutils import copystream
|
||||||
|
|
||||||
FMT = '%a, %d-%b-%Y %H:%M:%S PST'
|
FMT = '%a, %d-%b-%Y %H:%M:%S PST'
|
||||||
PAST = 'Sat, 1-Jan-1971 00:00:00'
|
PAST = 'Sat, 1-Jan-1971 00:00:00'
|
||||||
@@ -60,7 +60,7 @@ except:
|
|||||||
try:
|
try:
|
||||||
import json as sj #standard installed library
|
import json as sj #standard installed library
|
||||||
except:
|
except:
|
||||||
import contrib.simplejson as sj #pure python library
|
import gluon.contrib.simplejson as sj #pure python library
|
||||||
|
|
||||||
regex_session_id = re.compile('^([\w\-]+/)?[\w\-\.]+$')
|
regex_session_id = re.compile('^([\w\-]+/)?[\w\-\.]+$')
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -24,9 +24,9 @@ import marshal
|
|||||||
from HTMLParser import HTMLParser
|
from HTMLParser import HTMLParser
|
||||||
from htmlentitydefs import name2codepoint
|
from htmlentitydefs import name2codepoint
|
||||||
|
|
||||||
from storage import Storage
|
from gluon.storage import Storage
|
||||||
from utils import web2py_uuid, simple_hash, compare
|
from gluon.utils import web2py_uuid, simple_hash, compare
|
||||||
from highlight import highlight
|
from gluon.highlight import highlight
|
||||||
|
|
||||||
regex_crlf = re.compile('\r|\n')
|
regex_crlf = re.compile('\r|\n')
|
||||||
|
|
||||||
@@ -2713,7 +2713,7 @@ class MARKMIN(XmlComponent):
|
|||||||
"""
|
"""
|
||||||
calls the gluon.contrib.markmin render function to convert the wiki syntax
|
calls the gluon.contrib.markmin render function to convert the wiki syntax
|
||||||
"""
|
"""
|
||||||
from contrib.markmin.markmin2html import render
|
from gluon.contrib.markmin.markmin2html import render
|
||||||
return render(self.text, extra=self.extra,
|
return render(self.text, extra=self.extra,
|
||||||
allowed=self.allowed, sep=self.sep, latex=self.latex,
|
allowed=self.allowed, sep=self.sep, latex=self.latex,
|
||||||
URL=self.url, environment=self.environment,
|
URL=self.url, environment=self.environment,
|
||||||
|
|||||||
+7
-7
@@ -23,14 +23,14 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
import copy_reg # python 2
|
import copy_reg # python 2
|
||||||
|
|
||||||
from portalocker import read_locked, LockedFile
|
from gluon.portalocker import read_locked, LockedFile
|
||||||
from utf8 import Utf8
|
from utf8 import Utf8
|
||||||
|
|
||||||
from fileutils import listdir
|
from gluon.fileutils import listdir
|
||||||
import settings
|
import gluon.settings as settings
|
||||||
from cfs import getcfs
|
from gluon.cfs import getcfs
|
||||||
from html import XML, xmlescape
|
from gluon.html import XML, xmlescape
|
||||||
from contrib.markmin.markmin2html import render, markmin_escape
|
from gluon.contrib.markmin.markmin2html import render, markmin_escape
|
||||||
from string import maketrans
|
from string import maketrans
|
||||||
|
|
||||||
__all__ = ['translator', 'findT', 'update_all_languages']
|
__all__ = ['translator', 'findT', 'update_all_languages']
|
||||||
@@ -178,7 +178,7 @@ def read_possible_plural_rules():
|
|||||||
"""
|
"""
|
||||||
plurals = {}
|
plurals = {}
|
||||||
try:
|
try:
|
||||||
import contrib.plural_rules as package
|
import gluon.contrib.plural_rules as package
|
||||||
for importer, modname, ispkg in pkgutil.iter_modules(package.__path__):
|
for importer, modname, ispkg in pkgutil.iter_modules(package.__path__):
|
||||||
if len(modname) == 2:
|
if len(modname) == 2:
|
||||||
module = __import__(package.__name__ + '.' + modname,
|
module = __import__(package.__name__ + '.' + modname,
|
||||||
|
|||||||
+18
-18
@@ -34,15 +34,15 @@ except:
|
|||||||
try:
|
try:
|
||||||
import json as sj #standard installed library
|
import json as sj #standard installed library
|
||||||
except:
|
except:
|
||||||
import contrib.simplejson as sj #pure python library
|
import gluon.contrib.simplejson as sj #pure python library
|
||||||
|
|
||||||
from thread import allocate_lock
|
from thread import allocate_lock
|
||||||
|
|
||||||
from fileutils import abspath, write_file
|
from gluon.fileutils import abspath, write_file
|
||||||
from settings import global_settings
|
from gluon.settings import global_settings
|
||||||
from utils import web2py_uuid
|
from gluon.utils import web2py_uuid
|
||||||
from admin import add_path_first, create_missing_folders, create_missing_app_folders
|
from gluon.admin import add_path_first, create_missing_folders, create_missing_app_folders
|
||||||
from globals import current
|
from gluon.globals import current
|
||||||
|
|
||||||
# Remarks:
|
# Remarks:
|
||||||
# calling script has inserted path to script directory into sys.path
|
# calling script has inserted path to script directory into sys.path
|
||||||
@@ -89,19 +89,19 @@ else:
|
|||||||
logging.basicConfig()
|
logging.basicConfig()
|
||||||
logger = logging.getLogger("web2py")
|
logger = logging.getLogger("web2py")
|
||||||
|
|
||||||
from restricted import RestrictedError
|
from gluon.restricted import RestrictedError
|
||||||
from http import HTTP, redirect
|
from gluon.http import HTTP, redirect
|
||||||
from globals import Request, Response, Session
|
from gluon.globals import Request, Response, Session
|
||||||
from compileapp import build_environment, run_models_in, \
|
from gluon.compileapp import build_environment, run_models_in, \
|
||||||
run_controller_in, run_view_in
|
run_controller_in, run_view_in
|
||||||
from contenttype import contenttype
|
from gluon.contenttype import contenttype
|
||||||
from dal import BaseAdapter
|
from gluon.dal import BaseAdapter
|
||||||
from validators import CRYPT
|
from gluon.validators import CRYPT
|
||||||
from html import URL, xmlescape
|
from gluon.html import URL, xmlescape
|
||||||
from utils import is_valid_ip_address, getipaddrinfo
|
from gluon.utils import is_valid_ip_address, getipaddrinfo
|
||||||
from rewrite import load, url_in, THREAD_LOCAL as rwthread, \
|
from gluon.rewrite import load, url_in, THREAD_LOCAL as rwthread, \
|
||||||
try_rewrite_on_error, fixup_missing_path_info
|
try_rewrite_on_error, fixup_missing_path_info
|
||||||
import newcron
|
from gluon import newcron
|
||||||
|
|
||||||
__all__ = ['wsgibase', 'save_password', 'appfactory', 'HttpServer']
|
__all__ = ['wsgibase', 'save_password', 'appfactory', 'HttpServer']
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ except:
|
|||||||
raise RuntimeError("Cannot determine web2py version")
|
raise RuntimeError("Cannot determine web2py version")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import rocket
|
from gluon import rocket
|
||||||
except:
|
except:
|
||||||
if not global_settings.web2py_runtime_gae:
|
if not global_settings.web2py_runtime_gae:
|
||||||
logger.warn('unable to import Rocket')
|
logger.warn('unable to import Rocket')
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@ import platform
|
|||||||
import portalocker
|
import portalocker
|
||||||
import fileutils
|
import fileutils
|
||||||
import cPickle
|
import cPickle
|
||||||
from settings import global_settings
|
from gluon.settings import global_settings
|
||||||
|
|
||||||
logger = logging.getLogger("web2py.cron")
|
logger = logging.getLogger("web2py.cron")
|
||||||
_cron_stopping = False
|
_cron_stopping = False
|
||||||
|
|||||||
+4
-4
@@ -22,10 +22,10 @@ import logging
|
|||||||
import traceback
|
import traceback
|
||||||
import threading
|
import threading
|
||||||
import urllib
|
import urllib
|
||||||
from storage import Storage, List
|
from gluon.storage import Storage, List
|
||||||
from http import HTTP
|
from gluon.http import HTTP
|
||||||
from fileutils import abspath, read_file
|
from gluon.fileutils import abspath, read_file
|
||||||
from settings import global_settings
|
from gluon.settings import global_settings
|
||||||
|
|
||||||
isdir = os.path.isdir
|
isdir = os.path.isdir
|
||||||
isfile = os.path.isfile
|
isfile = os.path.isfile
|
||||||
|
|||||||
@@ -5,11 +5,10 @@ License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
|
|||||||
"""
|
"""
|
||||||
import datetime
|
import datetime
|
||||||
import decimal
|
import decimal
|
||||||
from storage import Storage
|
from gluon.storage import Storage
|
||||||
from html import TAG, XmlComponent
|
from gluon.html import TAG, XmlComponent, xmlescape
|
||||||
from html import xmlescape
|
from gluon.languages import lazyT
|
||||||
from languages import lazyT
|
import gluon.contrib.rss2 as rss2
|
||||||
import contrib.rss2 as rss2
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import simplejson as json_parser # try external module
|
import simplejson as json_parser # try external module
|
||||||
@@ -17,7 +16,7 @@ except ImportError:
|
|||||||
try:
|
try:
|
||||||
import json as json_parser # try stdlib (Python >= 2.6)
|
import json as json_parser # try stdlib (Python >= 2.6)
|
||||||
except:
|
except:
|
||||||
import contrib.simplejson as json_parser # fallback to pure-Python module
|
import gluon.contrib.simplejson as json_parser # fallback to pure-Python module
|
||||||
|
|
||||||
have_yaml = True
|
have_yaml = True
|
||||||
try:
|
try:
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import platform
|
import platform
|
||||||
from storage import Storage
|
from gluon.storage import Storage
|
||||||
|
|
||||||
global_settings = Storage()
|
global_settings = Storage()
|
||||||
settings = global_settings # legacy compatibility
|
settings = global_settings # legacy compatibility
|
||||||
|
|||||||
+9
-9
@@ -18,15 +18,15 @@ import re
|
|||||||
import optparse
|
import optparse
|
||||||
import glob
|
import glob
|
||||||
import traceback
|
import traceback
|
||||||
import fileutils
|
import gluon.fileutils as fileutils
|
||||||
from settings import global_settings
|
from gluon.settings import global_settings
|
||||||
from utils import web2py_uuid
|
from gluon.utils import web2py_uuid
|
||||||
from compileapp import build_environment, read_pyc, run_models_in
|
from gluon.compileapp import build_environment, read_pyc, run_models_in
|
||||||
from restricted import RestrictedError
|
from gluon.restricted import RestrictedError
|
||||||
from globals import Request, Response, Session
|
from gluon.globals import Request, Response, Session
|
||||||
from storage import Storage, List
|
from gluon.storage import Storage, List
|
||||||
from admin import w2p_unpack
|
from gluon.admin import w2p_unpack
|
||||||
from dal import BaseAdapter
|
from gluon.dal import BaseAdapter
|
||||||
|
|
||||||
logger = logging.getLogger("web2py")
|
logger = logging.getLogger("web2py")
|
||||||
|
|
||||||
|
|||||||
+14
-14
@@ -14,30 +14,30 @@ Holds:
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
from http import HTTP
|
from gluon.http import HTTP
|
||||||
from html import XmlComponent
|
from gluon.html import XmlComponent
|
||||||
from html import XML, SPAN, TAG, A, DIV, CAT, UL, LI, TEXTAREA, BR, IMG, SCRIPT
|
from gluon.html import XML, SPAN, TAG, A, DIV, CAT, UL, LI, TEXTAREA, BR, IMG, SCRIPT
|
||||||
from html import FORM, INPUT, LABEL, OPTION, SELECT
|
from gluon.html import FORM, INPUT, LABEL, OPTION, SELECT
|
||||||
from html import TABLE, THEAD, TBODY, TR, TD, TH, STYLE
|
from gluon.html import TABLE, THEAD, TBODY, TR, TD, TH, STYLE
|
||||||
from html import URL, truncate_string, FIELDSET
|
from gluon.html import URL, truncate_string, FIELDSET
|
||||||
from dal import DAL, Field, Table, Row, CALLABLETYPES, smart_query, \
|
from gluon.dal import DAL, Field, Table, Row, CALLABLETYPES, smart_query, \
|
||||||
bar_encode, Reference, REGEX_TABLE_DOT_FIELD, Expression
|
bar_encode, Reference, REGEX_TABLE_DOT_FIELD, Expression
|
||||||
from storage import Storage
|
from gluon.storage import Storage
|
||||||
from utils import md5_hash
|
from gluon.utils import md5_hash
|
||||||
from validators import IS_EMPTY_OR, IS_NOT_EMPTY, IS_LIST_OF, IS_DATE, \
|
from gluon.validators import IS_EMPTY_OR, IS_NOT_EMPTY, IS_LIST_OF, IS_DATE, \
|
||||||
IS_DATETIME, IS_INT_IN_RANGE, IS_FLOAT_IN_RANGE, IS_STRONG
|
IS_DATETIME, IS_INT_IN_RANGE, IS_FLOAT_IN_RANGE, IS_STRONG
|
||||||
|
|
||||||
import serializers
|
import gluon.serializers as serializers
|
||||||
import datetime
|
import datetime
|
||||||
import urllib
|
import urllib
|
||||||
import re
|
import re
|
||||||
import cStringIO
|
import cStringIO
|
||||||
from globals import current
|
from gluon.globals import current
|
||||||
from http import redirect
|
from gluon.http import redirect
|
||||||
import inspect
|
import inspect
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import settings
|
import gluon.settings as settings
|
||||||
is_gae = settings.global_settings.web2py_runtime_gae
|
is_gae = settings.global_settings.web2py_runtime_gae
|
||||||
except ImportError:
|
except ImportError:
|
||||||
is_gae = False # this is an assumption (if settings missing)
|
is_gae = False # this is an assumption (if settings missing)
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@ Provides:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import cPickle
|
import cPickle
|
||||||
import portalocker
|
import gluon.portalocker as portalocker
|
||||||
|
|
||||||
__all__ = ['List', 'Storage', 'Settings', 'Messages',
|
__all__ = ['List', 'Storage', 'Settings', 'Messages',
|
||||||
'StorageList', 'load_storage', 'save_storage']
|
'StorageList', 'load_storage', 'save_storage']
|
||||||
|
|||||||
+2
-2
@@ -13,8 +13,8 @@ import time
|
|||||||
import re
|
import re
|
||||||
import errno
|
import errno
|
||||||
import rewrite
|
import rewrite
|
||||||
from http import HTTP
|
from gluon.http import HTTP
|
||||||
from contenttype import contenttype
|
from gluon.contenttype import contenttype
|
||||||
|
|
||||||
|
|
||||||
regex_start_range = re.compile('\d+(?=\-)')
|
regex_start_range = re.compile('\d+(?=\-)')
|
||||||
|
|||||||
+2
-2
@@ -25,8 +25,8 @@ except:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
# have web2py
|
# have web2py
|
||||||
from restricted import RestrictedError
|
from gluon.restricted import RestrictedError
|
||||||
from globals import current
|
from gluon.globals import current
|
||||||
except ImportError:
|
except ImportError:
|
||||||
# do not have web2py
|
# do not have web2py
|
||||||
current = None
|
current = None
|
||||||
|
|||||||
@@ -10,17 +10,17 @@ import tempfile
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
if os.path.isdir('gluon'):
|
if os.path.isdir('gluon'):
|
||||||
sys.path.append(os.path.realpath('gluon')) # running from web2py base
|
sys.path.insert(0,os.path.realpath('gluon')) # running from web2py base
|
||||||
else:
|
else:
|
||||||
sys.path.append(os.path.realpath('../')) # running from gluon/tests/
|
sys.path.insert(0,os.path.realpath('../')) # running from gluon/tests/
|
||||||
os.environ['web2py_path'] = os.path.realpath('../../') # for settings
|
os.environ['web2py_path'] = os.path.realpath('../../') # for settings
|
||||||
|
|
||||||
from rewrite import load, filter_url, filter_err, get_effective_router, map_url_out
|
from gluon.rewrite import load, filter_url, filter_err, get_effective_router, map_url_out
|
||||||
from html import URL
|
from gluon.html import URL
|
||||||
from fileutils import abspath
|
from gluon.fileutils import abspath
|
||||||
from settings import global_settings
|
from gluon.settings import global_settings
|
||||||
from http import HTTP
|
from gluon.http import HTTP
|
||||||
from storage import Storage
|
from gluon.storage import Storage
|
||||||
|
|
||||||
logger = None
|
logger = None
|
||||||
oldcwd = None
|
oldcwd = None
|
||||||
|
|||||||
@@ -10,17 +10,17 @@ import tempfile
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
if os.path.isdir('gluon'):
|
if os.path.isdir('gluon'):
|
||||||
sys.path.append(os.path.realpath('gluon')) # running from web2py base
|
sys.path.insert(0,os.path.realpath('gluon')) # running from web2py base
|
||||||
else:
|
else:
|
||||||
sys.path.append(os.path.realpath('../')) # running from gluon/tests/
|
sys.path.insert(0,os.path.realpath('../')) # running from gluon/tests/
|
||||||
os.environ['web2py_path'] = os.path.realpath('../../') # for settings
|
os.environ['web2py_path'] = os.path.realpath('../../') # for settings
|
||||||
|
|
||||||
from rewrite import load, filter_url, filter_err, get_effective_router, regex_filter_out, regex_select
|
from gluon.rewrite import load, filter_url, filter_err, get_effective_router, regex_filter_out, regex_select
|
||||||
from html import URL
|
from gluon.html import URL
|
||||||
from fileutils import abspath
|
from gluon.fileutils import abspath
|
||||||
from settings import global_settings
|
from gluon.settings import global_settings
|
||||||
from http import HTTP
|
from gluon.http import HTTP
|
||||||
from storage import Storage
|
from gluon.storage import Storage
|
||||||
|
|
||||||
logger = None
|
logger = None
|
||||||
oldcwd = None
|
oldcwd = None
|
||||||
|
|||||||
+3
-3
@@ -46,7 +46,7 @@ except ImportError:
|
|||||||
import simplejson as json_parser
|
import simplejson as json_parser
|
||||||
except:
|
except:
|
||||||
# fallback to pure-Python module
|
# fallback to pure-Python module
|
||||||
import contrib.simplejson as json_parser
|
import gluon.contrib.simplejson as json_parser
|
||||||
|
|
||||||
__all__ = ['Mail', 'Auth', 'Recaptcha', 'Crud', 'Service', 'Wiki',
|
__all__ = ['Mail', 'Auth', 'Recaptcha', 'Crud', 'Service', 'Wiki',
|
||||||
'PluginManager', 'fetch', 'geocode', 'prettydate']
|
'PluginManager', 'fetch', 'geocode', 'prettydate']
|
||||||
@@ -1028,7 +1028,7 @@ class Auth(object):
|
|||||||
|
|
||||||
Authentication Example:
|
Authentication Example:
|
||||||
|
|
||||||
from contrib.utils import *
|
from gluon.contrib.utils import *
|
||||||
mail=Mail()
|
mail=Mail()
|
||||||
mail.settings.server='smtp.gmail.com:587'
|
mail.settings.server='smtp.gmail.com:587'
|
||||||
mail.settings.sender='you@somewhere.com'
|
mail.settings.sender='you@somewhere.com'
|
||||||
@@ -4772,7 +4772,7 @@ class Service(object):
|
|||||||
|
|
||||||
def serve_soap(self, version="1.1"):
|
def serve_soap(self, version="1.1"):
|
||||||
try:
|
try:
|
||||||
from contrib.pysimplesoap.server import SoapDispatcher
|
from gluon.contrib.pysimplesoap.server import SoapDispatcher
|
||||||
except:
|
except:
|
||||||
return "pysimplesoap not installed in contrib"
|
return "pysimplesoap not installed in contrib"
|
||||||
request = current.request
|
request = current.request
|
||||||
|
|||||||
+1
-1
@@ -45,7 +45,7 @@ def sort_key(s):
|
|||||||
"""
|
"""
|
||||||
global sort_key
|
global sort_key
|
||||||
try:
|
try:
|
||||||
from contrib.pyuca import unicode_collator
|
from gluon.contrib.pyuca import unicode_collator
|
||||||
unicode_sort_key = unicode_collator.sort_key
|
unicode_sort_key = unicode_collator.sort_key
|
||||||
sort_key = lambda s: unicode_sort_key(
|
sort_key = lambda s: unicode_sort_key(
|
||||||
unicode(s, 'utf-8') if isinstance(s, str) else s)
|
unicode(s, 'utf-8') if isinstance(s, str) else s)
|
||||||
|
|||||||
+3
-3
@@ -37,15 +37,15 @@ from hashlib import md5, sha1, sha224, sha256, sha384, sha512
|
|||||||
try:
|
try:
|
||||||
from Crypto.Cipher import AES
|
from Crypto.Cipher import AES
|
||||||
except ImportError:
|
except ImportError:
|
||||||
import contrib.aes as AES
|
import gluon.contrib.aes as AES
|
||||||
|
|
||||||
import hmac
|
import hmac
|
||||||
|
|
||||||
try:
|
try:
|
||||||
try:
|
try:
|
||||||
from contrib.pbkdf2_ctypes import pbkdf2_hex
|
from gluon.contrib.pbkdf2_ctypes import pbkdf2_hex
|
||||||
except (ImportError, AttributeError):
|
except (ImportError, AttributeError):
|
||||||
from contrib.pbkdf2 import pbkdf2_hex
|
from gluon.contrib.pbkdf2 import pbkdf2_hex
|
||||||
HAVE_PBKDF2 = True
|
HAVE_PBKDF2 = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
try:
|
try:
|
||||||
|
|||||||
+4
-4
@@ -19,8 +19,8 @@ import struct
|
|||||||
import decimal
|
import decimal
|
||||||
import unicodedata
|
import unicodedata
|
||||||
from cStringIO import StringIO
|
from cStringIO import StringIO
|
||||||
from utils import simple_hash, web2py_uuid, DIGEST_ALG_BY_SIZE
|
from gluon.utils import simple_hash, web2py_uuid, DIGEST_ALG_BY_SIZE
|
||||||
from dal import FieldVirtual, FieldMethod
|
from gluon.dal import FieldVirtual, FieldMethod
|
||||||
|
|
||||||
JSONErrors = (NameError, TypeError, ValueError, AttributeError,
|
JSONErrors = (NameError, TypeError, ValueError, AttributeError,
|
||||||
KeyError)
|
KeyError)
|
||||||
@@ -3523,7 +3523,7 @@ class IS_IPV6(Validator):
|
|||||||
try:
|
try:
|
||||||
import ipaddress
|
import ipaddress
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from contrib import ipaddr as ipaddress
|
from gluon.contrib import ipaddr as ipaddress
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ip = ipaddress.IPv6Address(value)
|
ip = ipaddress.IPv6Address(value)
|
||||||
@@ -3746,7 +3746,7 @@ class IS_IPADDRESS(Validator):
|
|||||||
try:
|
try:
|
||||||
import ipaddress
|
import ipaddress
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from contrib import ipaddr as ipaddress
|
from gluon.contrib import ipaddr as ipaddress
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ip = ipaddress.ip_address(value)
|
ip = ipaddress.ip_address(value)
|
||||||
|
|||||||
+6
-6
@@ -22,12 +22,12 @@ import math
|
|||||||
import logging
|
import logging
|
||||||
import newcron
|
import newcron
|
||||||
import getpass
|
import getpass
|
||||||
import main
|
import gluon.main as main
|
||||||
|
|
||||||
from fileutils import read_file, write_file, create_welcome_w2p
|
from gluon.fileutils import read_file, write_file, create_welcome_w2p
|
||||||
from settings import global_settings
|
from gluon.settings import global_settings
|
||||||
from shell import run, test
|
from gluon.shell import run, test
|
||||||
from utils import is_valid_ip_address, is_loopback_ip_address, getipaddrinfo
|
from gluon.utils import is_valid_ip_address, is_loopback_ip_address, getipaddrinfo
|
||||||
|
|
||||||
|
|
||||||
ProgramName = 'web2py Web Framework'
|
ProgramName = 'web2py Web Framework'
|
||||||
@@ -319,7 +319,7 @@ class web2pyDialog(object):
|
|||||||
self.button_stop.configure(state='disabled')
|
self.button_stop.configure(state='disabled')
|
||||||
|
|
||||||
if options.taskbar:
|
if options.taskbar:
|
||||||
import contrib.taskbar_widget
|
import gluon.contrib.taskbar_widget
|
||||||
self.tb = contrib.taskbar_widget.TaskBarIcon()
|
self.tb = contrib.taskbar_widget.TaskBarIcon()
|
||||||
self.checkTaskBar()
|
self.checkTaskBar()
|
||||||
|
|
||||||
|
|||||||
+6
-6
@@ -26,7 +26,7 @@ except:
|
|||||||
print "Warning, winservice is unable to install the Mark Hammond Win32 extensions"
|
print "Warning, winservice is unable to install the Mark Hammond Win32 extensions"
|
||||||
import servicemanager
|
import servicemanager
|
||||||
import _winreg
|
import _winreg
|
||||||
from fileutils import up
|
from gluon.fileutils import up
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['web2py_windows_service_handler']
|
__all__ = ['web2py_windows_service_handler']
|
||||||
@@ -125,7 +125,7 @@ class Web2pyService(Service):
|
|||||||
options.minthreads = None
|
options.minthreads = None
|
||||||
if not hasattr(options, 'maxthreads'):
|
if not hasattr(options, 'maxthreads'):
|
||||||
options.maxthreads = None
|
options.maxthreads = None
|
||||||
import main
|
from gluon import main
|
||||||
self.server = main.HttpServer(
|
self.server = main.HttpServer(
|
||||||
ip=options.ip,
|
ip=options.ip,
|
||||||
port=options.port,
|
port=options.port,
|
||||||
@@ -146,7 +146,7 @@ class Web2pyService(Service):
|
|||||||
interfaces=options.interfaces
|
interfaces=options.interfaces
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
from rewrite import load
|
from gluon.rewrite import load
|
||||||
load()
|
load()
|
||||||
self.server.start()
|
self.server.start()
|
||||||
except:
|
except:
|
||||||
@@ -170,11 +170,11 @@ class Web2pyCronService(Web2pyService):
|
|||||||
_exe_args_ = 'options'
|
_exe_args_ = 'options'
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
import newcron
|
from gluon import newcron
|
||||||
import logging
|
import logging
|
||||||
import logging.config
|
import logging.config
|
||||||
from settings import global_settings
|
from gluon.settings import global_settings
|
||||||
from fileutils import abspath
|
from gluon.fileutils import abspath
|
||||||
from os.path import exists, join
|
from os.path import exists, join
|
||||||
|
|
||||||
self.log('web2py Cron service starting')
|
self.log('web2py Cron service starting')
|
||||||
|
|||||||
Reference in New Issue
Block a user