def __init__(self, url = 'http://localhost:5984', usePYCurl = False, ckey = None, cert = None, capath = None): """ Initialise requests """ JSONRequests.__init__(self, url, {"cachepath" : None, "pycurl" : usePYCurl, "key" : ckey, "cert" : cert, "capath" : capath}) self.accept_type = "application/json" self["timeout"] = 600
def __init__(self, url='http://localhost:5984', usePYCurl=True, ckey=None, cert=None, capath=None): """ Initialise requests """ JSONRequests.__init__(self, url, {"cachepath": None, "pycurl": usePYCurl, "key": ckey, "cert": cert, "capath": capath}) self.accept_type = "application/json" self["timeout"] = 600
def __init__(self, dict): defaultdict = {'endpoint': "https://cmsweb.cern.ch/registration/", 'cacheduration': 1, 'cachepath': '/tmp'} defaultdict.update(dict) defaultdict["method"] = 'PUT' if 'logger' not in defaultdict.keys(): logging.basicConfig(level = logging.DEBUG, format = '%(asctime)s %(name)-12s %(levelname)-8s %(message)s', datefmt = '%m-%d %H:%M', filename = defaultdict['cachepath'] + '/regsvc.log', filemode = 'w') defaultdict['logger'] = logging.getLogger('RegService') Service.__init__(self, defaultdict) JSONRequests.__init__(self, defaultdict['endpoint'])
def __init__(self, dict): defaultdict = { 'endpoint': "https://cmsweb.cern.ch/registration/", 'cacheduration': 1, 'cachepath': '/tmp' } defaultdict.update(dict) defaultdict["method"] = 'PUT' if 'logger' not in defaultdict.keys(): logging.basicConfig( level=logging.DEBUG, format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s', datefmt='%m-%d %H:%M', filename=defaultdict['cachepath'] + '/regsvc.log', filemode='w') defaultdict['logger'] = logging.getLogger('RegService') Service.__init__(self, defaultdict) JSONRequests.__init__(self, defaultdict['endpoint'])
def __init__(self, url = 'http://localhost:5984'): """ Initialise requests """ JSONRequests.__init__(self, url, {"cachepath" : None}) self.accept_type = "application/json"