Merge remote-tracking branch 'web2py/master' into ah-stable

This commit is contained in:
2020-03-17 16:24:00 +00:00
57 changed files with 334 additions and 4457 deletions
+4
View File
@@ -1,3 +1,7 @@
import sys
PY2 = sys.version_info[0] == 2
class ViewKind :
"""An integer (0-5) that represents the view mode of the document."""
+12 -6
View File
@@ -1,10 +1,16 @@
from __future__ import print_function
from types import IntType, FloatType, LongType, StringTypes
from copy import deepcopy
from binascii import hexlify
from copy import deepcopy
from binascii import hexlify
from Constants import *
from Styles import *
from .Constants import *
from .Styles import *
if PY2:
NumberTypes = (int, float, long)
StringType = basestring
else:
NumberTypes = (int, float)
StringType = str
class UnhandledParamError( Exception ) :
def __init__( self, param ) :
@@ -587,7 +593,7 @@ class Table :
def AddRow( self, *cells ) :
height = None
if isinstance( cells[ 0 ], (IntType, FloatType, LongType) ):
if isinstance( cells[ 0 ], NumberTypes ):
height = int( cells[ 0 ] )
cells = cells[ 1 : ]
+7 -2
View File
@@ -9,9 +9,14 @@ The TextPropertySet can be used for text or in a Paragraph Style.
"""
from types import StringType
from copy import deepcopy
from copy import deepcopy
from .Constants import PY2
if PY2:
StringType = basestring
else:
StringType = str
#
# We need some basic Type like fonts, colours and paper definitions
+8 -3
View File
@@ -1,6 +1,11 @@
from types import StringType, ListType, TupleType
from copy import deepcopy
from Elements import *
from .Elements import *
from .Constants import PY2
if PY2:
StringType = basestring
else:
StringType = str
DEFAULT_TAB_WIDTH = 720
@@ -438,7 +443,7 @@ class Renderer :
elif clss == Table :
self.WriteTableElement( element )
elif clss == StringType :
elif ininstance(element, StringType) :
self.WriteParagraphElement( Paragraph( element ) )
elif clss in [ RawCode, Image ] :
+1 -1
View File
@@ -6,7 +6,7 @@ At present there are only two, Text and Paragraph but ListStyles will be added s
"""
from PropertySets import *
from .PropertySets import *
class TextStyle :
def __init__( self, text_props, name=None, shading_props=None ) :
+13 -8
View File
@@ -1,12 +1,17 @@
from PropertySets import *
from Elements import *
from Styles import *
from Renderer import *
from .PropertySets import *
from .Elements import *
from .Styles import *
from .Renderer import *
from .Constants import PY2
if PY2:
from cStringIO import StringIO as BytesIO
else:
from io import BytesIO
def dumps(doc):
import cStringIO
s=cStringIO.StringIO()
r=Renderer()
r.Write(doc,s)
s = BytesIO()
r = Renderer()
r.Write(doc, s)
return s.getvalue()
+6 -3
View File
@@ -973,9 +973,12 @@ class Session(Storage):
if row:
# rows[0].update_record(locked=True)
# Unpickle the data
session_data = pickle.loads(row['session_data'])
self.update(session_data)
response.session_new = False
try:
session_data = pickle.loads(row['session_data'])
self.update(session_data)
response.session_new = False
except:
record_id = None
else:
record_id = None
if record_id:
+1 -1
View File
@@ -656,7 +656,7 @@ class Scheduler(threading.Thread):
ctx = multiprocessing.get_context('spawn')
outq = ctx.Queue()
retq = ctx.Queue(maxsize=1)
sel.process = p = ctx.Process(target=executor, args=(retq, task, outq))
self.process = p = ctx.Process(target=executor, args=(retq, task, outq))
else:
outq = multiprocessing.Queue()
retq = multiprocessing.Queue(maxsize=1)