File: request.py

package info (click to toggle)
python-ihm 2.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,368 kB
  • sloc: python: 30,422; ansic: 5,990; sh: 24; makefile: 20
file content (10 lines) | stat: -rw-r--r-- 237 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
from io import BytesIO
import urllib.error

zinc_atoms = b'_chem_comp_atom.comp_id ZN\n_chem_comp_atom.atom_id ZN\n'


def urlopen(url):
    if 'invalid' in url:
        raise urllib.error.HTTPError("404")
    return BytesIO(zinc_atoms)