We defined the iadd ( += ) operator for all pages, sections and the experiment class. In many cases, it can replace a call to the append() method of these classes. Don't worry, the append() method is not going away. You can use this operator...
... to append elements to a page
... to append pages and sections to a sections
... to append pages and section to the experiment
Simple examples:
# (assuming correct imports)
# Append element to a page
page = Page(title="Test Page")
page += TextElement("Testtext", name="text1")
# (assuming correct imports)
# Append page and section to a section
main = Section()
second = Section()
page = Page(title="Test Page")
second += page # using the page instance from the
main += second
# (assuming correct imports)
# Append sections and pages to the experiment
exp = Experiment()
main = Section()
exp += main
When using the += operator in class definitions, you refer to "self":
When downloading a template, it is now allowed to have a .idea and a .git file already present in the target directory. Otherwise, the directory must be empty.
Added
+=
) operator for all pages, sections and the experiment class. In many cases, it can replace a call to theappend()
method of these classes. Don't worry, theappend()
method is not going away. You can use this operator...Simple examples:
When using the
+=
operator in class definitions, you refer to "self":Changed
.idea
and a.git
file already present in the target directory. Otherwise, the directory must be empty.