summaryrefslogtreecommitdiffstats
path: root/deluge/plugins/Stats/deluge_stats/graph.py
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2021-09-26 15:33:53 +0100
committerCalum Lind <calumlind+deluge@gmail.com>2021-10-03 14:22:11 +0100
commit88fc21e9938e08827751509d4da20b9dad44bf92 (patch)
tree587b0e3c3a476e6dff111a769047c809f05cbc74 /deluge/plugins/Stats/deluge_stats/graph.py
parent54674576dba2c5efd945c1e8f5accd2d8ca2afcd (diff)
downloaddeluge-88fc21e9938e08827751509d4da20b9dad44bf92.tar.gz
deluge-88fc21e9938e08827751509d4da20b9dad44bf92.tar.bz2
deluge-88fc21e9938e08827751509d4da20b9dad44bf92.zip
[Stats] Fix cairo error and failing tests
Fixed the Stats GTKUI test not updated to the new GTK3 dir layout. Fixed pygobject cairo ImageSurface error: AttributeError: 'gi.repository.cairo' object has no attribute 'ImageSurface' The documentation seems to suggest that using `import cairo` is the correct usage and this fixed the issue, along with adding suggested gi.require_foreign call. References: https://pygobject.readthedocs.io/en/latest/guide/cairo_integration.html
Diffstat (limited to 'deluge/plugins/Stats/deluge_stats/graph.py')
-rw-r--r--deluge/plugins/Stats/deluge_stats/graph.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/deluge/plugins/Stats/deluge_stats/graph.py b/deluge/plugins/Stats/deluge_stats/graph.py
index 847c253d1..bc18913b3 100644
--- a/deluge/plugins/Stats/deluge_stats/graph.py
+++ b/deluge/plugins/Stats/deluge_stats/graph.py
@@ -20,7 +20,11 @@ import logging
import math
import time
-from gi.repository import cairo
+import gi
+
+gi.require_foreign('cairo') # NOQA: E402
+
+import cairo # isort:skip (gi checks required before import).
log = logging.getLogger(__name__)