comparison terminal-title.py @ 2:c86ca2eea6bc default tip

Allow setting the title to an empty string
author Guido Berhoerster <guido+weechat@berhoerster.name>
date Sat, 14 Mar 2015 16:12:32 +0100
parents 98c1a683d9c1
children
comparison
equal deleted inserted replaced
1:98c1a683d9c1 2:c86ca2eea6bc
91 hotlist_items.append("%s:%s" % (buffer_number, short_name)) 91 hotlist_items.append("%s:%s" % (buffer_number, short_name))
92 weechat.infolist_free(hotlist) 92 weechat.infolist_free(hotlist)
93 return ",".join(hotlist_items) 93 return ",".join(hotlist_items)
94 94
95 def set_term_title_hook(data, signal, signal_data): 95 def set_term_title_hook(data, signal, signal_data):
96 title_template_str = weechat.config_get_plugin("title") 96 title_template_str = weechat.config_get_plugin('title')
97 if not title_template_str:
98 return weechat.WEECHAT_RC_OK
99
100 title_template = TermTitleTemplate(title_template_str) 97 title_template = TermTitleTemplate(title_template_str)
101 title_str = title_template.safe_substitute(TermTitleMapping()) 98 title_str = title_template.safe_substitute(TermTitleMapping())
102 sys.__stdout__.write(TERM_TEMPLATE % title_str) 99 sys.__stdout__.write(TERM_TEMPLATE % title_str)
103 sys.__stdout__.flush() 100 sys.__stdout__.flush()
104 101