comparison lib/patchablegraph/patchablegraph.py @ 1507:e5c0d387c248

fix text/plain output Ignore-this: 484512f1c81139ef4788680e2ccef973 darcs-hash:d5356b3ee844ece15e1b1ea30736d909e5c54123
author drewp <drewp@bigasterisk.com>
date Mon, 03 Feb 2020 01:10:35 -0800
parents 3cdf76755812
children e41935c0ce96
comparison
equal deleted inserted replaced
1506:fb62c17633df 1507:e5c0d387c248
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