Sfoglia il codice sorgente

Merge branch 'cairo_plotting' of stefan.schmidt/ID2T-toolkit into plot_runtime_fix

Jens Keim 6 anni fa
parent
commit
b7532a0651

+ 0 - 4
code/Core/Statistics.py

@@ -8,14 +8,10 @@ from operator import itemgetter
 # TODO: double check this import
 # does it complain because libpcapreader is not a .py?
 import ID2TLib.libpcapreader as pr
-import matplotlib
-
 import Core.StatsDatabase as statsDB
 import ID2TLib.PcapFile as PcapFile
 import ID2TLib.Utility as Util
 from ID2TLib.IPv4 import IPAddress
-
-matplotlib.use('Agg', force=True)
 import matplotlib.pyplot as plt
 
 

+ 3 - 0
code/Core/__init__.py

@@ -0,0 +1,3 @@
+# Set the required backend as early as possible to avoid conflicts
+import matplotlib as mplt
+mplt.use('Cairo', force=True)

+ 0 - 5
code/ID2TLib/Utility.py

@@ -3,11 +3,6 @@ import datetime as dt
 import ipaddress
 import os
 import random as rnd
-
-import matplotlib
-import scipy.stats as stats
-
-matplotlib.use('Agg', force=True)
 import lea
 import xdg.BaseDirectory as BaseDir
 import scapy.layers.inet as inet

+ 3 - 0
resources/requirements.txt

@@ -1,3 +1,5 @@
+cairocffi==0.8.1
+cffi==1.11.5
 coverage==4.5.1
 cycler==0.10.0
 kiwisolver==1.0.1
@@ -6,6 +8,7 @@ matplotlib==2.2.2
 memory-profiler==0.52.0
 numpy==1.14.2
 psutil==5.4.5
+pycparser==2.18
 pyparsing==2.2.0
 python-dateutil==2.7.2
 pytz==2018.4