From 2901f1e1ba9aab48ee956837de6c966b449c31f4 Mon Sep 17 00:00:00 2001 From: HelloZeroNet Date: Sun, 6 Mar 2016 19:28:22 +0100 Subject: [PATCH] Rev949, Newsfeed allows items 2min from future, Switch sidebar content.json list to input for faster opening, Promise based sidebar rendering to make it more reliable on slow connections, RateLimit sidebar globe updating, Some PEP8 formatting --- plugins/Newsfeed/NewsfeedPlugin.py | 2 +- plugins/Sidebar/SidebarPlugin.py | 17 ++++----- plugins/Sidebar/media/RateLimit.coffee | 14 ++++++++ plugins/Sidebar/media/Sidebar.coffee | 11 ++++-- plugins/Sidebar/media/all.js | 49 +++++++++++++++++++++++--- src/Config.py | 2 +- src/Ui/UiRequest.py | 9 ++--- 7 files changed, 77 insertions(+), 27 deletions(-) create mode 100644 plugins/Sidebar/media/RateLimit.coffee diff --git a/plugins/Newsfeed/NewsfeedPlugin.py b/plugins/Newsfeed/NewsfeedPlugin.py index 188e6688..86c75089 100644 --- a/plugins/Newsfeed/NewsfeedPlugin.py +++ b/plugins/Newsfeed/NewsfeedPlugin.py @@ -35,7 +35,7 @@ class UiWebsocketPlugin(object): continue for row in res: row = dict(row) - if row["date_added"] > time.time() + 60: + if row["date_added"] > time.time() + 120: continue # Feed item is in the future, skip it row["site"] = address row["feed_name"] = name diff --git a/plugins/Sidebar/SidebarPlugin.py b/plugins/Sidebar/SidebarPlugin.py index 140d4906..3923f1f7 100644 --- a/plugins/Sidebar/SidebarPlugin.py +++ b/plugins/Sidebar/SidebarPlugin.py @@ -148,8 +148,11 @@ class UiWebsocketPlugin(object): percent = 0 else: percent = 100 * (float(size) / size_total) - percent = math.floor(percent*100)/100 # Floor to 2 digits - body.append(u"""
  • """ % (percent, extension, color, extension)) + percent = math.floor(percent * 100) / 100 # Floor to 2 digits + body.append( + u"""
  • """ % + (percent, extension, color, extension) + ) # Legend body.append("