comparison lib/patchablegraph/patchablegraph.py @ 706:b41247c7b080

fix text/plain output Ignore-this: 484512f1c81139ef4788680e2ccef973
author drewp@bigasterisk.com
date Mon, 03 Feb 2020 01:10:35 -0800
parents 74ad667f8c5b
children 5b6022beb388
comparison
equal deleted inserted replaced
705:394c57fcb0bb 706:b41247c7b080
45 else: 45 else:
46 print(f'acceptHeader {acceptHeader}') 46 print(f'acceptHeader {acceptHeader}')
47 if acceptHeader.startswith('text/html'): 47 if acceptHeader.startswith('text/html'):
48 # browser; should arrange to pick live view 48 # browser; should arrange to pick live view
49 req.set_header('Content-type', 'text/plain') 49 req.set_header('Content-type', 'text/plain')
50 lines = graph.serialize(format='nquads') 50 lines = graph.serialize(None, format='nquads').splitlines()
51 lines.sort() 51 lines.sort()
52 req.write(''.join(lines)) 52 req.write(b'\n'.join(lines))
53 return 53 return
54 54
55 req.set_header('Content-type', 'application/x-trig') 55 req.set_header('Content-type', 'application/x-trig')
56 graph.serialize(req, format='trig') 56 graph.serialize(req, format='trig')
57 57