def __call__(self): from iotbx.pdb import download return download.openurl( url = "%s/%s" % ( self.job_folder, self.OUTPUTFILE ), storage = download.no_storage, )
def get_request(url, identifier): lcase = identifier.lower() stream = openurl( url = ( url + lcase ).encode() ) result_for = json.load( stream ) assert lcase in result_for return result_for[ lcase ]
def multiple(self, identifiers): for ident in identifiers: try: stream = openurl( url = ( self.url + self.namer( identifier = ident ) ).encode(), ) except NotFound: yield None else: yield stream
def post_request(url, identifiers): if len( identifiers ) == 0: return ( i for i in () ) try: stream = openurl( url = url, data = ( ",".join( identifiers ) ).encode() ) except NotFound: return ( None for i in identifiers ) result_for = json.load( stream ) return ( result_for.get( ident.lower() ) for ident in identifiers )
def __init__(self): stream = openurl( url="ftp://ftp.wwpdb.org/pub/pdb/data/status/obsolete.dat", ) chain_redirection_for = parse_pdb_redirections(lineiter=stream) self.redirection_for = {} for key in chain_redirection_for: self.redirection_for[key] = end_of_chain( identifier=key, replacement_for=chain_redirection_for, )
def __init__(self): stream = openurl( url = "ftp://ftp.wwpdb.org/pub/pdb/data/status/obsolete.dat", ) chain_redirection_for = parse_pdb_redirections( lineiter = stream ) self.redirection_for = {} for key in chain_redirection_for: self.redirection_for[ key ] = end_of_chain( identifier = key, replacement_for = chain_redirection_for, )
def __init__(self, pdbstr, name): from iotbx.pdb import download import urllib data_for = { "pdb": pdbstr, "bfactorPDB": "Yes", "name": name, "nomail": "Yes", "do": "Submit", } stream = download.openurl( url=self.SERVERURL, data=urllib.urlencode(data_for.items()), ) self.job_folder = parse_submission_page(stream=stream) stream.close()
def __init__(self, pdbstr, name): from iotbx.pdb import download import urllib data_for = { "pdb": pdbstr, "bfactorPDB": "Yes", "name": name, "nomail": "Yes", "do": "Submit", } stream = download.openurl( url = self.SERVERURL, data = urllib.urlencode( data_for.items() ), ) self.job_folder = parse_submission_page( stream = stream ) stream.close()
def __init__(self, pdbstr, name): from iotbx.pdb import download import urllib data_for = { "pdb": pdbstr, "bfactorPDB": "Yes", "name": name, "email": "*****@*****.**", "do": "Submit", } stream = download.openurl( url = self.SERVERURL, data = urllib.urlencode( data_for.items() ), encodings = [], storage = download.no_storage, ) self.job_folder = parse_submission_page( stream = stream )
def __call__(self): from iotbx.pdb import download return download.openurl(url="%s/%s" % (self.job_folder, self.OUTPUTFILE), )
def single(self, identifier): stream = openurl( url = ( self.url + self.namer( identifier = identifier ) ).encode(), ) return stream