script-publish.py: Allow emulator selection with --term
authorW. Trevor King <wking@tremily.us>
Sun, 13 Jan 2013 12:50:55 +0000 (07:50 -0500)
committerW. Trevor King <wking@tremily.us>
Sun, 13 Jan 2013 12:50:55 +0000 (07:50 -0500)
commitd4030bed87040dbc8113e97a8855e7539ae5e080
tree742cb0e44ed6caef5ab9d3b87bdf249c5634c450
parent4e989978a8bdf74b3ba6d768b6e46530fb17e8f8
script-publish.py: Allow emulator selection with --term

This means we have to delay ControlCode initialization until the user
has actually selected a terminal.  The curses.setupterm() logic also
assumes that the selected terminal doesn't change after the initial
call.  For our script, this is a safe assumption.  If that assumtion
eventually breaks down, you'll have to cache the last-setup terminal
somewhere, and call setupterm() whenever the current control code's
`.term` doesn't match the cached value.

I also fixed a bug where args.encoding was not being passed to
ScriptServerApp.
posts/script/script-publish.py