Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def main(self, name='world'):
wid = gui.VBox(width=350, height=400, margin='0px auto')
self.tree = gui.TreeView(width=300, height=300)
self.tree.append(gui.TreeItem("item1"))
it2 = gui.TreeItem("item2")
self.tree.append(it2)
subit2 = gui.TreeItem("sub item2")
it2.append([gui.TreeItem("sub item1"), subit2, gui.TreeItem("sub item3")])
subit2.append([gui.TreeItem("sub sub item1"), gui.TreeItem("sub sub item2"), gui.TreeItem("sub sub item3")])
wid.append(self.tree)
# returning the root widget
return wid
self.video = gui.Widget(_type='iframe', width=290,
height=200, margin='10px')
self.video.attributes['src'] = "https://drive.google.com/file/d/0B0J9Lq_MRyn4UFRsblR3UTBZRHc/preview"
self.video.attributes['width'] = '100%'
self.video.attributes['height'] = '100%'
self.video.attributes['controls'] = 'true'
self.video.style['border'] = 'none'
self.tree = gui.TreeView(width='100%', height=300)
ti1 = gui.TreeItem("Item1")
ti2 = gui.TreeItem("Item2")
ti3 = gui.TreeItem("Item3")
subti1 = gui.TreeItem("Sub Item1")
subti2 = gui.TreeItem("Sub Item2")
subti3 = gui.TreeItem("Sub Item3")
subti4 = gui.TreeItem("Sub Item4")
subsubti1 = gui.TreeItem("Sub Sub Item1")
subsubti2 = gui.TreeItem("Sub Sub Item2")
subsubti3 = gui.TreeItem("Sub Sub Item3")
self.tree.append([ti1, ti2, ti3])
ti2.append([subti1, subti2, subti3, subti4])
subti4.append([subsubti1, subsubti2, subsubti3])
# appending a widget to another, the first argument is a string key
subContainerRight.append([self.counter, self.lbl, self.bt, self.txt,
self.spin, self.progress, self.check, self.btInputDiag, self.btFileDiag])
# use a defined key as we replace this widget later
fdownloader = gui.FileDownloader(
'download test', '../remi/res/logo.png', width=200, height=30, margin='10px')
subContainerRight.append(fdownloader, key='file_downloader')
subContainerRight.append(
[self.btUploadFile, self.dropDown, self.slider, self.colorPicker, self.date, self.tree])
def __init__(self, text, *args, **kwargs):
"""
Args:
text (str):
kwargs: See Widget.__init__()
"""
super(TreeItem, self).__init__(*args, **kwargs)
self.sub_container = None
self.type = 'li'
self.set_text(text)
self.treeopen = False
self.attributes['treeopen'] = 'false'
self.attributes['has-subtree'] = 'false'
self.attributes[Tag.EVENT_ONCLICK] = \
"sendCallback('%(emitter_identifier)s','%(event_name)s');" \
"event.stopPropagation();event.preventDefault();"% \
{'emitter_identifier': str(self.identifier), 'event_name': Tag.EVENT_ONCLICK}
self.video.attributes['src'] = "https://drive.google.com/file/d/0B0J9Lq_MRyn4UFRsblR3UTBZRHc/preview"
self.video.attributes['width'] = '100%'
self.video.attributes['height'] = '100%'
self.video.attributes['controls'] = 'true'
self.video.style['border'] = 'none'
self.tree = gui.TreeView(width='100%', height=300)
ti1 = gui.TreeItem("Item1")
ti2 = gui.TreeItem("Item2")
ti3 = gui.TreeItem("Item3")
subti1 = gui.TreeItem("Sub Item1")
subti2 = gui.TreeItem("Sub Item2")
subti3 = gui.TreeItem("Sub Item3")
subti4 = gui.TreeItem("Sub Item4")
subsubti1 = gui.TreeItem("Sub Sub Item1")
subsubti2 = gui.TreeItem("Sub Sub Item2")
subsubti3 = gui.TreeItem("Sub Sub Item3")
self.tree.append([ti1, ti2, ti3])
ti2.append([subti1, subti2, subti3, subti4])
subti4.append([subsubti1, subsubti2, subsubti3])
# appending a widget to another, the first argument is a string key
subContainerRight.append([self.counter, self.lbl, self.bt, self.txt, self.spin, self.progress, self.check, self.btInputDiag, self.btFileDiag])
# use a defined key as we replace this widget later
fdownloader = gui.FileDownloader('download test', '../remi/res/logo.png', width=200, height=30, margin='10px')
subContainerRight.append(fdownloader, key='file_downloader')
subContainerRight.append([self.btUploadFile, self.dropDown, self.slider, self.colorPicker, self.date, self.tree])
self.subContainerRight = subContainerRight
subContainerLeft.append([self.img, self.table, self.listView, self.link, self.video])
horizontalContainer.append([subContainerLeft, subContainerRight])
self.video = gui.Widget( _type='iframe', width=290, height=200, margin='10px')
self.video.attributes['src'] = "https://drive.google.com/file/d/0B0J9Lq_MRyn4UFRsblR3UTBZRHc/preview"
self.video.attributes['width'] = '100%'
self.video.attributes['height'] = '100%'
self.video.attributes['controls'] = 'true'
self.video.style['border'] = 'none'
self.tree = gui.TreeView(width='100%', height=300)
ti1 = gui.TreeItem("Item1")
ti2 = gui.TreeItem("Item2")
ti3 = gui.TreeItem("Item3")
subti1 = gui.TreeItem("Sub Item1")
subti2 = gui.TreeItem("Sub Item2")
subti3 = gui.TreeItem("Sub Item3")
subti4 = gui.TreeItem("Sub Item4")
subsubti1 = gui.TreeItem("Sub Sub Item1")
subsubti2 = gui.TreeItem("Sub Sub Item2")
subsubti3 = gui.TreeItem("Sub Sub Item3")
self.tree.append([ti1, ti2, ti3])
ti2.append([subti1, subti2, subti3, subti4])
subti4.append([subsubti1, subsubti2, subsubti3])
# appending a widget to another, the first argument is a string key
subContainerRight.append([self.counter, self.lbl, self.bt, self.txt, self.spin, self.progress, self.check, self.btInputDiag, self.btFileDiag])
# use a defined key as we replace this widget later
fdownloader = gui.FileDownloader('download test', '../remi/res/logo.png', width=200, height=30, margin='10px')
subContainerRight.append(fdownloader, key='file_downloader')
subContainerRight.append([self.btUploadFile, self.dropDown, self.slider, self.colorPicker, self.date, self.tree])
self.subContainerRight = subContainerRight
subContainerLeft.append([self.img, self.table, self.listView, self.link, self.video])
height=200, margin='10px')
self.video.attributes['src'] = "https://drive.google.com/file/d/0B0J9Lq_MRyn4UFRsblR3UTBZRHc/preview"
self.video.attributes['width'] = '100%'
self.video.attributes['height'] = '100%'
self.video.attributes['controls'] = 'true'
self.video.style['border'] = 'none'
self.tree = gui.TreeView(width='100%', height=300)
ti1 = gui.TreeItem("Item1")
ti2 = gui.TreeItem("Item2")
ti3 = gui.TreeItem("Item3")
subti1 = gui.TreeItem("Sub Item1")
subti2 = gui.TreeItem("Sub Item2")
subti3 = gui.TreeItem("Sub Item3")
subti4 = gui.TreeItem("Sub Item4")
subsubti1 = gui.TreeItem("Sub Sub Item1")
subsubti2 = gui.TreeItem("Sub Sub Item2")
subsubti3 = gui.TreeItem("Sub Sub Item3")
self.tree.append([ti1, ti2, ti3])
ti2.append([subti1, subti2, subti3, subti4])
subti4.append([subsubti1, subsubti2, subsubti3])
# appending a widget to another, the first argument is a string key
subContainerRight.append([self.counter, self.lbl, self.bt, self.txt,
self.spin, self.progress, self.check, self.btInputDiag, self.btFileDiag])
# use a defined key as we replace this widget later
fdownloader = gui.FileDownloader(
'download test', '../remi/res/logo.png', width=200, height=30, margin='10px')
subContainerRight.append(fdownloader, key='file_downloader')
subContainerRight.append(
[self.btUploadFile, self.dropDown, self.slider, self.colorPicker, self.date, self.tree])
self.subContainerRight = subContainerRight
def append_instance(self, instance, parent):
item = gui.TreeItem(instance.identifier)
if parent == None:
parent = self
item.instance = instance
item.onclick.do(self.on_tree_item_selected)
parent.append(item)
return item
'#ffbb00', width=200, height=20, margin='10px')
self.colorPicker.onchange.connect(self.color_picker_changed)
self.date = gui.Date('2015-04-13', width=200, height=20, margin='10px')
self.date.onchange.connect(self.date_changed)
self.video = gui.Widget(_type='iframe', width=290,
height=200, margin='10px')
self.video.attributes['src'] = "https://drive.google.com/file/d/0B0J9Lq_MRyn4UFRsblR3UTBZRHc/preview"
self.video.attributes['width'] = '100%'
self.video.attributes['height'] = '100%'
self.video.attributes['controls'] = 'true'
self.video.style['border'] = 'none'
self.tree = gui.TreeView(width='100%', height=300)
ti1 = gui.TreeItem("Item1")
ti2 = gui.TreeItem("Item2")
ti3 = gui.TreeItem("Item3")
subti1 = gui.TreeItem("Sub Item1")
subti2 = gui.TreeItem("Sub Item2")
subti3 = gui.TreeItem("Sub Item3")
subti4 = gui.TreeItem("Sub Item4")
subsubti1 = gui.TreeItem("Sub Sub Item1")
subsubti2 = gui.TreeItem("Sub Sub Item2")
subsubti3 = gui.TreeItem("Sub Sub Item3")
self.tree.append([ti1, ti2, ti3])
ti2.append([subti1, subti2, subti3, subti4])
subti4.append([subsubti1, subsubti2, subsubti3])
# appending a widget to another, the first argument is a string key
subContainerRight.append([self.counter, self.lbl, self.bt, self.txt,
self.spin, self.progress, self.check, self.btInputDiag, self.btFileDiag])
self.date.set_on_change_listener(self.date_changed)
self.video = gui.Widget( _type='iframe', width=290, height=200, margin='10px')
self.video.attributes['src'] = "https://drive.google.com/file/d/0B0J9Lq_MRyn4UFRsblR3UTBZRHc/preview"
self.video.attributes['width'] = '100%'
self.video.attributes['height'] = '100%'
self.video.attributes['controls'] = 'true'
self.video.style['border'] = 'none'
self.tree = gui.TreeView(width='100%', height=300)
ti1 = gui.TreeItem("Item1")
ti2 = gui.TreeItem("Item2")
ti3 = gui.TreeItem("Item3")
subti1 = gui.TreeItem("Sub Item1")
subti2 = gui.TreeItem("Sub Item2")
subti3 = gui.TreeItem("Sub Item3")
subti4 = gui.TreeItem("Sub Item4")
subsubti1 = gui.TreeItem("Sub Sub Item1")
subsubti2 = gui.TreeItem("Sub Sub Item2")
subsubti3 = gui.TreeItem("Sub Sub Item3")
self.tree.append(ti1)
self.tree.append(ti2)
self.tree.append(ti3)
ti2.append(subti1)
ti2.append(subti2)
ti2.append(subti3)
ti2.append(subti4)
subti4.append(subsubti1)
subti4.append(subsubti2)
subti4.append(subsubti3)
self.colorPicker.onchange.connect(self.color_picker_changed)
self.date = gui.Date('2015-04-13', width=200, height=20, margin='10px')
self.date.onchange.connect(self.date_changed)
self.video = gui.Widget(_type='iframe', width=290,
height=200, margin='10px')
self.video.attributes['src'] = "https://drive.google.com/file/d/0B0J9Lq_MRyn4UFRsblR3UTBZRHc/preview"
self.video.attributes['width'] = '100%'
self.video.attributes['height'] = '100%'
self.video.attributes['controls'] = 'true'
self.video.style['border'] = 'none'
self.tree = gui.TreeView(width='100%', height=300)
ti1 = gui.TreeItem("Item1")
ti2 = gui.TreeItem("Item2")
ti3 = gui.TreeItem("Item3")
subti1 = gui.TreeItem("Sub Item1")
subti2 = gui.TreeItem("Sub Item2")
subti3 = gui.TreeItem("Sub Item3")
subti4 = gui.TreeItem("Sub Item4")
subsubti1 = gui.TreeItem("Sub Sub Item1")
subsubti2 = gui.TreeItem("Sub Sub Item2")
subsubti3 = gui.TreeItem("Sub Sub Item3")
self.tree.append([ti1, ti2, ti3])
ti2.append([subti1, subti2, subti3, subti4])
subti4.append([subsubti1, subsubti2, subsubti3])
# appending a widget to another, the first argument is a string key
subContainerRight.append([self.counter, self.lbl, self.bt, self.txt,
self.spin, self.progress, self.check, self.btInputDiag, self.btFileDiag])
# use a defined key as we replace this widget later