Skip to content

Instantly share code, notes, and snippets.

@rnixx
Last active November 20, 2017 17:51
Show Gist options
  • Save rnixx/4c10bdd7f6c6974bc5c86f3039eb4e48 to your computer and use it in GitHub Desktop.
Save rnixx/4c10bdd7f6c6974bc5c86f3039eb4e48 to your computer and use it in GitHub Desktop.
logical program structure extensions proposal for kivy language
# 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