4 fd
, tmp
= tempfile
.mkstemp(prefix
= '0publish-')
6 stream
= os
.fdopen(fd
, 'w')
9 editor
= os
.environ
.get('EDITOR', 'vi')
10 if os
.spawnlp(os
.P_WAIT
, editor
, editor
, tmp
):
11 raise Exception('Editing with $EDITOR ("%s") failed')
12 new_data
= file(tmp
).read()
16 raise Exception('Data unchanged after edit. Aborting.')