Difference between revisions of "TiLDA MK4/Code Structure"

From EMF Badge
Jump to navigation Jump to search
 
(One intermediate revision by one other user not shown)
Line 5: Line 5:
 
""" <your description>
 
""" <your description>
 
"""
 
"""
___name___         = "<your_app_name>"
+
___title___         = "<your_app_name>"
 
___license___      = "MIT"
 
___license___      = "MIT"
 
___dependencies___ = ["wifi", "http", "ugfx_helper", "sleep"]
 
___dependencies___ = ["wifi", "http", "ugfx_helper", "sleep"]
Line 25: Line 25:
 
* Other
 
* Other
  
=== Footer ===
+
=== Exiting main.py ===
 +
 
 +
Ensure your apps calls app.restart_to_default() when finished
  
Ensure your apps calls restart_to_default() when finished
 
  
main.py footer:
 
  
 
<pre>
 
<pre>
restart_to_default()
+
from app import restart_to_default # import at the beginning of your code
 +
 
 +
 
 +
restart_to_default() # call on exit of main.py
 
</pre>
 
</pre>

Latest revision as of 16:24, 9 September 2018

Headers

main.py headers:

""" <your description>
"""
___title___         = "<your_app_name>"
___license___      = "MIT"
___dependencies___ = ["wifi", "http", "ugfx_helper", "sleep"]
___categories___   = ["<see below>"]
___bootstrapped___ = True # Whether or not apps get downloaded on first install. Defaults to "False", mostly likely you won't have to use this at all.

Please use one of these categories:

  • System
  • Homescreens
  • Games
  • Sound
  • EMF
  • Villages
  • Phone
  • LEDs
  • Sensors
  • Demo
  • Other

Exiting main.py

Ensure your apps calls app.restart_to_default() when finished


from app import restart_to_default # import at the beginning of your code


restart_to_default() # call on exit of main.py