Just make using the user's terminal background the default.

This just makes sense. Later on, we'll have a config file in which users can
set the palette, so that they can over-ride the default background if they
really want.
This commit is contained in:
Aldo Cortesi 2010-03-01 14:50:35 +13:00
parent b91156723b
commit 0188cf8a1a
2 changed files with 16 additions and 25 deletions

View File

@ -758,43 +758,37 @@ class ConsoleMaster(controller.Master):
('key', "q"), ":back ", ('key', "q"), ":back ",
] ]
def __init__(self, server, options): def __init__(self, server, options):
self.set_palette(options.terminal_background) self.set_palette()
controller.Master.__init__(self, server) controller.Master.__init__(self, server)
self.config = options.verbose
self.state = State() self.state = State()
self.stickycookie = None self.stickycookie = None
self.stickyhosts = {} self.stickyhosts = {}
def set_palette(self, terminal_background): def set_palette(self):
if terminal_background:
background_color = 'default'
else:
background_color = 'black'
self.palette = [ self.palette = [
('body', 'black', 'dark cyan', 'standout'), ('body', 'black', 'dark cyan', 'standout'),
('foot', 'light gray', background_color), ('foot', 'light gray', 'default'),
('title', 'white', background_color,), ('title', 'white', 'default',),
('editline', 'white', background_color,), ('editline', 'white', 'default',),
# Help # Help
('key', 'light cyan', background_color, 'underline'), ('key', 'light cyan', 'default', 'underline'),
('head', 'white', background_color), ('head', 'white', 'default'),
('text', 'light gray', background_color), ('text', 'light gray', 'default'),
# List and Connections # List and Connections
('method', 'dark cyan', background_color), ('method', 'dark cyan', 'default'),
('focus', 'yellow', background_color), ('focus', 'yellow', 'default'),
('goodcode', 'light green', background_color), ('goodcode', 'light green', 'default'),
('error', 'light red', background_color), ('error', 'light red', 'default'),
('header', 'dark cyan', background_color), ('header', 'dark cyan', 'default'),
('heading', 'white', 'dark blue'), ('heading', 'white', 'dark blue'),
('inactive', 'dark gray', background_color), ('inactive', 'dark gray', 'default'),
('ack', 'light red', background_color), ('ack', 'light red', 'default'),
# Hex view # Hex view
('offset', 'dark cyan', background_color), ('offset', 'dark cyan', 'default'),
] ]
def run(self): def run(self):

View File

@ -35,9 +35,6 @@ if __name__ == '__main__':
type = "int", dest="port", default=8080, type = "int", dest="port", default=8080,
help = "Port." help = "Port."
) )
parser.add_option(
"-t", "--terminal-backround", action="store_true", dest="terminal_background",
default=False, help="Uses the standard terminal background instead of setting an own. Useful for transparent terminals.")
options, args = parser.parse_args() options, args = parser.parse_args()
certpath = os.path.expanduser(options.cert) certpath = os.path.expanduser(options.cert)