# http://pyrocko.org - GPLv3 # # The Pyrocko Developers, 21st Century # ---|P------/S----------~Lg----------
'localhost': 'http://localhost:8080', 'kinherd': 'http://kinherd.org:8080'}
return util.time_to_str(t, format='%Y-%m-%dT%H:%M:%S')
Exception.__init__(self) self._url = url
def __str__(self): return 'No results for request %s' % self._url
Exception.__init__(self) self._url = url
def __str__(self): return 'Request entity too large: %s' % self._url
logger.debug('Accessing URL %s' % url)
if post: logger.debug('POST data: \n%s' % post) req = requests.Request( 'POST', url=url, params=kwargs, data=post) else: req = requests.Request( 'GET', url=url, params=kwargs)
ses = requests.Session()
prep = ses.prepare_request(req) prep.headers['Accept'] = '*/*'
resp = ses.send(prep, stream=True) resp.raise_for_status()
if resp.status_code == 204: raise EmptyResult(url) return resp.raw
site=g_site_abbr.get(site, site), service=service, majorversion=majorversion, method=method)
url = fillurl(url, site, 'static', majorversion) return _request(url, **kwargs)
status_callback=None, entries_wanted=None):
url, path, force=force, method=method, status_callback=status_callback, entries_wanted=entries_wanted, recursive=True)
store_id=None, force=False, quiet=False):
util.human_bytesize(i), util.human_bytesize(n), i*100.0/n))
else: def status_callback(d): pass
print(static( url=stores_url+'/', format='text').read().decode('utf-8'))
else: store_url, store_id, force=force, method='calcsize', entries_wanted=wanted)
store_url, store_id, force=force, stats=[0, stotal], status_callback=status_callback, entries_wanted=wanted)
except Exception as e: raise DownloadError('download failed. Original error was: %s, %s' % ( type(e).__name__, e))
import shutil shutil.rmtree(store_id)
request=None):
url = fillurl(url, site, 'seismosizer', majorversion)
from pyrocko.gf import meta
return meta.load(stream=_request(url, post={'request': request.dump()})) |