Merge pull request #48 from jeromelebleu/dev

Speed up pickle access with cPickle
This commit is contained in:
Jérôme Lebleu 2013-12-11 14:36:40 -08:00
commit d2d0f294dc

View file

@ -26,12 +26,12 @@
import re import re
import json import json
import time import time
import pickle
import psutil import psutil
import calendar import calendar
import subprocess import subprocess
import xmlrpclib import xmlrpclib
import os.path import os.path
import cPickle as pickle
from urllib import urlopen from urllib import urlopen
from datetime import datetime, timedelta from datetime import datetime, timedelta
from yunohost import YunoHostError from yunohost import YunoHostError
@ -359,7 +359,7 @@ def _extract_inet(string, skip_netmask=False):
string -- String to search in 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}' 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})*)?' 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 ')' ip4 += '/[0-9]{1,2})' if not skip_netmask else ')'