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