2
0
mirror of https://github.com/ComradCollective/Comrad synced 2024-11-03 23:15:33 +00:00

filechooser issues?

This commit is contained in:
marxzuckerburg 2020-10-01 16:37:57 +01:00
parent faccfd8ca1
commit 8ea1ae6969
3 changed files with 22 additions and 12 deletions

View File

@ -833,7 +833,7 @@ if __name__ == '__main__':
loop = asyncio.get_event_loop()
try:
loop.run_until_complete(MainApp().app_func())
except TypeError:
except AssertionError:
print('\n\nGoodbye.\n')
pass
loop.close()

View File

@ -21,21 +21,27 @@ from copy import copy,deepcopy
from kivy.animation import Animation
from main import MyLabel,COLOR_ICON
from misc import *
from plyer import filechooser
class ProfileAvatar(Image):
def on_touch_down(self, touch):
if self.screen.carousel.index and self.collide_point(*touch.pos) and self.screen.carousel.slides:
start = self.screen.carousel.slides[0]
start.opacity=0
self.screen.carousel.index=0
anim = Animation(opacity=1, duration=0.1)
anim.start(start)
# start = self.screen.carousel.slides[0]
# log('????',start)
# self.screen.carousel.load_slide(start)
# self.screen.carousel.load_next()
if self.collide_point(*touch.pos):
if self.screen.carousel.index and self.screen.carousel.slides:
start = self.screen.carousel.slides[0]
start.opacity=0
self.screen.carousel.index=0
anim = Animation(opacity=1, duration=0.1)
anim.start(start)
else:
filechooser.open_file(
on_selection=self.handle_selection,
desktop_override='gnome'
)
def handle_selection(self, selection):
self.selection = selection
raise Exception(selection)
class LayoutAvatar(MDBoxLayout): pass

View File

@ -742,7 +742,7 @@ class ComradX(Caller):
inbox = [x for x in inbox if not x in set(read)]
posts=[]
for post_id in reversed(inbox):
for post_id in inbox:
self.log('???',post_id,inbox_prefix)
try:
res_post = self.read_post(post_id)
@ -755,6 +755,10 @@ class ComradX(Caller):
post.post_id=post_id
post.inbox_prefix=inbox_prefix
posts.append(post)
# sort by timestamp!
posts.sort(key=lambda post: -post.timestamp)
return posts
def read_post(self,post_id,post_encr=None,post_prefix='/post/'):