Last active
November 20, 2017 17:51
-
-
Save rnixx/4c10bdd7f6c6974bc5c86f3039eb4e48 to your computer and use it in GitHub Desktop.
logical program structure extensions proposal for kivy language
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# proposal for kivy language extensions | |
BoxLayout: | |
############ | |
# conditions | |
if root.foo: | |
Label: | |
text: 'Condition true' | |
elif root.bar: | |
Label: | |
text: 'Other condition true' | |
else: | |
Label: | |
text: 'Condition false' | |
####### | |
# loops | |
for ob in self.iterables: | |
Label: | |
text: ob.something_from_ob | |
############ | |
# exceptions | |
try: | |
Label: | |
text: root.computed_label | |
except AttributeError as e: | |
Label: | |
text: 'Cannot compute label: {}'.format(e) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment