-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestimonies.py
76 lines (52 loc) · 1.81 KB
/
testimonies.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
from kivy.uix.popup import Popup
from kivy.uix.scrollview import ScrollView
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.screenmanager import Screen
from mat.list import MDList
from kivy.properties import ObjectProperty
from mat.list import TwoLineListItem, OneLineListItem
from main import DBScroll
from models_sql import *
session = Session()
import time
import threading
class F(Popup):
def __init__(self, **kwargs):
super(F, self).__init__(**kwargs)
def shiemor(self):
popt = PopThread()
popt.start()
dbt = DBThread()
dbt.start()
self.name = self.ids.name.text
def popman(self):
pop = DBScroll(auto_dismiss=True)
pop.open()
class Testimonies(Screen, BoxLayout):
def __init__(self, **kwargs):
super(Testimonies, self).__init__(**kwargs)
def read(self):
content = ScrollView()
mdlist = MDList()
content.add_widget(mdlist)
title = "Testimonies"
pop = Popup(title= title,content= content,background= 'white.png')
pop.open()
for name,message in session.query(Testify.name,Testify.message):
mdlist.add_widget(TwoLineListItem(text=str(name),secondary_text=str(message)))
print('reading testimonies')
def share(self):
pop = F()
pop.open()
class DBThread(threading.Thread):
def __init__(self,**kwargs):
super(DBThread,self).__init__(**kwargs)
def run(self):
add_testimony = Testify(name= '', message='')
session.add(add_testimony)
class PopThread(threading.Thread):
def __init__(self, **kwargs):
super(PopThread, self).__init__(**kwargs)
def run(self):
pop = DBScroll(auto_dismiss=True)
pop.open()