You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

main.py 1.6KB

  1. #!/usr/bin/env python
  2. import os
  3. import sys
  4. import json
  5. from kivy.app import App
  6. from kivy.core.window import Window
  7. from kivy.graphics import Rectangle, Color
  8. from kivy.lang import Builder
  9. from kivy.logger import Logger
  10. from kivy.properties import ListProperty, StringProperty
  11. from kivy.uix.screenmanager import ScreenManager, Screen
  12. from kivy.uix.behaviors import ButtonBehavior
  13. from kivy.uix.floatlayout import FloatLayout
  14. from kivy.uix.boxlayout import BoxLayout
  15. from kivy.uix.label import Label
  16. from kivy.uix.scrollview import ScrollView
  17. from core.infoscreen import InfoScreen
  18. from core.getplugins import getPlugins
  19. # Set the current working directory
  20. os.chdir(os.path.dirname(os.path.abspath(sys.argv[0])))
  21. VERSION = "0.0.1"
  22. class InfoScreenApp(App):
  23. base = None
  24. def build(self):
  25. global plugins
  26. # Window size is hardcoded for resolution of official Raspberry Pi
  27. # display. Can be altered but plugins may not display correctly.
  28. Window.size = (800, 480)
  29. self.base = InfoScreen(plugins=plugins)
  30. #self.base = InfoScreen()
  31. return self.base
  32. if __name__ == "__main__":
  33. # Get a list of installed plugins
  34. plugins = getPlugins()
  35. # Loop over the plugins
  36. for p in plugins:
  37. # and add their custom KV files to create one master KV file
  38. # kv_text += "".join(p["kv"])
  39. Builder.load_file(p["kvpath"])
  40. # Load the master KV file
  41. # Builder.load_string(kv_text)
  42. Builder.load_file("base.kv")
  43. InfoScreenApp().run()