[Stats] Integrated TotalTraffic plugin#367
[Stats] Integrated TotalTraffic plugin#367DjLegolas wants to merge 1 commit intodeluge-torrent:developfrom
Conversation
|
Cairo crash is being tracked in https://dev.deluge-torrent.org/ticket/3339 |
|
I'm not sure this is ready to be merged. It should be an optional feature since might be unwanted by existing Stats plugin user and affects the minimum width of the Deluge window. In addition the original TotalTraffic had an option to show just the payload or both total and payload. The additional core exported method is not needed and can be simplified with maybe_deferred. Below is a quick and dirty working example, don't just copy and paste: @@ -23,6 +23,7 @@
import deluge
from deluge import component
from deluge.common import fspeed
+from deluge.decorators import maybe_coroutine
from deluge.plugins.pluginbase import Gtk3PluginBase
from deluge.ui.client import client
from deluge.ui.gtk3.torrentdetails import Tab
@@ -280,7 +281,8 @@ def disable(self):
component.get('StatusBar').remove_item(self.status_item)
del self.status_item
- def update(self):
+ @maybe_coroutine
+ async def update_status(self):
def cb_get_status(st):
def fsize(x, y):
return deluge.common.fsize(x[y])
@@ -295,7 +297,13 @@ def format_str(x):
self.status_item.set_text('S: %s|T: %s' % tuple(map(format_str, st)))
- client.stats.get_both_totals().addCallback(cb_get_status)
+ totals = await client.stats.get_totals()
+ session_totals = await client.stats.get_session_totals()
+ cb_get_status((session_totals, totals))
+
+
+ def update(self):
+ self.update_status()I do also wonder about the number of times get_session_totals is being called but that could be dealt with a later refactor of core. |
f76ec70 to
6791721
Compare
|
I have added the same control in the settings, so one could choose global stats or only payload, and if to show also the total values. |
6791721 to
6f4c0e8
Compare
Used the PR from the original repo of the `stats` plugin[1]. In addition, fixed some basic bugs. The functionality will be the same as the original TotalTraffic. Closes partially: https://dev.deluge-torrent.org/ticket/2812 [1] ianmartin/Deluge-stats-plugin#5
6f4c0e8 to
e7f7e6d
Compare

Used the PR from the original repo of the
statsplugin.In addition, fixed some basic bugs.
According to the ticket, still need to add a WebUI... Therefor:
Closes partially: https://dev.deluge-torrent.org/ticket/2812
In addition, while testing, I have found that in case I was on the
Statstab, and maximized theDeluge's window,the entire GTK would crash in Windows.
When it happened, I got the following error message:
Still no fix for this crash.