~ubuntu-branches/debian/sid/calibre/sid

« back to all changes in this revision

Viewing changes to setup/plugins_mirror.py

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2014-02-27 07:48:06 UTC
  • mto: This revision was merged to the branch mainline in revision 74.
  • Revision ID: package-import@ubuntu.com-20140227074806-64wdebb3ptosxhhx
Tags: upstream-1.25.0+dfsg
ImportĀ upstreamĀ versionĀ 1.25.0+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
__license__ = 'GPL v3'
7
7
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
8
8
 
9
 
import urllib2, re, HTMLParser, zlib, gzip, io, sys, bz2, json, errno, urlparse, os, zipfile, ast, tempfile, glob, fcntl, atexit, stat
 
9
import urllib2, re, HTMLParser, zlib, gzip, io, sys, bz2, json, errno, urlparse, os, zipfile, ast, tempfile, glob, fcntl, atexit, stat, socket
10
10
from future_builtins import map, zip, filter
11
11
from collections import namedtuple
12
12
from multiprocessing.pool import ThreadPool
26
26
IndexEntry = namedtuple('IndexEntry', 'name url donate history uninstall deprecated thread_id')
27
27
u = HTMLParser.HTMLParser().unescape
28
28
 
 
29
socket.setdefaulttimeout(60)
 
30
 
29
31
def read(url, get_info=False):  # {{{
30
32
    if url.startswith("file://"):
31
33
        return urllib2.urlopen(url).read()