|
|
@ -117,25 +117,21 @@ class Client:
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
webbrowser.open(story.link)
|
|
|
|
webbrowser.open(story.link)
|
|
|
|
story.read = True
|
|
|
|
story.read = True
|
|
|
|
|
|
|
|
|
|
|
|
elif c == ord('r'):
|
|
|
|
elif c == ord('r'):
|
|
|
|
await self.reload()
|
|
|
|
await self.reload()
|
|
|
|
|
|
|
|
|
|
|
|
elif c == curses.KEY_RESIZE:
|
|
|
|
elif c == curses.KEY_RESIZE:
|
|
|
|
curses.resize_term(*self.screen.getmaxyx())
|
|
|
|
curses.resize_term(*self.screen.getmaxyx())
|
|
|
|
self.lines, self.cols = self.screen.getmaxyx()
|
|
|
|
self.lines, self.cols = self.screen.getmaxyx()
|
|
|
|
self.stories_in_a_site = self.lines - 3
|
|
|
|
self.stories_in_a_site = self.lines - 3
|
|
|
|
with open('log', 'a') as f:
|
|
|
|
|
|
|
|
f.write(f'resizing!!!')
|
|
|
|
|
|
|
|
await self.load_more_if_needed()
|
|
|
|
await self.load_more_if_needed()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async def load_more_if_needed(self):
|
|
|
|
async def load_more_if_needed(self):
|
|
|
|
|
|
|
|
|
|
|
|
with open('log', 'a') as f:
|
|
|
|
|
|
|
|
f.write(f'len: {len(self.loadedstories)} res: { self.story_pos + self.stories_in_a_site}\n')
|
|
|
|
|
|
|
|
if len(self.loadedstories) < self.story_pos + self.stories_in_a_site:
|
|
|
|
if len(self.loadedstories) < self.story_pos + self.stories_in_a_site:
|
|
|
|
# load more
|
|
|
|
# load more
|
|
|
|
with open('log', 'a') as f:
|
|
|
|
|
|
|
|
f.write('loading more...\n')
|
|
|
|
|
|
|
|
await self.load_stories(self.story_pos, self.story_pos + self.stories_in_a_site)
|
|
|
|
await self.load_stories(self.story_pos, self.story_pos + self.stories_in_a_site)
|
|
|
|
|
|
|
|
|
|
|
|
async def load_stories(self, from_pos, to_pos):
|
|
|
|
async def load_stories(self, from_pos, to_pos):
|
|
|
|