Merge pull request #576 from Vulcalien/fix-dbg-messages
Remove duplicated info in some debug messages
This commit is contained in:
commit
fc528b203a
|
@ -42,11 +42,10 @@ class Borg:
|
||||||
if borgtype is None:
|
if borgtype is None:
|
||||||
raise TypeError('Borg::__init__: You must pass a borgtype')
|
raise TypeError('Borg::__init__: You must pass a borgtype')
|
||||||
if borgtype not in self.__shared_state:
|
if borgtype not in self.__shared_state:
|
||||||
dbg('Borg::__init__: Preparing borg state for %s' % borgtype)
|
dbg('Preparing borg state for %s' % borgtype)
|
||||||
self.__shared_state[borgtype] = {}
|
self.__shared_state[borgtype] = {}
|
||||||
self.__dict__ = self.__shared_state[borgtype]
|
self.__dict__ = self.__shared_state[borgtype]
|
||||||
|
|
||||||
def prepare_attributes(self):
|
def prepare_attributes(self):
|
||||||
"""This should be used to prepare any attributes of the borg class."""
|
"""This should be used to prepare any attributes of the borg class."""
|
||||||
raise NotImplementedError('prepare_attributes')
|
raise NotImplementedError('prepare_attributes')
|
||||||
|
|
||||||
|
|
|
@ -321,10 +321,10 @@ class Config(object):
|
||||||
if not force and options and options.profile and profile == 'default':
|
if not force and options and options.profile and profile == 'default':
|
||||||
dbg('overriding default profile to %s' % options.profile)
|
dbg('overriding default profile to %s' % options.profile)
|
||||||
profile = options.profile
|
profile = options.profile
|
||||||
dbg('Config::set_profile: Changing profile to %s' % profile)
|
dbg('Changing profile to %s' % profile)
|
||||||
self.profile = profile
|
self.profile = profile
|
||||||
if profile not in self.base.profiles:
|
if profile not in self.base.profiles:
|
||||||
dbg('Config::set_profile: %s does not exist, creating' % profile)
|
dbg('%s does not exist, creating' % profile)
|
||||||
self.base.profiles[profile] = copy(DEFAULTS['profiles']['default'])
|
self.base.profiles[profile] = copy(DEFAULTS['profiles']['default'])
|
||||||
|
|
||||||
def add_profile(self, profile, toclone):
|
def add_profile(self, profile, toclone):
|
||||||
|
@ -617,7 +617,7 @@ class ConfigBase(Borg):
|
||||||
def load(self):
|
def load(self):
|
||||||
"""Load configuration data from our various sources"""
|
"""Load configuration data from our various sources"""
|
||||||
if self.loaded is True:
|
if self.loaded is True:
|
||||||
dbg('ConfigBase::load: config already loaded')
|
dbg('config already loaded')
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.command_line_options and self.command_line_options.config:
|
if self.command_line_options and self.command_line_options.config:
|
||||||
|
@ -665,11 +665,11 @@ class ConfigBase(Borg):
|
||||||
dbg('config validated successfully')
|
dbg('config validated successfully')
|
||||||
|
|
||||||
for section_name in self.sections:
|
for section_name in self.sections:
|
||||||
dbg('ConfigBase::load: Processing section: %s' % section_name)
|
dbg('Processing section: %s' % section_name)
|
||||||
section = getattr(self, section_name)
|
section = getattr(self, section_name)
|
||||||
if section_name == 'profiles':
|
if section_name == 'profiles':
|
||||||
for profile in parser[section_name]:
|
for profile in parser[section_name]:
|
||||||
dbg('ConfigBase::load: Processing profile: %s' % profile)
|
dbg('Processing profile: %s' % profile)
|
||||||
if section_name not in section:
|
if section_name not in section:
|
||||||
# FIXME: Should this be outside the loop?
|
# FIXME: Should this be outside the loop?
|
||||||
section[profile] = copy(DEFAULTS['profiles']['default'])
|
section[profile] = copy(DEFAULTS['profiles']['default'])
|
||||||
|
@ -678,13 +678,11 @@ class ConfigBase(Borg):
|
||||||
if section_name not in parser:
|
if section_name not in parser:
|
||||||
continue
|
continue
|
||||||
for part in parser[section_name]:
|
for part in parser[section_name]:
|
||||||
dbg('ConfigBase::load: Processing %s: %s' % (section_name,
|
dbg('Processing %s: %s' % (section_name, part))
|
||||||
part))
|
|
||||||
section[part] = parser[section_name][part]
|
section[part] = parser[section_name][part]
|
||||||
elif section_name == 'layouts':
|
elif section_name == 'layouts':
|
||||||
for layout in parser[section_name]:
|
for layout in parser[section_name]:
|
||||||
dbg('ConfigBase::load: Processing %s: %s' % (section_name,
|
dbg('Processing %s: %s' % (section_name, layout))
|
||||||
layout))
|
|
||||||
if layout == 'default' and \
|
if layout == 'default' and \
|
||||||
parser[section_name][layout] == {}:
|
parser[section_name][layout] == {}:
|
||||||
continue
|
continue
|
||||||
|
@ -693,8 +691,7 @@ class ConfigBase(Borg):
|
||||||
if section_name not in parser:
|
if section_name not in parser:
|
||||||
continue
|
continue
|
||||||
for part in parser[section_name]:
|
for part in parser[section_name]:
|
||||||
dbg('ConfigBase::load: Processing %s: %s' % (section_name,
|
dbg('Processing %s: %s' % (section_name, part))
|
||||||
part))
|
|
||||||
if parser[section_name][part] == 'None':
|
if parser[section_name][part] == 'None':
|
||||||
section[part] = None
|
section[part] = None
|
||||||
else:
|
else:
|
||||||
|
@ -703,8 +700,7 @@ class ConfigBase(Borg):
|
||||||
try:
|
try:
|
||||||
section.update(parser[section_name])
|
section.update(parser[section_name])
|
||||||
except KeyError as ex:
|
except KeyError as ex:
|
||||||
dbg('ConfigBase::load: skipping missing section %s' %
|
dbg('skipping missing section %s' % section_name)
|
||||||
section_name)
|
|
||||||
|
|
||||||
self.loaded = True
|
self.loaded = True
|
||||||
|
|
||||||
|
@ -715,12 +711,12 @@ class ConfigBase(Borg):
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
"""Save the config to a file"""
|
"""Save the config to a file"""
|
||||||
dbg('ConfigBase::save: saving config')
|
dbg('saving config')
|
||||||
parser = ConfigObj(encoding='utf-8')
|
parser = ConfigObj(encoding='utf-8')
|
||||||
parser.indent_type = ' '
|
parser.indent_type = ' '
|
||||||
|
|
||||||
for section_name in ['global_config', 'keybindings']:
|
for section_name in ['global_config', 'keybindings']:
|
||||||
dbg('ConfigBase::save: Processing section: %s' % section_name)
|
dbg('Processing section: %s' % section_name)
|
||||||
section = getattr(self, section_name)
|
section = getattr(self, section_name)
|
||||||
parser[section_name] = dict_diff(DEFAULTS[section_name], section)
|
parser[section_name] = dict_diff(DEFAULTS[section_name], section)
|
||||||
|
|
||||||
|
@ -730,7 +726,7 @@ class ConfigBase(Borg):
|
||||||
for profile in self.profiles:
|
for profile in self.profiles:
|
||||||
if profile == JSON_PROFILE_NAME:
|
if profile == JSON_PROFILE_NAME:
|
||||||
continue
|
continue
|
||||||
dbg('ConfigBase::save: Processing profile: %s' % profile)
|
dbg('Processing profile: %s' % profile)
|
||||||
parser['profiles'][profile] = dict_diff(
|
parser['profiles'][profile] = dict_diff(
|
||||||
DEFAULTS['profiles']['default'], self.profiles[profile])
|
DEFAULTS['profiles']['default'], self.profiles[profile])
|
||||||
|
|
||||||
|
@ -738,12 +734,12 @@ class ConfigBase(Borg):
|
||||||
for layout in self.layouts:
|
for layout in self.layouts:
|
||||||
if layout == JSON_LAYOUT_NAME:
|
if layout == JSON_LAYOUT_NAME:
|
||||||
continue
|
continue
|
||||||
dbg('ConfigBase::save: Processing layout: %s' % layout)
|
dbg('Processing layout: %s' % layout)
|
||||||
parser['layouts'][layout] = self.layouts[layout]
|
parser['layouts'][layout] = self.layouts[layout]
|
||||||
|
|
||||||
parser['plugins'] = {}
|
parser['plugins'] = {}
|
||||||
for plugin in self.plugins:
|
for plugin in self.plugins:
|
||||||
dbg('ConfigBase::save: Processing plugin: %s' % plugin)
|
dbg('Processing plugin: %s' % plugin)
|
||||||
parser['plugins'][plugin] = self.plugins[plugin]
|
parser['plugins'][plugin] = self.plugins[plugin]
|
||||||
|
|
||||||
config_dir = get_config_dir()
|
config_dir = get_config_dir()
|
||||||
|
@ -776,17 +772,17 @@ class ConfigBase(Borg):
|
||||||
profile = 'default'
|
profile = 'default'
|
||||||
|
|
||||||
if key in self.global_config:
|
if key in self.global_config:
|
||||||
dbg('ConfigBase::get_item: %s found in globals: %s' %
|
dbg('%s found in globals: %s' %
|
||||||
(key, self.global_config[key]))
|
(key, self.global_config[key]))
|
||||||
return(self.global_config[key])
|
return(self.global_config[key])
|
||||||
elif key in self.profiles[profile]:
|
elif key in self.profiles[profile]:
|
||||||
dbg('ConfigBase::get_item: %s found in profile %s: %s' % (
|
dbg('%s found in profile %s: %s' % (
|
||||||
key, profile, self.profiles[profile][key]))
|
key, profile, self.profiles[profile][key]))
|
||||||
return(self.profiles[profile][key])
|
return(self.profiles[profile][key])
|
||||||
elif key == 'keybindings':
|
elif key == 'keybindings':
|
||||||
return(self.keybindings)
|
return(self.keybindings)
|
||||||
elif plugin and plugin in self.plugins and key in self.plugins[plugin]:
|
elif plugin and plugin in self.plugins and key in self.plugins[plugin]:
|
||||||
dbg('ConfigBase::get_item: %s found in plugin %s: %s' % (
|
dbg('%s found in plugin %s: %s' % (
|
||||||
key, plugin, self.plugins[plugin][key]))
|
key, plugin, self.plugins[plugin][key]))
|
||||||
return(self.plugins[plugin][key])
|
return(self.plugins[plugin][key])
|
||||||
elif default:
|
elif default:
|
||||||
|
@ -796,7 +792,7 @@ class ConfigBase(Borg):
|
||||||
|
|
||||||
def set_item(self, key, value, profile='default', plugin=None):
|
def set_item(self, key, value, profile='default', plugin=None):
|
||||||
"""Set a configuration item"""
|
"""Set a configuration item"""
|
||||||
dbg('ConfigBase::set_item: Setting %s=%s (profile=%s, plugin=%s)' %
|
dbg('Setting %s=%s (profile=%s, plugin=%s)' %
|
||||||
(key, value, profile, plugin))
|
(key, value, profile, plugin))
|
||||||
|
|
||||||
if key in self.global_config:
|
if key in self.global_config:
|
||||||
|
|
|
@ -114,7 +114,7 @@ class Container(object):
|
||||||
try:
|
try:
|
||||||
if self.get_property('term_zoomed'):
|
if self.get_property('term_zoomed'):
|
||||||
# We're zoomed, so unzoom and then start closing again
|
# We're zoomed, so unzoom and then start closing again
|
||||||
dbg('Container::closeterm: terminal zoomed, unzooming')
|
dbg('terminal zoomed, unzooming')
|
||||||
self.unzoom(widget)
|
self.unzoom(widget)
|
||||||
widget.close()
|
widget.close()
|
||||||
return(True)
|
return(True)
|
||||||
|
@ -122,7 +122,7 @@ class Container(object):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if not self.remove(widget):
|
if not self.remove(widget):
|
||||||
dbg('Container::closeterm: self.remove() failed for %s' % widget)
|
dbg('self.remove() failed for %s' % widget)
|
||||||
return(False)
|
return(False)
|
||||||
|
|
||||||
self.terminator.deregister_terminal(widget)
|
self.terminator.deregister_terminal(widget)
|
||||||
|
|
|
@ -89,7 +89,7 @@ class Factory(Borg):
|
||||||
err('Factory::make: requested object does not exist: %s' % product)
|
err('Factory::make: requested object does not exist: %s' % product)
|
||||||
return(None)
|
return(None)
|
||||||
|
|
||||||
dbg('Factory::make: created a %s' % product)
|
dbg('created a %s' % product)
|
||||||
output = func(**kwargs)
|
output = func(**kwargs)
|
||||||
inject_uuid(output)
|
inject_uuid(output)
|
||||||
return(output)
|
return(output)
|
||||||
|
@ -118,4 +118,3 @@ class Factory(Borg):
|
||||||
"""Make a Notebook"""
|
"""Make a Notebook"""
|
||||||
from . import notebook
|
from . import notebook
|
||||||
return(notebook.Notebook(kwargs['window']))
|
return(notebook.Notebook(kwargs['window']))
|
||||||
|
|
||||||
|
|
|
@ -342,12 +342,12 @@ class Notebook(Container, Gtk.Notebook):
|
||||||
|
|
||||||
def wrapcloseterm(self, widget):
|
def wrapcloseterm(self, widget):
|
||||||
"""A child terminal has closed"""
|
"""A child terminal has closed"""
|
||||||
dbg('Notebook::wrapcloseterm: called on %s' % widget)
|
dbg('called on %s' % widget)
|
||||||
if self.closeterm(widget):
|
if self.closeterm(widget):
|
||||||
dbg('Notebook::wrapcloseterm: closeterm succeeded')
|
dbg('closeterm succeeded')
|
||||||
self.hoover()
|
self.hoover()
|
||||||
else:
|
else:
|
||||||
dbg('Notebook::wrapcloseterm: closeterm failed')
|
dbg('closeterm failed')
|
||||||
|
|
||||||
def closetab(self, widget, label):
|
def closetab(self, widget, label):
|
||||||
"""Close a tab"""
|
"""Close a tab"""
|
||||||
|
@ -371,7 +371,7 @@ class Notebook(Container, Gtk.Notebook):
|
||||||
child = nb.get_nth_page(tabnum)
|
child = nb.get_nth_page(tabnum)
|
||||||
|
|
||||||
if maker.isinstance(child, 'Terminal'):
|
if maker.isinstance(child, 'Terminal'):
|
||||||
dbg('Notebook::closetab: child is a single Terminal')
|
dbg('child is a single Terminal')
|
||||||
del nb.last_active_term[child]
|
del nb.last_active_term[child]
|
||||||
child.close()
|
child.close()
|
||||||
# FIXME: We only do this del and return here to avoid removing the
|
# FIXME: We only do this del and return here to avoid removing the
|
||||||
|
@ -379,7 +379,7 @@ class Notebook(Container, Gtk.Notebook):
|
||||||
del(label)
|
del(label)
|
||||||
return
|
return
|
||||||
elif maker.isinstance(child, 'Container'):
|
elif maker.isinstance(child, 'Container'):
|
||||||
dbg('Notebook::closetab: child is a Container')
|
dbg('child is a Container')
|
||||||
result = self.construct_confirm_close(self.window, _('tab'))
|
result = self.construct_confirm_close(self.window, _('tab'))
|
||||||
|
|
||||||
if result == Gtk.ResponseType.ACCEPT:
|
if result == Gtk.ResponseType.ACCEPT:
|
||||||
|
@ -394,7 +394,7 @@ class Notebook(Container, Gtk.Notebook):
|
||||||
Gtk.main_iteration()
|
Gtk.main_iteration()
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
dbg('Notebook::closetab: user cancelled request')
|
dbg('user cancelled request')
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
err('Notebook::closetab: child is unknown type %s' % child)
|
err('Notebook::closetab: child is unknown type %s' % child)
|
||||||
|
|
|
@ -166,6 +166,6 @@ icon for the window (by file or name)'))
|
||||||
optionslist[opt] = val and '%s'%val or ''
|
optionslist[opt] = val and '%s'%val or ''
|
||||||
# optionslist = dbus.Dictionary(optionslist, signature='ss')
|
# optionslist = dbus.Dictionary(optionslist, signature='ss')
|
||||||
if util.DEBUG == True:
|
if util.DEBUG == True:
|
||||||
dbg('OptionParse::parse_options: command line options: %s' % options)
|
dbg('command line options: %s' % options)
|
||||||
|
|
||||||
return(options,optionslist)
|
return(options,optionslist)
|
||||||
|
|
|
@ -272,7 +272,7 @@ class Paned(Container):
|
||||||
|
|
||||||
def wrapcloseterm(self, widget):
|
def wrapcloseterm(self, widget):
|
||||||
"""A child terminal has closed, so this container must die"""
|
"""A child terminal has closed, so this container must die"""
|
||||||
dbg('Paned::wrapcloseterm: Called on %s' % widget)
|
dbg('Called on %s' % widget)
|
||||||
|
|
||||||
if self.closeterm(widget):
|
if self.closeterm(widget):
|
||||||
# At this point we only have one child, which is the surviving term
|
# At this point we only have one child, which is the surviving term
|
||||||
|
@ -316,12 +316,12 @@ class Paned(Container):
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
dbg('cannot find terminal with uuid: %s' % sibling.get_toplevel().last_active_term.urn)
|
dbg('cannot find terminal with uuid: %s' % sibling.get_toplevel().last_active_term.urn)
|
||||||
else:
|
else:
|
||||||
dbg("Paned::wrapcloseterm: self.closeterm failed")
|
dbg("self.closeterm failed")
|
||||||
|
|
||||||
def hoover(self):
|
def hoover(self):
|
||||||
"""Check that we still have a reason to exist"""
|
"""Check that we still have a reason to exist"""
|
||||||
if len(self.children) == 1:
|
if len(self.children) == 1:
|
||||||
dbg('Paned::hoover: We only have one child, die')
|
dbg('We only have one child, die')
|
||||||
parent = self.get_parent()
|
parent = self.get_parent()
|
||||||
child = self.children[0]
|
child = self.children[0]
|
||||||
self.remove(child)
|
self.remove(child)
|
||||||
|
|
|
@ -63,8 +63,7 @@ class PluginRegistry(borg.Borg):
|
||||||
(head, _tail) = os.path.split(borg.__file__)
|
(head, _tail) = os.path.split(borg.__file__)
|
||||||
self.path.append(os.path.join(head, 'plugins'))
|
self.path.append(os.path.join(head, 'plugins'))
|
||||||
self.path.append(os.path.join(get_config_dir(), 'plugins'))
|
self.path.append(os.path.join(get_config_dir(), 'plugins'))
|
||||||
dbg('PluginRegistry::prepare_attributes: Plugin path: %s' %
|
dbg('Plugin path: %s' % self.path)
|
||||||
self.path)
|
|
||||||
if not self.done:
|
if not self.done:
|
||||||
self.done = False
|
self.done = False
|
||||||
if not self.available_plugins:
|
if not self.available_plugins:
|
||||||
|
@ -73,7 +72,7 @@ class PluginRegistry(borg.Borg):
|
||||||
def load_plugins(self):
|
def load_plugins(self):
|
||||||
"""Load all plugins present in the plugins/ directory in our module"""
|
"""Load all plugins present in the plugins/ directory in our module"""
|
||||||
if self.done:
|
if self.done:
|
||||||
dbg('PluginRegistry::load_plugins: Already loaded')
|
dbg('Already loaded')
|
||||||
return
|
return
|
||||||
|
|
||||||
config = Config()
|
config = Config()
|
||||||
|
@ -90,8 +89,7 @@ class PluginRegistry(borg.Borg):
|
||||||
continue
|
continue
|
||||||
pluginpath = os.path.join(plugindir, plugin)
|
pluginpath = os.path.join(plugindir, plugin)
|
||||||
if os.path.isfile(pluginpath) and plugin[-3:] == '.py':
|
if os.path.isfile(pluginpath) and plugin[-3:] == '.py':
|
||||||
dbg('PluginRegistry::load_plugins: Importing plugin %s' %
|
dbg('Importing plugin %s' % plugin)
|
||||||
plugin)
|
|
||||||
try:
|
try:
|
||||||
module = __import__(plugin[:-3], None, None, [''])
|
module = __import__(plugin[:-3], None, None, [''])
|
||||||
for item in getattr(module, 'AVAILABLE'):
|
for item in getattr(module, 'AVAILABLE'):
|
||||||
|
@ -113,7 +111,7 @@ failed: %s' % (plugin, ex))
|
||||||
def get_plugins_by_capability(self, capability):
|
def get_plugins_by_capability(self, capability):
|
||||||
"""Return a list of plugins with a particular capability"""
|
"""Return a list of plugins with a particular capability"""
|
||||||
result = []
|
result = []
|
||||||
dbg('PluginRegistry::get_plugins_by_capability: searching %d plugins \
|
dbg('searching %d plugins \
|
||||||
for %s' % (len(self.instances), capability))
|
for %s' % (len(self.instances), capability))
|
||||||
for plugin in self.instances:
|
for plugin in self.instances:
|
||||||
if capability in self.instances[plugin].capabilities:
|
if capability in self.instances[plugin].capabilities:
|
||||||
|
@ -189,4 +187,3 @@ class MenuItem(Plugin):
|
||||||
def callback(self, menuitems, menu, terminal):
|
def callback(self, menuitems, menu, terminal):
|
||||||
"""Callback to transform the enclosed URL"""
|
"""Callback to transform the enclosed URL"""
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
|
@ -456,7 +456,7 @@ class PrefsEditor:
|
||||||
self.config.set_profile(profile)
|
self.config.set_profile(profile)
|
||||||
guiget = self.builder.get_object
|
guiget = self.builder.get_object
|
||||||
|
|
||||||
dbg('PrefsEditor::set_profile_values: Setting profile %s' % profile)
|
dbg('Setting profile %s' % profile)
|
||||||
|
|
||||||
## General tab
|
## General tab
|
||||||
# Use system font
|
# Use system font
|
||||||
|
@ -1633,8 +1633,7 @@ class PrefsEditor:
|
||||||
oldname = cell.get_property('text')
|
oldname = cell.get_property('text')
|
||||||
if oldname == newtext or oldname == 'default':
|
if oldname == newtext or oldname == 'default':
|
||||||
return
|
return
|
||||||
dbg('PrefsEditor::on_profile_name_edited: Changing %s to %s' %
|
dbg('Changing %s to %s' % (oldname, newtext))
|
||||||
(oldname, newtext))
|
|
||||||
self.config.rename_profile(oldname, newtext)
|
self.config.rename_profile(oldname, newtext)
|
||||||
self.config.save()
|
self.config.save()
|
||||||
|
|
||||||
|
|
|
@ -551,7 +551,7 @@ class Terminal(Gtk.VBox):
|
||||||
_('Broadcast _off'):'off'}.items()):
|
_('Broadcast _off'):'off'}.items()):
|
||||||
item = Gtk.RadioMenuItem.new_with_mnemonic(groupitems, key)
|
item = Gtk.RadioMenuItem.new_with_mnemonic(groupitems, key)
|
||||||
groupitems = item.get_group()
|
groupitems = item.get_group()
|
||||||
dbg('Terminal::populate_group_menu: %s active: %s' %
|
dbg('%s active: %s' %
|
||||||
(key, self.terminator.groupsend ==
|
(key, self.terminator.groupsend ==
|
||||||
self.terminator.groupsend_type[value]))
|
self.terminator.groupsend_type[value]))
|
||||||
item.set_active(self.terminator.groupsend ==
|
item.set_active(self.terminator.groupsend ==
|
||||||
|
@ -618,7 +618,7 @@ class Terminal(Gtk.VBox):
|
||||||
"""Set the groupsend mode"""
|
"""Set the groupsend mode"""
|
||||||
# FIXME: Can we think of a smarter way of doing this than poking?
|
# FIXME: Can we think of a smarter way of doing this than poking?
|
||||||
if value in list(self.terminator.groupsend_type.values()):
|
if value in list(self.terminator.groupsend_type.values()):
|
||||||
dbg('Terminal::set_groupsend: setting groupsend to %s' % value)
|
dbg('setting groupsend to %s' % value)
|
||||||
self.terminator.groupsend = value
|
self.terminator.groupsend = value
|
||||||
|
|
||||||
def do_splittogroup_toggle(self):
|
def do_splittogroup_toggle(self):
|
||||||
|
@ -904,7 +904,7 @@ class Terminal(Gtk.VBox):
|
||||||
def on_keypress(self, widget, event):
|
def on_keypress(self, widget, event):
|
||||||
"""Handler for keyboard events"""
|
"""Handler for keyboard events"""
|
||||||
if not event:
|
if not event:
|
||||||
dbg('Terminal::on_keypress: Called on %s with no event' % widget)
|
dbg('Called on %s with no event' % widget)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# FIXME: Does keybindings really want to live in Terminator()?
|
# FIXME: Does keybindings really want to live in Terminator()?
|
||||||
|
@ -915,7 +915,7 @@ class Terminal(Gtk.VBox):
|
||||||
|
|
||||||
if mapping and mapping not in ['close_window',
|
if mapping and mapping not in ['close_window',
|
||||||
'full_screen']:
|
'full_screen']:
|
||||||
dbg('Terminal::on_keypress: lookup found: %r' % mapping)
|
dbg('lookup found: %r' % mapping)
|
||||||
# handle the case where user has re-bound copy to ctrl+<key>
|
# handle the case where user has re-bound copy to ctrl+<key>
|
||||||
# we only copy if there is a selection otherwise let it fall through
|
# we only copy if there is a selection otherwise let it fall through
|
||||||
# to ^<key>
|
# to ^<key>
|
||||||
|
@ -1379,7 +1379,7 @@ class Terminal(Gtk.VBox):
|
||||||
new_rows = self.vte.get_row_count()
|
new_rows = self.vte.get_row_count()
|
||||||
new_font = self.vte.get_font()
|
new_font = self.vte.get_font()
|
||||||
|
|
||||||
dbg('Terminal::zoom_scale: Resized from %dx%d to %dx%d' % (
|
dbg('Resized from %dx%d to %dx%d' % (
|
||||||
old_data['old_columns'],
|
old_data['old_columns'],
|
||||||
old_data['old_rows'],
|
old_data['old_rows'],
|
||||||
new_columns,
|
new_columns,
|
||||||
|
@ -1387,7 +1387,7 @@ class Terminal(Gtk.VBox):
|
||||||
|
|
||||||
if new_rows == old_data['old_rows'] or \
|
if new_rows == old_data['old_rows'] or \
|
||||||
new_columns == old_data['old_columns']:
|
new_columns == old_data['old_columns']:
|
||||||
dbg('Terminal::zoom_scale: One axis unchanged, not scaling')
|
dbg('One axis unchanged, not scaling')
|
||||||
return
|
return
|
||||||
|
|
||||||
scale_factor = min ( (new_columns / old_data['old_columns'] * 0.97),
|
scale_factor = min ( (new_columns / old_data['old_columns'] * 0.97),
|
||||||
|
@ -1629,7 +1629,7 @@ class Terminal(Gtk.VBox):
|
||||||
font = self.config.get_system_mono_font()
|
font = self.config.get_system_mono_font()
|
||||||
else:
|
else:
|
||||||
font = self.config['font']
|
font = self.config['font']
|
||||||
dbg("Terminal::zoom_orig: restoring font to: %s" % font)
|
dbg("restoring font to: %s" % font)
|
||||||
self.set_font(Pango.FontDescription(font))
|
self.set_font(Pango.FontDescription(font))
|
||||||
self.custom_font_size = None
|
self.custom_font_size = None
|
||||||
|
|
||||||
|
|
|
@ -123,14 +123,12 @@ class Terminator(Borg):
|
||||||
def register_window(self, window):
|
def register_window(self, window):
|
||||||
"""Register a new window widget"""
|
"""Register a new window widget"""
|
||||||
if window not in self.windows:
|
if window not in self.windows:
|
||||||
dbg('Terminator::register_window: registering %s:%s' % (id(window),
|
dbg('registering %s:%s' % (id(window), type(window)))
|
||||||
type(window)))
|
|
||||||
self.windows.append(window)
|
self.windows.append(window)
|
||||||
|
|
||||||
def deregister_window(self, window):
|
def deregister_window(self, window):
|
||||||
"""de-register a window widget"""
|
"""de-register a window widget"""
|
||||||
dbg('Terminator::deregister_window: de-registering %s:%s' %
|
dbg('de-registering %s:%s' % (id(window), type(window)))
|
||||||
(id(window), type(window)))
|
|
||||||
if window in self.windows:
|
if window in self.windows:
|
||||||
self.windows.remove(window)
|
self.windows.remove(window)
|
||||||
else:
|
else:
|
||||||
|
@ -144,14 +142,12 @@ class Terminator(Borg):
|
||||||
def register_launcher_window(self, window):
|
def register_launcher_window(self, window):
|
||||||
"""Register a new launcher window widget"""
|
"""Register a new launcher window widget"""
|
||||||
if window not in self.launcher_windows:
|
if window not in self.launcher_windows:
|
||||||
dbg('Terminator::register_launcher_window: registering %s:%s' % (id(window),
|
dbg('registering %s:%s' % (id(window), type(window)))
|
||||||
type(window)))
|
|
||||||
self.launcher_windows.append(window)
|
self.launcher_windows.append(window)
|
||||||
|
|
||||||
def deregister_launcher_window(self, window):
|
def deregister_launcher_window(self, window):
|
||||||
"""de-register a launcher window widget"""
|
"""de-register a launcher window widget"""
|
||||||
dbg('Terminator::deregister_launcher_window: de-registering %s:%s' %
|
dbg('de-registering %s:%s' % (id(window), type(window)))
|
||||||
(id(window), type(window)))
|
|
||||||
if window in self.launcher_windows:
|
if window in self.launcher_windows:
|
||||||
self.launcher_windows.remove(window)
|
self.launcher_windows.remove(window)
|
||||||
else:
|
else:
|
||||||
|
@ -165,13 +161,13 @@ class Terminator(Borg):
|
||||||
def register_terminal(self, terminal):
|
def register_terminal(self, terminal):
|
||||||
"""Register a new terminal widget"""
|
"""Register a new terminal widget"""
|
||||||
if terminal not in self.terminals:
|
if terminal not in self.terminals:
|
||||||
dbg('Terminator::register_terminal: registering %s:%s' %
|
dbg('registering %s:%s' %
|
||||||
(id(terminal), type(terminal)))
|
(id(terminal), type(terminal)))
|
||||||
self.terminals.append(terminal)
|
self.terminals.append(terminal)
|
||||||
|
|
||||||
def deregister_terminal(self, terminal):
|
def deregister_terminal(self, terminal):
|
||||||
"""De-register a terminal widget"""
|
"""De-register a terminal widget"""
|
||||||
dbg('Terminator::deregister_terminal: de-registering %s:%s' %
|
dbg('de-registering %s:%s' %
|
||||||
(id(terminal), type(terminal)))
|
(id(terminal), type(terminal)))
|
||||||
self.terminals.remove(terminal)
|
self.terminals.remove(terminal)
|
||||||
|
|
||||||
|
@ -180,8 +176,7 @@ class Terminator(Borg):
|
||||||
for window in self.windows:
|
for window in self.windows:
|
||||||
window.destroy()
|
window.destroy()
|
||||||
else:
|
else:
|
||||||
dbg('Terminator::deregister_terminal: %d terminals remain' %
|
dbg('%d terminals remain' % len(self.terminals))
|
||||||
len(self.terminals))
|
|
||||||
|
|
||||||
def find_terminal_by_uuid(self, uuid):
|
def find_terminal_by_uuid(self, uuid):
|
||||||
"""Search our terminals for one matching the supplied UUID"""
|
"""Search our terminals for one matching the supplied UUID"""
|
||||||
|
@ -531,7 +526,7 @@ class Terminator(Borg):
|
||||||
def create_group(self, name):
|
def create_group(self, name):
|
||||||
"""Create a new group"""
|
"""Create a new group"""
|
||||||
if name not in self.groups:
|
if name not in self.groups:
|
||||||
dbg('Terminator::create_group: registering group %s' % name)
|
dbg('registering group %s' % name)
|
||||||
self.groups.append(name)
|
self.groups.append(name)
|
||||||
|
|
||||||
def closegroupedterms(self, group):
|
def closegroupedterms(self, group):
|
||||||
|
@ -556,15 +551,14 @@ class Terminator(Borg):
|
||||||
if not group in inuse:
|
if not group in inuse:
|
||||||
todestroy.append(group)
|
todestroy.append(group)
|
||||||
|
|
||||||
dbg('Terminator::group_hoover: %d groups, hoovering %d' %
|
dbg('%d groups, hoovering %d' %
|
||||||
(len(self.groups), len(todestroy)))
|
(len(self.groups), len(todestroy)))
|
||||||
for group in todestroy:
|
for group in todestroy:
|
||||||
self.groups.remove(group)
|
self.groups.remove(group)
|
||||||
|
|
||||||
def group_emit(self, terminal, group, type, event):
|
def group_emit(self, terminal, group, type, event):
|
||||||
"""Emit to each terminal in a group"""
|
"""Emit to each terminal in a group"""
|
||||||
dbg('Terminator::group_emit: emitting a keystroke for group %s' %
|
dbg('emitting a keystroke for group %s' % group)
|
||||||
group)
|
|
||||||
for term in self.terminals:
|
for term in self.terminals:
|
||||||
if term != terminal and term.group == group:
|
if term != terminal and term.group == group:
|
||||||
term.vte.emit(type, eventkey2gdkevent(event))
|
term.vte.emit(type, eventkey2gdkevent(event))
|
||||||
|
|
|
@ -283,7 +283,7 @@ class Titlebar(Gtk.EventBox):
|
||||||
def groupentry_activate(self, widget):
|
def groupentry_activate(self, widget):
|
||||||
"""Actually cause a group to be created"""
|
"""Actually cause a group to be created"""
|
||||||
groupname = self.groupentry.get_text() or None
|
groupname = self.groupentry.get_text() or None
|
||||||
dbg('Titlebar::groupentry_activate: creating group: %s' % groupname)
|
dbg('creating group: %s' % groupname)
|
||||||
self.groupentry_cancel(None, None)
|
self.groupentry_cancel(None, None)
|
||||||
last_focused_term=self.terminator.last_focused_term
|
last_focused_term=self.terminator.last_focused_term
|
||||||
if self.terminal.targets_for_new_group:
|
if self.terminal.targets_for_new_group:
|
||||||
|
|
|
@ -212,7 +212,7 @@ class Window(Container, Gtk.Window):
|
||||||
mapping = self.terminator.keybindings.lookup(event)
|
mapping = self.terminator.keybindings.lookup(event)
|
||||||
|
|
||||||
if mapping:
|
if mapping:
|
||||||
dbg('Window::on_key_press: looked up %r' % mapping)
|
dbg('looked up %r' % mapping)
|
||||||
if mapping == 'full_screen':
|
if mapping == 'full_screen':
|
||||||
self.set_fullscreen(not self.isfullscreen)
|
self.set_fullscreen(not self.isfullscreen)
|
||||||
elif mapping == 'close_window':
|
elif mapping == 'close_window':
|
||||||
|
@ -283,7 +283,7 @@ class Window(Container, Gtk.Window):
|
||||||
if self.is_zoomed():
|
if self.is_zoomed():
|
||||||
return(self.confirm_close(window, _('window')))
|
return(self.confirm_close(window, _('window')))
|
||||||
else:
|
else:
|
||||||
dbg('Window::on_delete_event: Only one child, closing is fine')
|
dbg('Only one child, closing is fine')
|
||||||
return(False)
|
return(False)
|
||||||
elif maker.isinstance(self.get_child(), 'Container'):
|
elif maker.isinstance(self.get_child(), 'Container'):
|
||||||
return(self.confirm_close(window, _('window')))
|
return(self.confirm_close(window, _('window')))
|
||||||
|
@ -337,7 +337,7 @@ class Window(Container, Gtk.Window):
|
||||||
Gdk.WindowState.FULLSCREEN)
|
Gdk.WindowState.FULLSCREEN)
|
||||||
self.ismaximised = bool(event.new_window_state &
|
self.ismaximised = bool(event.new_window_state &
|
||||||
Gdk.WindowState.MAXIMIZED)
|
Gdk.WindowState.MAXIMIZED)
|
||||||
dbg('Window::on_window_state_changed: fullscreen=%s, maximised=%s' \
|
dbg('fullscreen=%s, maximised=%s' \
|
||||||
% (self.isfullscreen, self.ismaximised))
|
% (self.isfullscreen, self.ismaximised))
|
||||||
|
|
||||||
return(False)
|
return(False)
|
||||||
|
@ -556,7 +556,7 @@ class Window(Container, Gtk.Window):
|
||||||
"""Restore normal terminal layout"""
|
"""Restore normal terminal layout"""
|
||||||
if not self.is_zoomed():
|
if not self.is_zoomed():
|
||||||
# We're not zoomed anyway
|
# We're not zoomed anyway
|
||||||
dbg('Window::unzoom: not zoomed, no-op')
|
dbg('not zoomed, no-op')
|
||||||
return
|
return
|
||||||
|
|
||||||
widget = self.zoom_data['widget']
|
widget = self.zoom_data['widget']
|
||||||
|
|
Loading…
Reference in New Issue