# -*- coding: utf-8 -*-
import datetime
import random
import re
import string

from lxml import html
from urllib2 import urlopen
from urlparse import urljoin
from urlparse import urlparse
from werkzeug import url_encode

from openerp import models, fields, api, _
from openerp.tools import ustr

URL_REGEX = r'(\bhref=[\'"](?!mailto:)([^\'"]+)[\'"])'

def VALIDATE_URL(url):
    if urlparse(url).scheme not in ('http', 'https', 'ftp', 'ftps'):