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

View File

@ -35,9 +35,6 @@ if __name__ == '__main__':
type = "int", dest="port", default=8080,
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()
certpath = os.path.expanduser(options.cert)