Update PyRTF to Python 3

This commit is contained in:
Fran Boon
2020-02-12 09:54:21 +00:00
parent ec40c1b5a9
commit e89d2bc7fa
6 changed files with 45 additions and 20 deletions
+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 ] :