Merge ssh://github.com/web2py/web2py
This commit is contained in:
commit
2af872da5a
10 files changed
+99
-52
No files matched your search
@@ -1 +1 @@
|
|||||||
Version 2.6.0-development+timestamp.2013.07.31.11.44.33
|
Version 2.6.0-development+timestamp.2013.08.01.08.22.32
|
||||||
@@ -34,14 +34,14 @@ def editlanguagefile(path,file):
|
|||||||
def file_upload_form(location):
|
def file_upload_form(location):
|
||||||
form=FORM(T("upload file:")," ",
|
form=FORM(T("upload file:")," ",
|
||||||
INPUT(_type="file",_name="file")," ",T("and rename it:")," ",
|
INPUT(_type="file",_name="file")," ",T("and rename it:")," ",
|
||||||
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY),
|
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY()),
|
||||||
INPUT(_type="hidden",_name="location",_value=location),
|
INPUT(_type="hidden",_name="location",_value=location),
|
||||||
INPUT(_type="hidden",_name="sender",_value=URL('design',args=app)),
|
INPUT(_type="hidden",_name="sender",_value=URL('design',args=app)),
|
||||||
INPUT(_type="submit",_value=T("upload")),_action=URL('upload_file'))
|
INPUT(_type="submit",_value=T("upload")),_action=URL('upload_file'))
|
||||||
return form
|
return form
|
||||||
def file_create_form(location):
|
def file_create_form(location):
|
||||||
form=FORM(T("create file with filename:")," ",
|
form=FORM(T("create file with filename:")," ",
|
||||||
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY),
|
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY()),
|
||||||
INPUT(_type="hidden",_name="location",_value=location),
|
INPUT(_type="hidden",_name="location",_value=location),
|
||||||
INPUT(_type="hidden",_name="sender",_value=URL('design',args=app)))
|
INPUT(_type="hidden",_name="sender",_value=URL('design',args=app)))
|
||||||
return form
|
return form
|
||||||
|
|||||||
@@ -35,14 +35,14 @@ def editlanguagefile(path,file):
|
|||||||
def file_upload_form(location):
|
def file_upload_form(location):
|
||||||
form=FORM(T("upload file:")," ",
|
form=FORM(T("upload file:")," ",
|
||||||
INPUT(_type="file",_name="file")," ",T("and rename it:")," ",
|
INPUT(_type="file",_name="file")," ",T("and rename it:")," ",
|
||||||
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY),
|
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY()),
|
||||||
INPUT(_type="hidden",_name="location",_value=location),
|
INPUT(_type="hidden",_name="location",_value=location),
|
||||||
INPUT(_type="hidden",_name="sender",_value=URL('design/'+app)),
|
INPUT(_type="hidden",_name="sender",_value=URL('design/'+app)),
|
||||||
INPUT(_type="submit",_value=T("submit")),_action=URL('upload_file'))
|
INPUT(_type="submit",_value=T("submit")),_action=URL('upload_file'))
|
||||||
return form
|
return form
|
||||||
def file_create_form(location):
|
def file_create_form(location):
|
||||||
form=FORM(T("create file with filename:")," ",
|
form=FORM(T("create file with filename:")," ",
|
||||||
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY),
|
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY()),
|
||||||
INPUT(_type="hidden",_name="location",_value=location),
|
INPUT(_type="hidden",_name="location",_value=location),
|
||||||
INPUT(_type="hidden",_name="sender",_value=URL('design/'+app)),
|
INPUT(_type="hidden",_name="sender",_value=URL('design/'+app)),
|
||||||
INPUT(_type="submit",_value=T("submit")),_action=URL('create_file'))
|
INPUT(_type="submit",_value=T("submit")),_action=URL('create_file'))
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ def file_upload_form(location, anchor=None):
|
|||||||
LABEL(T("upload file:")),
|
LABEL(T("upload file:")),
|
||||||
INPUT(_type="file",_name="file"),
|
INPUT(_type="file",_name="file"),
|
||||||
LABEL(T("and rename it:")),
|
LABEL(T("and rename it:")),
|
||||||
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY,_class=""),
|
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY(),_class=""),
|
||||||
DIV(TAG['BUTTON'](T("Upload"),_type="submit",_class="btn"),_class="controls"),
|
DIV(TAG['BUTTON'](T("Upload"),_type="submit",_class="btn"),_class="controls"),
|
||||||
INPUT(_type="hidden",_name="location",_value=location),
|
INPUT(_type="hidden",_name="location",_value=location),
|
||||||
INPUT(_type="hidden",_name="token",_value=session.token),
|
INPUT(_type="hidden",_name="token",_value=session.token),
|
||||||
@@ -36,7 +36,7 @@ def file_upload_form(location, anchor=None):
|
|||||||
def file_create_form(location, anchor=None, helptext=""):
|
def file_create_form(location, anchor=None, helptext=""):
|
||||||
form=FORM(
|
form=FORM(
|
||||||
LABEL(T("create file with filename:")),
|
LABEL(T("create file with filename:")),
|
||||||
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY,_class=''),
|
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY(),_class=''),
|
||||||
TAG['SMALL'](helptext,_class="help-block"),
|
TAG['SMALL'](helptext,_class="help-block"),
|
||||||
DIV(TAG['BUTTON'](T("Create"),_type="submit",_class="btn"),_class="controls"),
|
DIV(TAG['BUTTON'](T("Create"),_type="submit",_class="btn"),_class="controls"),
|
||||||
INPUT(_type="hidden",_name="location",_value=location),
|
INPUT(_type="hidden",_name="location",_value=location),
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ def editlanguagefile(path,file):
|
|||||||
def file_upload_form(location):
|
def file_upload_form(location):
|
||||||
form=FORM(T("upload file:")," ",
|
form=FORM(T("upload file:")," ",
|
||||||
INPUT(_type="file",_name="file")," ",T("and rename it:")," ",
|
INPUT(_type="file",_name="file")," ",T("and rename it:")," ",
|
||||||
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY),
|
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY()),
|
||||||
INPUT(_type="hidden",_name="location",_value=location),
|
INPUT(_type="hidden",_name="location",_value=location),
|
||||||
INPUT(_type="hidden",_name="token",_value=session.token),
|
INPUT(_type="hidden",_name="token",_value=session.token),
|
||||||
INPUT(_type="hidden",_name="sender",_value=URL('design/'+app)),
|
INPUT(_type="hidden",_name="sender",_value=URL('design/'+app)),
|
||||||
@@ -28,7 +28,7 @@ def file_upload_form(location):
|
|||||||
return form
|
return form
|
||||||
def file_create_form(location):
|
def file_create_form(location):
|
||||||
form=FORM(T("create file with filename:")," ",
|
form=FORM(T("create file with filename:")," ",
|
||||||
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY),
|
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY()),
|
||||||
INPUT(_type="hidden",_name="location",_value=location),
|
INPUT(_type="hidden",_name="location",_value=location),
|
||||||
INPUT(_type="hidden",_name="token",_value=session.token),
|
INPUT(_type="hidden",_name="token",_value=session.token),
|
||||||
INPUT(_type="hidden",_name="sender",_value=URL('design/'+app)),
|
INPUT(_type="hidden",_name="sender",_value=URL('design/'+app)),
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
### Community Documentation
|
### Community Documentation
|
||||||
|
|
||||||
|
- [[Roadmap https://trello.com/b/d3aqBbBl/web2py-roadmap]]
|
||||||
- [[web2pybrasil http://www.web2pybrasil.com.br popup]]
|
- [[web2pybrasil http://www.web2pybrasil.com.br popup]]
|
||||||
- Apostila em português [[Download http://dl.dropbox.com/u/830444/apostila_web2py_basico.pdf popup]] e [[Online http://web2pybrasil.appspot.com/init/plugin_wiki/page/curso-web2py-000 popup]]
|
- Apostila em português [[Download http://dl.dropbox.com/u/830444/apostila_web2py_basico.pdf popup]] e [[Online http://web2pybrasil.appspot.com/init/plugin_wiki/page/curso-web2py-000 popup]]
|
||||||
- [[Sitio en español http://www.web2py.com.ar popup]]
|
- [[Sitio en español http://www.web2py.com.ar popup]]
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ class OAuthAccount(object):
|
|||||||
self.session.access_token = None
|
self.session.access_token = None
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def __init__(self, g, client_id, client_secret, auth_url, token_url, access_token_url):
|
def __init__(self, g, client_id, client_secret, auth_url, token_url, access_token_url, socket_timeout=60):
|
||||||
self.globals = g
|
self.globals = g
|
||||||
self.client_id = client_id
|
self.client_id = client_id
|
||||||
self.client_secret = client_secret
|
self.client_secret = client_secret
|
||||||
@@ -119,6 +119,7 @@ class OAuthAccount(object):
|
|||||||
self.auth_url = auth_url
|
self.auth_url = auth_url
|
||||||
self.token_url = token_url
|
self.token_url = token_url
|
||||||
self.access_token_url = access_token_url
|
self.access_token_url = access_token_url
|
||||||
|
self.socket_timeout = socket_timeout
|
||||||
|
|
||||||
# consumer init
|
# consumer init
|
||||||
self.consumer = oauth.Consumer(self.client_id, self.client_secret)
|
self.consumer = oauth.Consumer(self.client_id, self.client_secret)
|
||||||
@@ -154,7 +155,7 @@ class OAuthAccount(object):
|
|||||||
|
|
||||||
if not self.accessToken():
|
if not self.accessToken():
|
||||||
# setup the client
|
# setup the client
|
||||||
client = oauth.Client(self.consumer, None)
|
client = oauth.Client(self.consumer, None, timeout=self.socket_timeout)
|
||||||
# Get a request token.
|
# Get a request token.
|
||||||
# oauth_callback *is REQUIRED* for OAuth1.0a
|
# oauth_callback *is REQUIRED* for OAuth1.0a
|
||||||
# putting it in the body seems to work.
|
# putting it in the body seems to work.
|
||||||
|
|||||||
@@ -9,6 +9,8 @@
|
|||||||
Note: This module is intended as a plugin replacement of pbkdf2.py
|
Note: This module is intended as a plugin replacement of pbkdf2.py
|
||||||
by Armin Ronacher.
|
by Armin Ronacher.
|
||||||
|
|
||||||
|
Git repository:
|
||||||
|
$ git clone https://github.com/michele-comitini/pbkdf2_ctypes.git
|
||||||
|
|
||||||
:copyright: Copyright (c) 2013: Michele Comitini <mcm@glisco.it>
|
:copyright: Copyright (c) 2013: Michele Comitini <mcm@glisco.it>
|
||||||
:license: LGPLv3
|
:license: LGPLv3
|
||||||
@@ -21,7 +23,62 @@ import hashlib
|
|||||||
import platform
|
import platform
|
||||||
import os.path
|
import os.path
|
||||||
|
|
||||||
try: # check that we have proper OpenSSL on the system.
|
def commoncrypto_hashlib_to_crypto_map_get(hashfunc):
|
||||||
|
hashlib_to_crypto_map = {hashlib.sha1: 1,
|
||||||
|
hashlib.sha224: 2,
|
||||||
|
hashlib.sha256: 3,
|
||||||
|
hashlib.sha384: 4,
|
||||||
|
hashlib.sha512: 5}
|
||||||
|
crypto_hashfunc = hashlib_to_crypto_map.get(hashfunc)
|
||||||
|
if crypto_hashfunc is None:
|
||||||
|
raise ValueError('Unkwnown digest %s' % hashfunc)
|
||||||
|
return crypto_hashfunc
|
||||||
|
|
||||||
|
def commoncrypto_pbkdf2(c_pass, c_passlen,
|
||||||
|
c_salt, c_saltlen,
|
||||||
|
c_iter, digest, c_keylen, c_buff):
|
||||||
|
"""Common Crypto compatibile wrapper
|
||||||
|
"""
|
||||||
|
c_hashfunc = ctypes.c_int(commoncrypto_hashlib_to_crypto_map_get(digest))
|
||||||
|
|
||||||
|
return 1 - crypto.CCKeyDerivationPBKDF(2, # hardcoded 2-> PBKDF2
|
||||||
|
c_pass, c_passlen,
|
||||||
|
c_salt, c_saltlen,
|
||||||
|
c_hashfunc,
|
||||||
|
c_iter,
|
||||||
|
c_buff,
|
||||||
|
c_keylen)
|
||||||
|
|
||||||
|
|
||||||
|
def openssl_hashlib_to_crypto_map_get(hashfunc):
|
||||||
|
hashlib_to_crypto_map = {hashlib.md5: crypto.EVP_md5,
|
||||||
|
hashlib.sha1: crypto.EVP_sha1,
|
||||||
|
hashlib.sha256: crypto.EVP_sha256,
|
||||||
|
hashlib.sha224: crypto.EVP_sha224,
|
||||||
|
hashlib.sha384: crypto.EVP_sha384,
|
||||||
|
hashlib.sha512: crypto.EVP_sha512}
|
||||||
|
crypto_hashfunc = hashlib_to_crypto_map.get(hashfunc)
|
||||||
|
if crypto_hashfunc is None:
|
||||||
|
raise ValueError('Unkwnown digest %s' % hashfunc)
|
||||||
|
crypto_hashfunc.restype = ctypes.c_void_p
|
||||||
|
return crypto_hashfunc()
|
||||||
|
|
||||||
|
|
||||||
|
def openssl_pbkdf2(c_pass, c_passlen,
|
||||||
|
c_salt, c_saltlen,
|
||||||
|
c_iter, digest, c_keylen, c_buff):
|
||||||
|
"""OpenSSL compatibile wrapper
|
||||||
|
"""
|
||||||
|
c_hashfunc = ctypes.c_void_p(openssl_hashlib_to_crypto_map_get(digest))
|
||||||
|
|
||||||
|
return crypto.PKCS5_PBKDF2_HMAC(c_pass, c_passlen,
|
||||||
|
c_salt, c_saltlen,
|
||||||
|
c_iter,
|
||||||
|
c_hashfunc,
|
||||||
|
c_keylen,
|
||||||
|
c_buff)
|
||||||
|
|
||||||
|
try: # check that we have proper OpenSSL or Common Crypto on the system.
|
||||||
system = platform.system()
|
system = platform.system()
|
||||||
if system == 'Windows':
|
if system == 'Windows':
|
||||||
if platform.architecture()[0] == '64bit':
|
if platform.architecture()[0] == '64bit':
|
||||||
@@ -30,19 +87,17 @@ try: # check that we have proper OpenSSL on the system.
|
|||||||
else:
|
else:
|
||||||
crypto = ctypes.CDLL(os.path.basename(
|
crypto = ctypes.CDLL(os.path.basename(
|
||||||
ctypes.util.find_library('libeay32')))
|
ctypes.util.find_library('libeay32')))
|
||||||
|
_pbkdf2_hmac = openssl_pbkdf2
|
||||||
|
crypto.PKCS5_PBKDF2_HMAC # test compatibility
|
||||||
|
elif system == 'Darwin': # think different(TM)! i.e. break things!
|
||||||
|
raise ImportError('Not yet available on OS X')
|
||||||
else:
|
else:
|
||||||
crypto = ctypes.CDLL(os.path.basename(
|
crypto = ctypes.CDLL(os.path.basename(
|
||||||
ctypes.util.find_library('crypto')))
|
ctypes.util.find_library('crypto')))
|
||||||
|
_pbkdf2_hmac = openssl_pbkdf2
|
||||||
|
crypto.PKCS5_PBKDF2_HMAC # test compatibility
|
||||||
|
|
||||||
PKCS5_PBKDF2_HMAC = crypto.PKCS5_PBKDF2_HMAC
|
except (OSError, AttributeError), e:
|
||||||
|
|
||||||
hashlib_to_crypto_map = {hashlib.md5: crypto.EVP_md5,
|
|
||||||
hashlib.sha1: crypto.EVP_sha1,
|
|
||||||
hashlib.sha256: crypto.EVP_sha256,
|
|
||||||
hashlib.sha224: crypto.EVP_sha224,
|
|
||||||
hashlib.sha384: crypto.EVP_sha384,
|
|
||||||
hashlib.sha512: crypto.EVP_sha512}
|
|
||||||
except OSError, AttributeError:
|
|
||||||
raise ImportError('Cannot find a compatible OpenSSL installation '
|
raise ImportError('Cannot find a compatible OpenSSL installation '
|
||||||
'on your system')
|
'on your system')
|
||||||
|
|
||||||
@@ -54,20 +109,11 @@ def pkcs5_pbkdf2_hmac(data, salt, iterations=1000, keylen=24, hashfunc=None):
|
|||||||
c_saltlen = ctypes.c_int(len(salt))
|
c_saltlen = ctypes.c_int(len(salt))
|
||||||
c_iter = ctypes.c_int(iterations)
|
c_iter = ctypes.c_int(iterations)
|
||||||
c_keylen = ctypes.c_int(keylen)
|
c_keylen = ctypes.c_int(keylen)
|
||||||
if hashfunc:
|
|
||||||
crypto_hashfunc = hashlib_to_crypto_map.get(hashfunc)
|
|
||||||
crypto_hashfunc.restype = ctypes.c_void_p
|
|
||||||
if crypto_hashfunc is None:
|
|
||||||
raise ValueError('Unknown digest' + str(hashfunc))
|
|
||||||
c_digest = ctypes.c_void_p(crypto_hashfunc())
|
|
||||||
else:
|
|
||||||
crypto.EVP_sha1.restype = ctypes.c_void_p
|
|
||||||
c_digest = ctypes.c_void_p(crypto.EVP_sha1())
|
|
||||||
c_buff = ctypes.create_string_buffer('\000' * keylen)
|
c_buff = ctypes.create_string_buffer('\000' * keylen)
|
||||||
err = PKCS5_PBKDF2_HMAC(c_pass, c_passlen,
|
err = _pbkdf2_hmac(c_pass, c_passlen,
|
||||||
c_salt, c_saltlen,
|
c_salt, c_saltlen,
|
||||||
c_iter,
|
c_iter,
|
||||||
c_digest,
|
hashfunc,
|
||||||
c_keylen,
|
c_keylen,
|
||||||
c_buff)
|
c_buff)
|
||||||
|
|
||||||
@@ -85,7 +131,12 @@ def pbkdf2_bin(data, salt, iterations=1000, keylen=24, hashfunc=None):
|
|||||||
return pkcs5_pbkdf2_hmac(data, salt, iterations, keylen, hashfunc)
|
return pkcs5_pbkdf2_hmac(data, salt, iterations, keylen, hashfunc)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
crypto.SSLeay_version.restype = ctypes.c_char_p
|
try:
|
||||||
print crypto.SSLeay_version(0)
|
crypto.SSLeay_version.restype = ctypes.c_char_p
|
||||||
for h in hashlib_to_crypto_map:
|
print crypto.SSLeay_version(0)
|
||||||
|
except:
|
||||||
|
print "Not using OpenSSL"
|
||||||
|
|
||||||
|
for h in [hashlib.sha1, hashlib.sha224, hashlib.sha256,
|
||||||
|
hashlib.sha384, hashlib.sha512]:
|
||||||
pkcs5_pbkdf2_hmac('secret' * 11, 'salt', hashfunc=h)
|
pkcs5_pbkdf2_hmac('secret' * 11, 'salt', hashfunc=h)
|
||||||
+5
-10
@@ -1676,10 +1676,9 @@ class BaseAdapter(ConnectionPool):
|
|||||||
sql_o += ' ORDER BY %s' % self.RANDOM()
|
sql_o += ' ORDER BY %s' % self.RANDOM()
|
||||||
else:
|
else:
|
||||||
sql_o += ' ORDER BY %s' % self.expand(orderby)
|
sql_o += ' ORDER BY %s' % self.expand(orderby)
|
||||||
if limitby:
|
if (limitby and not groupby and tablenames and orderby_on_limitby and not orderby):
|
||||||
if orderby_on_limitby and not orderby and tablenames:
|
sql_o += ' ORDER BY %s' % ', '.join(['%s.%s'%(t,x) for t in tablenames for x in (hasattr(self.db[t],'_primarykey') and self.db[t]._primarykey or [self.db[t]._id.name])])
|
||||||
sql_o += ' ORDER BY %s' % ', '.join(['%s.%s'%(t,x) for t in tablenames for x in (hasattr(self.db[t],'_primarykey') and self.db[t]._primarykey or [self.db[t]._id.name])])
|
# oracle does not support limitby
|
||||||
# oracle does not support limitby
|
|
||||||
sql = self.select_limitby(sql_s, sql_f, sql_t, sql_w, sql_o, limitby)
|
sql = self.select_limitby(sql_s, sql_f, sql_t, sql_w, sql_o, limitby)
|
||||||
if for_update and self.can_select_for_update is True:
|
if for_update and self.can_select_for_update is True:
|
||||||
sql = sql.rstrip(';') + ' FOR UPDATE;'
|
sql = sql.rstrip(';') + ' FOR UPDATE;'
|
||||||
@@ -2058,7 +2057,6 @@ class BaseAdapter(ConnectionPool):
|
|||||||
|
|
||||||
def parse(self, rows, fields, colnames, blob_decode=True,
|
def parse(self, rows, fields, colnames, blob_decode=True,
|
||||||
cacheable = False):
|
cacheable = False):
|
||||||
self.build_parsemap()
|
|
||||||
db = self.db
|
db = self.db
|
||||||
virtualtables = []
|
virtualtables = []
|
||||||
new_rows = []
|
new_rows = []
|
||||||
@@ -3174,10 +3172,6 @@ class MSSQLAdapter(BaseAdapter):
|
|||||||
if limitby:
|
if limitby:
|
||||||
(lmin, lmax) = limitby
|
(lmin, lmax) = limitby
|
||||||
sql_s += ' TOP %i' % lmax
|
sql_s += ' TOP %i' % lmax
|
||||||
if 'GROUP BY' in sql_o:
|
|
||||||
orderfound = sql_o.find('ORDER BY ')
|
|
||||||
if orderfound >= 0:
|
|
||||||
sql_o = sql_o[:orderfound]
|
|
||||||
return 'SELECT %s %s FROM %s%s%s;' % (sql_s, sql_f, sql_t, sql_w, sql_o)
|
return 'SELECT %s %s FROM %s%s%s;' % (sql_s, sql_f, sql_t, sql_w, sql_o)
|
||||||
|
|
||||||
TRUE = 1
|
TRUE = 1
|
||||||
@@ -7410,6 +7404,7 @@ class DAL(object):
|
|||||||
types = ADAPTERS[self._dbname].types
|
types = ADAPTERS[self._dbname].types
|
||||||
# copy so multiple DAL() possible
|
# copy so multiple DAL() possible
|
||||||
self._adapter.types = copy.copy(types)
|
self._adapter.types = copy.copy(types)
|
||||||
|
self._adapter.build_parsemap()
|
||||||
if bigint_id:
|
if bigint_id:
|
||||||
if 'big-id' in types and 'reference' in types:
|
if 'big-id' in types and 'reference' in types:
|
||||||
self._adapter.types['id'] = types['big-id']
|
self._adapter.types['id'] = types['big-id']
|
||||||
@@ -8078,7 +8073,7 @@ def index():
|
|||||||
# skip all non-empty lines
|
# skip all non-empty lines
|
||||||
for line in ifile:
|
for line in ifile:
|
||||||
if not line.strip():
|
if not line.strip():
|
||||||
breal
|
break
|
||||||
else:
|
else:
|
||||||
raise RuntimeError("Unable to import table that does not exist.\nTry db.import_from_csv_file(..., map_tablenames={'table':'othertable'},ignore_missing_tables=True)")
|
raise RuntimeError("Unable to import table that does not exist.\nTry db.import_from_csv_file(..., map_tablenames={'table':'othertable'},ignore_missing_tables=True)")
|
||||||
|
|
||||||
|
|||||||
+6
-7
@@ -73,13 +73,10 @@ import optparse
|
|||||||
import types
|
import types
|
||||||
import Queue
|
import Queue
|
||||||
|
|
||||||
if 'WEB2PY_PATH' in os.environ:
|
path = os.getcwd()
|
||||||
sys.path.append(os.environ['WEB2PY_PATH'])
|
|
||||||
else:
|
|
||||||
os.environ['WEB2PY_PATH'] = os.getcwd()
|
|
||||||
|
|
||||||
if not os.environ['WEB2PY_PATH'] in sys.path:
|
if 'WEB2PY_PATH' not in os.environ:
|
||||||
sys.path.append(os.environ['WEB2PY_PATH'])
|
os.environ['WEB2PY_PATH'] = path
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from gluon.contrib.simplejson import loads, dumps
|
from gluon.contrib.simplejson import loads, dumps
|
||||||
@@ -90,7 +87,8 @@ IDENTIFIER = "%s#%s" % (socket.gethostname(),os.getpid())
|
|||||||
|
|
||||||
logger = logging.getLogger('web2py.scheduler.%s' % IDENTIFIER)
|
logger = logging.getLogger('web2py.scheduler.%s' % IDENTIFIER)
|
||||||
|
|
||||||
from gluon import DAL, Field, IS_NOT_EMPTY, IS_IN_SET, IS_NOT_IN_DB, IS_INT_IN_RANGE, IS_DATETIME
|
from gluon import DAL, Field, IS_NOT_EMPTY, IS_IN_SET, IS_NOT_IN_DB
|
||||||
|
from gluon import IS_INT_IN_RANGE, IS_DATETIME
|
||||||
from gluon.utils import web2py_uuid
|
from gluon.utils import web2py_uuid
|
||||||
from gluon.storage import Storage
|
from gluon.storage import Storage
|
||||||
|
|
||||||
@@ -254,6 +252,7 @@ class MetaScheduler(threading.Thread):
|
|||||||
self.have_heartbeat = True # set to False to kill
|
self.have_heartbeat = True # set to False to kill
|
||||||
self.empty_runs = 0
|
self.empty_runs = 0
|
||||||
|
|
||||||
|
|
||||||
def async(self, task):
|
def async(self, task):
|
||||||
"""
|
"""
|
||||||
starts the background process and returns:
|
starts the background process and returns:
|
||||||
|
|||||||
Reference in new issue
Block a user