From 95995963568d30e02484cd3e62d06ea976c9b9b0 Mon Sep 17 00:00:00 2001 From: Jerome Lebleu Date: Wed, 11 Dec 2013 23:34:55 +0100 Subject: [PATCH] Speed up pickle access with cPickle --- yunohost_monitor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yunohost_monitor.py b/yunohost_monitor.py index e87dd5bf..e162e980 100644 --- a/yunohost_monitor.py +++ b/yunohost_monitor.py @@ -26,12 +26,12 @@ import re import json import time -import pickle import psutil import calendar import subprocess import xmlrpclib import os.path +import cPickle as pickle from urllib import urlopen from datetime import datetime, timedelta from yunohost import YunoHostError @@ -359,7 +359,7 @@ def _extract_inet(string, skip_netmask=False): string -- String to search in """ - # TODO: Return IPv4 and IPv6? + # TODO: Return IPv4 and IPv6 when available ip4 = '((25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}' ip6 = '((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?)::((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?' ip4 += '/[0-9]{1,2})' if not skip_netmask else ')'