Changing name back?

separate_pages
quadrismegistus 4 years ago
parent dd6c0507fc
commit 72fdaa8d54

Binary file not shown.

After

Width:  |  Height:  |  Size: 923 KiB

@ -1 +0,0 @@
{"user": {"logged_in": true, "logged_in_when": 1596706879.5428135}}

@ -0,0 +1 @@
{"user": {"logged_in": true, "logged_in_when": 1596709416.1246552}}

@ -5,6 +5,48 @@
#:import NoTransition kivy.uix.screenmanager.NoTransition
# :import MDCarousel kivymd.uix.carousel.MDCarousel
## CLASS DEFS
<MyBoxLayout>:
orientation: "vertical"
pos_hint: {'center_x':0.5, 'center_y':0.5}
size_hint:0.5,0.5
padding:'10dp'
md_bg_color:0,0,0,1
canvas:
Color:
rgb: 1,0,0,2
Line:
width: 1
rectangle: (self.x, self.y, self.width, self.height)
<MyLabel>:
theme_text_color: 'Custom'
text_color: (1,0,0,1)
pos_hint: {'center_y': 0.5}
halign: 'center'
height: self.texture_size[1]
font_family: 'Courier'
### LAYOUT
MyLayout:
scr_mngr: scr_mngr
orientation: 'vertical'
@ -13,10 +55,13 @@ MyLayout:
canvas:
Color:
rgba: 0.925,0.925,0.925,1 #get_color_from_hex(colors['Gray']['900'])
Rectangle:
pos: self.pos
size: self.size
source: 'assets/komrade.png'
MDToolbar:
id: toolbar
title: app.title
@ -45,13 +90,9 @@ MyLayout:
# text: "Login"
# icon: "login"
MDBoxLayout:
orientation: "vertical"
pos_hint: {'center_x':0.5, 'center_y':0.5}
size_hint:0.5,None
padding:'10dp'
# md_bg_color:1,0,0,1
MyBoxLayout:
id: loginbox
size_hint:0.5,0.2
MDTextField:
id: username
@ -60,6 +101,10 @@ MyLayout:
write_tab: False
multiline: False
helper_text_mode: "on_error"
color_mode: 'custom'
line_color_focus: 1,0,0,1
line_color_normal: 1,0,0,1
current_hint_text_color: 1,0,0,1
MDTextField:
id: password
@ -69,6 +114,10 @@ MyLayout:
write_tab: False
multiline: False
helper_text_mode: "on_error"
color_mode: 'custom'
line_color_focus: 1,0,0,1
line_color_normal: 1,0,0,1
current_hint_text_color: 1,0,0,1
MDBoxLayout:
@ -79,16 +128,23 @@ MyLayout:
spacing: '10dp'
pos_hint: {'center_x': .5}
MDRaisedButton:
MDRectangleFlatButton:
text: "login"
on_release:
app.login(username.text, password.text)
#app.root.change_screen("welcome")
theme_text_color: "Custom"
text_color: 1,0,0,1
md_bg_color: 0,0,0,1
MDRectangleFlatButton:
text: "register"
on_release:
app.register(username.text, password.text)
theme_text_color: "Custom"
text_color: 1,0,0,1
md_bg_color: 0,0,0,1
MDLabel:
id: login_status
@ -101,13 +157,16 @@ MyLayout:
WelcomeScreen:
name: 'welcome'
MyLabel:
text: "Welcome!"
font_style: "H3"
pos_hint: {'center_y':0.85}
MyLabel:
text: "\n\nTurning and turning in the widening gyre \nThe falcon cannot hear the falconer;\nThings fall apart; the centre cannot hold;\nMere anarchy is loosed upon the world,\nThe blood-dimmed tide is loosed, and everywhere \nThe ceremony of innocence is drowned;\nThe best lack all conviction, while the worst \nAre full of passionate intensity.\n\nSurely some revelation is at hand..."
MyBoxLayout:
size_hint:0.666,0.666
MyLabel:
text: "Welcome!"
font_style: "H3"
pos_hint: {'center_y':0.85}
MyLabel:
text: "\n\nTurning and turning in the widening gyre \nThe falcon cannot hear the falconer;\nThings fall apart; the centre cannot hold;\nMere anarchy is loosed upon the world,\nThe blood-dimmed tide is loosed, and everywhere \nThe ceremony of innocence is drowned;\nThe best lack all conviction, while the worst \nAre full of passionate intensity.\n\nSurely some revelation is at hand..."
PeopleScreen:
@ -150,3 +209,4 @@ MyLayout:
NotificationsScreen:
name: 'notifications'

@ -15,6 +15,7 @@ from kivymd.uix.label import MDLabel
from kivy.uix.widget import Widget
from kivymd.uix.list import OneLineListItem
from kivymd.uix.card import MDCard, MDSeparator
from kivymd.uix.boxlayout import MDBoxLayout
from kivy.uix.gridlayout import GridLayout
from kivy.metrics import dp
from kivy.properties import NumericProperty
@ -33,27 +34,16 @@ def log(x):
with open('log.txt','a+') as of:
of.write(str(x)+'\n')
class MyLayout(BoxLayout):
class MyLayout(MDBoxLayout):
scr_mngr = ObjectProperty(None)
def change_screen(self, screen, *args):
self.scr_mngr.current = screen
class MyBoxLayout(MDBoxLayout): pass
class MyLabel(MDLabel):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.theme_text_color='Custom'
self.text_color=(1,0,0,1)
self.pos_hint = {'center_y': 0.5}
self.halign='center'
self.height=self.texture_size[1]
self.font_family='Courier'
for k,v in kwargs.items(): setattr(self,k,v)
class ContactPhoto(ILeftBody, AsyncImage):
pass
class MyLabel(MDLabel): pass
class PostCard(MDCard):
@ -105,7 +95,7 @@ class ProtectedScreen(MDScreen):
class WelcomeScreen(MDScreen): pass
class WelcomeScreen(ProtectedScreen): pass
class LoginScreen(MDScreen): pass
class PeopleScreen(ProtectedScreen): pass
class EventsScreen(ProtectedScreen): pass
@ -130,10 +120,10 @@ class FeedScreen(ProtectedScreen):
class MainApp(MDApp):
title = 'Gyre'
title = 'Komrade'
api = 'http://localhost:5555/api'
logged_in=False
store = JsonStore('gyre.json')
store = JsonStore('komrade.json')
login_expiry = 60 * 60 * 24 * 7 # once a week
#login_expiry = 5 # 5 seconds

@ -39,15 +39,15 @@ class Handler(FileSystemEventHandler):
if event.is_directory:
return None
if event.src_path.endswith('gyre.json'): return None
if event.src_path.endswith('log.txt'): return None
elif event.event_type == 'created':
# Take any action here when a file is first created.
print("Received created event - %s." % event.src_path)
elif event.event_type == 'modified':
# Taken any action here when a file is modified.
if event.src_path.endswith('.json'): return None
if '.json' in str(event.src_path): return None
if event.src_path.endswith('log.txt'): return None
print(" \n\n\n\n\nReceived modified event - %s." % event.src_path)
run_command()
#

Loading…
Cancel
Save