Add image constructor
This commit is contained in:
parent
be105821d9
commit
47dd9bf350
|
|
@ -125,3 +125,19 @@ class PString:
|
||||||
't' : 'Str',
|
't' : 'Str',
|
||||||
'c' : self.content
|
'c' : self.content
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class Image:
|
||||||
|
def __init__(self, attr, caption, url):
|
||||||
|
self.attr = attr
|
||||||
|
self.caption = caption
|
||||||
|
self.url = url
|
||||||
|
|
||||||
|
def toJson(self):
|
||||||
|
return {
|
||||||
|
't' : 'Image',
|
||||||
|
'c' : [
|
||||||
|
self.attr.toJson(),
|
||||||
|
self.caption,
|
||||||
|
[self.url, ""]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user