/usr/lib/python2.7/dist-packages/isbnlib/config.py is in python-isbnlib 3.5.6-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | # -*- coding: utf-8 -*-
"""Config file for isbnlib."""
# --> Import only external modules! <--
import socket
# Timeouts
SOCKETS_TIMEOUT = 12 # seconds
THREADS_TIMEOUT = 11 # seconds
def setsocketstimeout(seconds):
"""Set the value of SOCKETS_TIMEOUT (in seconds)."""
global SOCKETS_TIMEOUT
SOCKETS_TIMEOUT = seconds
return socket.setdefaulttimeout(SOCKETS_TIMEOUT)
# socket timeout is not exposed at urllib2 level so I had to import the
# module and set a default value for all the sockets (timeout in seconds)
# however this should be done at top level due to strong side effects...
setsocketstimeout(SOCKETS_TIMEOUT)
# THREADS_TIMEOUT is a parameter used downstream by Thread calls (see vias.py)
def setthreadstimeout(seconds): # pragma: no cover
"""Set the value of THREADS_TIMEOUT (in seconds)."""
global THREADS_TIMEOUT
THREADS_TIMEOUT = seconds
# API keys
apikeys = {}
def add_apikey(service, apikey): # pragma: no cover
"""Add API keys.
add_apikey('isbndb', 'JuHytr6') [is fake!]
"""
apikeys[service] = apikey
# Generic Options
options = {'VIAS_MERGE': 'serial'}
def set_option(option, value): # pragma: no cover
"""Set the value for option."""
options[option] = value
|