Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.32 KB | None | 0 0
  1. [INFO ] [Logger ] Record log in /home/albuquerque/.kivy/logs/kivy_19-04-21_53.txt
  2. [INFO ] [Kivy ] v1.11.0.dev0, git-eec3a30, 20190421
  3. [INFO ] [Python ] v3.6.7 (default, Oct 22 2018, 11:32:17)
  4. [GCC 8.2.0]
  5. [INFO ] [Factory ] 184 symbols loaded
  6. [INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)
  7. [INFO ] [Text ] Provider: sdl2
  8. [INFO ] [Window ] Provider: sdl2(['window_egl_rpi'] ignored)
  9. [INFO ] [GL ] Using the "OpenGL" graphics system
  10. [INFO ] [GL ] Backend used <sdl2>
  11. [INFO ] [GL ] OpenGL version <b'4.6.0 NVIDIA 390.116'>
  12. [INFO ] [GL ] OpenGL vendor <b'NVIDIA Corporation'>
  13. [INFO ] [GL ] OpenGL renderer <b'GeForce GT 730M/PCIe/SSE2'>
  14. [INFO ] [GL ] OpenGL parsed version: 4, 6
  15. [INFO ] [GL ] Shading version <b'4.60 NVIDIA'>
  16. [INFO ] [GL ] Texture max size <16384>
  17. [INFO ] [GL ] Texture max units <32>
  18. [INFO ] [Window ] auto add sdl2 input provider
  19. [INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
  20. Traceback (most recent call last):
  21. File "kivy/properties.pyx", line 840, in kivy.properties.ObservableDict.__getattr__
  22. KeyError: 'box'
  23.  
  24. During handling of the above exception, another exception occurred:
  25.  
  26. Traceback (most recent call last):
  27. File "main.py", line 19, in <module>
  28. Test().run()#O método run() inicializa o app
  29. File "/home/albuquerque/.local/lib/python3.6/site-packages/kivy/app.py", line 829, in run
  30. root = self.build()
  31. File "main.py", line 16, in build
  32. return Tarefas(["a","b", "c"])
  33. File "main.py", line 10, in __init__
  34. self.ids.box.add_widget(Label(text=tarefa, font_size=30))#procura nos ids da classe no arquivo text.kv o id box
  35. File "kivy/properties.pyx", line 843, in kivy.properties.ObservableDict.__getattr__
  36. AttributeError: 'super' object has no attribute '__getattr__'
  37. Exception ignored in: functools.partial(<function _widget_destructor at 0x7f5c199612f0>, 3)
  38. Traceback (most recent call last):
  39. File "/home/albuquerque/.local/lib/python3.6/site-packages/kivy/uix/widget.py", line 265, in _widget_destructor
  40. File "/home/albuquerque/.local/lib/python3.6/site-packages/kivy/lang/builder.py", line 760, in unbind_widget
  41. File "kivy/weakproxy.pyx", line 32, in kivy.weakproxy.WeakProxy.__getat
  42.  
  43. from kivy.app import * #importar os métodos de APPP do kivy
  44. from kivy.uix.boxlayout import BoxLayout #empilha os widgets como se fossem caixas
  45. from kivy.uix.label import Label
  46. from kivy.uix.scrollview import ScrollView
  47.  
  48. class Tarefas(ScrollView):
  49. def __init__(self, tarefas, **kwargs): #keyword arguments, o incrivel é que ele executa os argumentos colocados a mais
  50. super().__init__(**kwargs)#chama as funções da classe BoxLayout
  51. for tarefa in tarefas:
  52. self.ids.box.add_widget(Label(text=tarefa, font_size=30))#procura nos ids da classe no arquivo text.kv o id box
  53.  
  54.  
  55. class Test(App):#primeiro arquivo que o kivy procura (no caso, Text.kv)
  56.  
  57. def build(self): #Métod o que constroi o aplicativo
  58. return Tarefas(["a","b", "c"])
  59.  
  60.  
  61. Test().run()#O método run() inicializa o app
  62.  
  63. <Tarefas>:
  64. BoxLayout:
  65. id:box #identificação do widget
  66. orientation:"vertical"
  67. size_hint_y:None
  68. height:self.minimum_height
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement