=== modified file 'terminatorlib/__init__.py' --- terminatorlib/__init__.py 2016-11-25 01:29:55 +0000 +++ terminatorlib/__init__.py 2019-02-23 07:31:34 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # Terminator - multiple gnome terminals in one window # Copyright (C) 2006-2010 cmsj@tenshu.net # === modified file 'terminatorlib/borg.py' --- terminatorlib/borg.py 2018-04-18 18:22:47 +0000 +++ terminatorlib/borg.py 2019-02-23 08:54:00 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # Terminator by Chris Jones # GPL v2 only """borg.py - We are the borg. Resistance is futile. @@ -12,11 +12,10 @@ from .util import dbg # pylint: disable-msg=R0903 -# pylint: disable-msg=R0921 class Borg: """Definition of a class that can never be duplicated. Correct usage is thus: - + >>> from borg import Borg >>> class foo(Borg): ... # All attributes on a borg class *must* = None @@ -29,13 +28,13 @@ ... >>> bar = foo() >>> bar.prepare_attributes() - + The important thing to note is that all attributes of borg classes *must* be declared as being None. If you attempt to use static class attributes you will get unpredicted behaviour. Instead, prepare_attributes() must be called which will then see the attributes in the shared state, and initialise them if necessary.""" - __shared_state = {} + __shared_state = {} def __init__(self, borgtype=None): """Class initialiser. Overwrite our class dictionary with the shared === modified file 'terminatorlib/config.py' --- terminatorlib/config.py 2018-04-18 18:30:37 +0000 +++ terminatorlib/config.py 2019-02-23 07:31:34 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # TerminatorConfig - layered config classes # Copyright (C) 2006-2010 cmsj@tenshu.net # === modified file 'terminatorlib/container.py' --- terminatorlib/container.py 2018-04-18 18:22:47 +0000 +++ terminatorlib/container.py 2019-02-23 08:57:01 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # Terminator by Chris Jones # GPL v2 only """container.py - classes necessary to contain Terminal widgets""" @@ -12,7 +12,6 @@ from .translation import _ from .signalman import Signalman -# pylint: disable-msg=R0921 class Container(object): """Base class for Terminator Containers""" @@ -38,7 +37,7 @@ dbg('Container:: skipping signal %s for %s, already exists' % ( signal['name'], widget)) else: - dbg('Container:: registering signal for %s on %s' % + dbg('Container:: registering signal for %s on %s' % (signal['name'], widget)) try: GObject.signal_new(signal['name'], @@ -156,19 +155,19 @@ def construct_confirm_close(self, window, reqtype): """Create a confirmation dialog for closing things""" - + # skip this dialog if applicable if self.config['suppress_multiple_term_dialog']: return Gtk.ResponseType.ACCEPT - + dialog = Gtk.Dialog(_('Close?'), window, Gtk.DialogFlags.MODAL) dialog.set_resizable(False) - + dialog.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.REJECT) c_all = dialog.add_button(Gtk.STOCK_CLOSE, Gtk.ResponseType.ACCEPT) c_all.get_children()[0].get_children()[0].get_children()[1].set_label( _('Close _Terminals')) - + primary = Gtk.Label(label=_('Close multiple terminals?')) primary.set_use_markup(True) primary.set_alignment(0, 0.5) @@ -182,15 +181,15 @@ label_text = '' secondary = Gtk.Label(label=label_text) secondary.set_line_wrap(True) - + labels = Gtk.VBox() labels.pack_start(primary, False, False, 6) labels.pack_start(secondary, False, False, 6) - + image = Gtk.Image.new_from_stock(Gtk.STOCK_DIALOG_WARNING, Gtk.IconSize.DIALOG) image.set_alignment(0.5, 0) - + box = Gtk.HBox() box.pack_start(image, False, False, 6) box.pack_start(labels, False, False, 6) @@ -198,18 +197,18 @@ checkbox = Gtk.CheckButton(_("Do not show this message next time")) dialog.vbox.pack_end(checkbox, True, True, 0) - + dialog.show_all() result = dialog.run() - + # set configuration self.config.base.reload() self.config['suppress_multiple_term_dialog'] = checkbox.get_active() self.config.save() dialog.destroy() - + return(result) def propagate_title_change(self, widget, title): @@ -264,13 +263,13 @@ if hasattr(position, '__iter__'): position = ':'.join([str(x) for x in position]) layout['position'] = position - + if hasattr(self, 'ismaximised'): layout['maximised'] = self.ismaximised - + if hasattr(self, 'isfullscreen'): layout['fullscreen'] = self.isfullscreen - + if hasattr(self, 'ratio'): layout['ratio'] = self.ratio === modified file 'terminatorlib/cwd.py' --- terminatorlib/cwd.py 2018-04-18 18:22:47 +0000 +++ terminatorlib/cwd.py 2019-02-23 07:31:34 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # Terminator by Chris Jones # GPL v2 only """cwd.py - function necessary to get the cwd for a given pid on various OSes === modified file 'terminatorlib/debugserver.py' --- terminatorlib/debugserver.py 2018-04-18 18:22:47 +0000 +++ terminatorlib/debugserver.py 2019-02-23 07:31:34 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # # Copyright (c) 2008, Thomas Hurst # === modified file 'terminatorlib/editablelabel.py' --- terminatorlib/editablelabel.py 2016-11-25 01:29:55 +0000 +++ terminatorlib/editablelabel.py 2019-02-23 07:31:34 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # vim: tabstop=4 softtabstop=4 shiftwidth=4 expandtab # # Copyright (c) 2009, Emmanuel Bretelle === modified file 'terminatorlib/encoding.py' --- terminatorlib/encoding.py 2018-04-18 18:22:47 +0000 +++ terminatorlib/encoding.py 2019-02-23 07:31:34 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # TerminatorEncoding - charset encoding classes # Copyright (C) 2006-2010 chantra@debuntu.org # === modified file 'terminatorlib/factory.py' --- terminatorlib/factory.py 2018-04-18 18:22:47 +0000 +++ terminatorlib/factory.py 2019-02-23 07:31:34 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # Terminator by Chris Jones # GPL v2 only """factory.py - Maker of objects === modified file 'terminatorlib/freebsd.py' --- terminatorlib/freebsd.py 2018-04-18 18:22:47 +0000 +++ terminatorlib/freebsd.py 2019-02-23 07:31:34 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # # Copyright (c) 2008, Thomas Hurst # === modified file 'terminatorlib/ipc.py' --- terminatorlib/ipc.py 2018-04-24 07:28:49 +0000 +++ terminatorlib/ipc.py 2019-02-23 07:31:34 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # Terminator by Chris Jones # GPL v2 only """ipc.py - DBus server and API calls""" === modified file 'terminatorlib/keybindings.py' --- terminatorlib/keybindings.py 2018-04-18 18:22:47 +0000 +++ terminatorlib/keybindings.py 2019-02-23 07:31:34 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # Terminator - multiple gnome terminals in one window # Copyright (C) 2006-2010 cmsj@tenshu.net # === modified file 'terminatorlib/layoutlauncher.py' --- terminatorlib/layoutlauncher.py 2018-04-18 18:22:47 +0000 +++ terminatorlib/layoutlauncher.py 2019-02-23 08:18:33 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # Terminator by Chris Jones # GPL v2 only """layoutlauncher.py - class for the Layout Launcher window""" @@ -72,7 +72,7 @@ """Update the contents of the layout""" self.layouttreestore.clear() layouts = self.config.list_layouts() - for layout in sorted(layouts, cmp=lambda x,y: cmp(x.lower(), y.lower())): + for layout in sorted(l.lower() for l in layouts): if layout != "default": self.layouttreestore.append([layout]) else: === modified file 'terminatorlib/notebook.py' --- terminatorlib/notebook.py 2018-04-18 18:22:47 +0000 +++ terminatorlib/notebook.py 2019-02-23 07:31:34 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # Terminator by Chris Jones # GPL v2 only """notebook.py - classes for the notebook widget""" === modified file 'terminatorlib/optionparse.py' --- terminatorlib/optionparse.py 2018-04-18 18:22:47 +0000 +++ terminatorlib/optionparse.py 2019-02-23 07:31:34 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # Terminator.optionparse - Parse commandline options # Copyright (C) 2006-2010 cmsj@tenshu.net # === modified file 'terminatorlib/paned.py' --- terminatorlib/paned.py 2018-04-18 18:22:47 +0000 +++ terminatorlib/paned.py 2019-02-23 08:36:52 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # Terminator by Chris Jones # GPL v2 only """paned.py - a base Paned container class and the vertical/horizontal @@ -12,7 +12,6 @@ from .factory import Factory from .container import Container -# pylint: disable-msg=R0921 # pylint: disable-msg=E1101 class Paned(Container): """Base class for Paned Containers""" @@ -28,9 +27,9 @@ self.terminator = Terminator() self.maker = Factory() Container.__init__(self) - self.signals.append({'name': 'resize-term', + self.signals.append({'name': 'resize-term', 'flags': GObject.SignalFlags.RUN_LAST, - 'return_type': None, + 'return_type': None, 'param_types': (GObject.TYPE_STRING,)}) @@ -45,7 +44,7 @@ container = VPaned() else: container = HPaned() - + self.get_toplevel().set_pos_by_ratio = True if not sibling: @@ -71,7 +70,7 @@ self.show_all() sibling.grab_focus() - + while Gtk.events_pending(): Gtk.main_iteration_do(False) self.get_toplevel().set_pos_by_ratio = False @@ -141,7 +140,7 @@ recurse_up=True else: recurse_up=False - + if event.get_state() & Gdk.ModifierType.SHIFT_MASK == Gdk.ModifierType.SHIFT_MASK: recurse_down=True else: @@ -184,7 +183,7 @@ highest_ancestor = highest_ancestor.get_parent() highest_ancestor.set_autoresize(False) - + # (1b) If Super modifier, redistribute higher sections too if recurse_up: grandfather=highest_ancestor.get_parent() @@ -195,7 +194,7 @@ highest_ancestor._do_redistribute(recurse_up, recurse_down) GObject.idle_add(highest_ancestor.set_autoresize, True) - + def _do_redistribute(self, recurse_up=False, recurse_down=False): maker = Factory() #2 Make a list of self + all children of same type @@ -221,7 +220,7 @@ (maker.isinstance(child, 'VPaned') or \ maker.isinstance(child, 'HPaned')): child.do_redistribute(False, True) - + #3 Get ancestor x/y => a, and handle size => hs avail_pixels=self.get_length() handle_size = self.get_handlesize() @@ -472,7 +471,7 @@ self.set_position_by_ratio() else: self.set_position(self.get_position()) - + def position_by_ratio(self, total_size, handle_size, ratio): non_separator_size = max(total_size - handle_size, 0) ratio = min(max(ratio, 0.0), 1.0) === modified file 'terminatorlib/plugin.py' --- terminatorlib/plugin.py 2018-04-18 18:22:47 +0000 +++ terminatorlib/plugin.py 2019-02-23 07:31:34 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # Terminator by Chris Jones # GPL v2 only """plugin.py - Base plugin system === modified file 'terminatorlib/plugins/activitywatch.py' --- terminatorlib/plugins/activitywatch.py 2018-04-18 18:22:47 +0000 +++ terminatorlib/plugins/activitywatch.py 2019-02-23 07:31:34 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # Terminator by Chris Jones # GPL v2 only """activitywatch.py - Terminator Plugin to watch a terminal for activity""" === modified file 'terminatorlib/plugins/custom_commands.py' --- terminatorlib/plugins/custom_commands.py 2018-04-18 18:22:47 +0000 +++ terminatorlib/plugins/custom_commands.py 2019-02-23 07:31:34 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # Terminator by Chris Jones # GPL v2 only """custom_commands.py - Terminator Plugin to add custom command menu entries""" === modified file 'terminatorlib/plugins/logger.py' --- terminatorlib/plugins/logger.py 2018-04-18 18:22:47 +0000 +++ terminatorlib/plugins/logger.py 2019-02-23 07:31:34 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # Plugin by Sinan Nalkaya # See LICENSE of Terminator package. === modified file 'terminatorlib/plugins/maven.py' --- terminatorlib/plugins/maven.py 2016-11-25 01:29:55 +0000 +++ terminatorlib/plugins/maven.py 2019-02-23 07:31:34 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # Copyright (c) 2010 Julien Nicoulaud # # This program is free software; you can redistribute it and/or modify === modified file 'terminatorlib/plugins/terminalshot.py' --- terminatorlib/plugins/terminalshot.py 2016-12-20 19:33:50 +0000 +++ terminatorlib/plugins/terminalshot.py 2019-02-23 07:31:34 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # Terminator by Chris Jones # GPL v2 only """terminalshot.py - Terminator Plugin to take 'screenshots' of individual === modified file 'terminatorlib/plugins/testplugin.py' --- terminatorlib/plugins/testplugin.py 2016-11-25 01:29:55 +0000 +++ terminatorlib/plugins/testplugin.py 2019-02-23 07:31:34 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 import terminatorlib.plugin as plugin # AVAILABLE must contain a list of all the classes that you want exposed === modified file 'terminatorlib/plugins/url_handlers.py' --- terminatorlib/plugins/url_handlers.py 2016-11-25 01:29:55 +0000 +++ terminatorlib/plugins/url_handlers.py 2019-02-23 07:31:34 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # Terminator by Chris Jones # GPL v2 only """searchbar.py - classes necessary to provide a terminal search bar""" === modified file 'terminatorlib/signalman.py' --- terminatorlib/signalman.py 2018-04-18 18:22:47 +0000 +++ terminatorlib/signalman.py 2019-02-23 07:31:34 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # Terminator by Chris Jones # GPL v2 only """Simple management of Gtk Widget signal handlers""" === modified file 'terminatorlib/terminal.py' --- terminatorlib/terminal.py 2018-04-18 18:22:47 +0000 +++ terminatorlib/terminal.py 2019-02-23 09:17:30 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # Terminator by Chris Jones # GPL v2 only """terminal.py - classes necessary to provide Terminal widgets""" @@ -63,7 +63,7 @@ (GObject.TYPE_INT,)), 'group-all': (GObject.SignalFlags.RUN_LAST, None, ()), 'group-all-toggle': (GObject.SignalFlags.RUN_LAST, None, ()), - 'move-tab': (GObject.SignalFlags.RUN_LAST, None, + 'move-tab': (GObject.SignalFlags.RUN_LAST, None, (GObject.TYPE_STRING,)), } @@ -72,7 +72,7 @@ MOUSEBUTTON_LEFT = 1 MOUSEBUTTON_MIDDLE = 2 - MOUSEBUTTON_RIGHT = 3 + MOUSEBUTTON_RIGHT = 3 terminator = None vte = None @@ -269,7 +269,7 @@ rboundry = "\\b" re = (lboundry + schemes + - "//(" + user + "@)?[" + hostchars +".]+(:[0-9]+)?(" + + "//(" + user + "@)?[" + hostchars +".]+(:[0-9]+)?(" + urlpath + ")?" + rboundry + "/?") reg = GLib.Regex.new(re, self.regex_flags, 0) self.matches['full_uri'] = self.vte.match_add_gregex(reg, 0) @@ -278,13 +278,13 @@ err ('Terminal::update_url_matches: Failed adding URL matches') else: re = (lboundry + - '(callto:|h323:|sip:)' + "[" + userchars + "+][" + - userchars + ".]*(:[0-9]+)?@?[" + pathchars + "]+" + + '(callto:|h323:|sip:)' + "[" + userchars + "+][" + + userchars + ".]*(:[0-9]+)?@?[" + pathchars + "]+" + rboundry) reg = GLib.Regex.new(re, self.regex_flags, 0) self.matches['voip'] = self.vte.match_add_gregex(reg, 0) re = (lboundry + - "(www|ftp)[" + hostchars + "]*\.[" + hostchars + + "(www|ftp)[" + hostchars + "]*\.[" + hostchars + ".]+(:[0-9]+)?(" + urlpath + ")?" + rboundry + "/?") reg = GLib.Regex.new(re, self.regex_flags, 0) self.matches['addr_only'] = self.vte.match_add_gregex(reg, 0) @@ -314,7 +314,7 @@ continue reg = GLib.Regex.new(match, self.regex_flags, 0) self.matches[name] = self.vte.match_add_gregex(reg, 0) - dbg('added plugin URL handler for %s (%s) as %d' % + dbg('added plugin URL handler for %s (%s) as %d' % (name, urlplugin.__class__.__name__, self.matches[name])) except Exception as ex: @@ -351,19 +351,19 @@ self.cnxids.new(self.vte, 'popup-menu', self.popup_menu) srcvtetargets = [("vte", Gtk.TargetFlags.SAME_APP, self.TARGET_TYPE_VTE)] - dsttargets = [("vte", Gtk.TargetFlags.SAME_APP, self.TARGET_TYPE_VTE), - ('text/x-moz-url', 0, self.TARGET_TYPE_MOZ), + dsttargets = [("vte", Gtk.TargetFlags.SAME_APP, self.TARGET_TYPE_VTE), + ('text/x-moz-url', 0, self.TARGET_TYPE_MOZ), ('_NETSCAPE_URL', 0, 0)] ''' The following should work, but on my system it corrupts the returned TargetEntry's in the newdstargets with binary crap, causing "Segmentation fault (core dumped)" when the later drag_dest_set gets called. - + dsttargetlist = Gtk.TargetList.new([]) dsttargetlist.add_text_targets(0) dsttargetlist.add_uri_targets(0) dsttargetlist.add_table(dsttargets) - + newdsttargets = Gtk.target_table_new_from_list(dsttargetlist) ''' # FIXME: Temporary workaround for the problems with the correct way of doing things @@ -381,7 +381,7 @@ dbg('Finalised drag targets: %s' % dsttargets) for (widget, mask) in [ - (self.vte, Gdk.ModifierType.CONTROL_MASK | Gdk.ModifierType.BUTTON3_MASK), + (self.vte, Gdk.ModifierType.CONTROL_MASK | Gdk.ModifierType.BUTTON3_MASK), (self.titlebar, Gdk.ModifierType.BUTTON1_MASK)]: widget.drag_source_set(mask, srcvtetargets, Gdk.DragAction.MOVE) @@ -398,7 +398,7 @@ self.cnxids.new(self.vte, 'drag-data-received', self.on_drag_data_received, self) - self.cnxids.new(self.vte, 'selection-changed', + self.cnxids.new(self.vte, 'selection-changed', lambda widget: self.maybe_copy_clipboard()) if self.composite_support: @@ -495,7 +495,7 @@ groupitems = [] cnxs = [] - for key, value in list({_('Broadcast _all'):'all', + for key, value in list({_('Broadcast _all'):'all', _('Broadcast _group'):'group', _('Broadcast _off'):'off'}.items()): item = Gtk.RadioMenuItem.new_with_mnemonic(groupitems, key) @@ -568,7 +568,7 @@ self.terminator.group_hoover() def create_group(self, _item): - """Trigger the creation of a group via the titlebar (because popup + """Trigger the creation of a group via the titlebar (because popup windows are really lame)""" self.titlebar.create_group() @@ -611,7 +611,7 @@ if self.config['exit_action'] == 'restart': self.cnxids.new(self.vte, 'child-exited', self.spawn_child, True) elif self.config['exit_action'] in ('close', 'left'): - self.cnxids.new(self.vte, 'child-exited', + self.cnxids.new(self.vte, 'child-exited', lambda x, y: self.emit('close-term')) if self.custom_encoding != True: @@ -727,7 +727,7 @@ setattr(newcolor, "red", y / 255.0) setattr(newcolor, "green", y / 255.0) setattr(newcolor, "blue", y / 255.0) - self.palette_active.append(newcolor) + self.palette_active.append(newcolor) self.palette_inactive = [] for color in self.palette_active: newcolor = Gdk.RGBA() @@ -799,7 +799,7 @@ def set_cursor_color(self): """Set the cursor color appropriately""" if self.config['cursor_color_fg']: - self.vte.set_color_cursor(None) + self.vte.set_color_cursor(None) else: cursor_color = Gdk.RGBA() cursor_color.parse(self.config['cursor_color']) @@ -870,7 +870,7 @@ if mapping == "hide_window": return(False) - if mapping and mapping not in ['close_window', + if mapping and mapping not in ['close_window', 'full_screen']: dbg('Terminal::on_keypress: lookup found: %r' % mapping) # handle the case where user has re-bound copy to ctrl+ @@ -951,7 +951,7 @@ return(True) return(False) - + def on_mousewheel(self, widget, event): """Handler for modifier + mouse wheel scroll events""" SMOOTH_SCROLL_UP = event.direction == Gdk.ScrollDirection.SMOOTH and event.delta_y <= 0. @@ -1012,7 +1012,7 @@ """Handle the start of a drag event""" Gtk.drag_set_icon_pixbuf(drag_context, util.widget_pixbuf(self, 512), 0, 0) - def on_drag_data_get(self, _widget, _drag_context, selection_data, info, + def on_drag_data_get(self, _widget, _drag_context, selection_data, info, _time, data): """I have no idea what this does, drag and drop is a mystery. sorry.""" selection_data.set(Gdk.atom_intern('vte', False), info, @@ -1026,7 +1026,7 @@ # copy text from another widget return srcwidget = Gtk.drag_get_source_widget(drag_context) - if(isinstance(srcwidget, Gtk.EventBox) and + if(isinstance(srcwidget, Gtk.EventBox) and srcwidget == self.titlebar) or widget == srcwidget: # on self return @@ -1057,7 +1057,7 @@ elif pos == "left": coord = (topleft, topmiddle, bottommiddle, bottomleft) elif pos == "bottom": - coord = (bottomleft, bottomright, middleright , middleleft) + coord = (bottomleft, bottomright, middleright , middleleft) #here, we define some widget internal values widget._draw_data = { 'color': color, 'coord' : coord } @@ -1120,11 +1120,11 @@ for term in self.terminator.get_target_terms(self): term.feed(txt) return - + widgetsrc = data.terminator.terminals[int(selection_data.get_data())] srcvte = Gtk.drag_get_source_widget(drag_context) #check if computation requireds - if (isinstance(srcvte, Gtk.EventBox) and + if (isinstance(srcvte, Gtk.EventBox) and srcvte == self.titlebar) or srcvte == widget: return @@ -1377,6 +1377,7 @@ elif self.layout_command: command = self.layout_command elif debugserver is True: + # pylint: disable=unsubscriptable-object details = self.terminator.debug_address dbg('spawning debug session with: %s:%s' % (details[0], details[1])) @@ -1854,7 +1855,7 @@ def key_insert_number(self): self.emit('enumerate', False) - + def key_insert_padded(self): self.emit('enumerate', True) @@ -1867,13 +1868,14 @@ dialog.set_default_response(Gtk.ResponseType.ACCEPT) dialog.set_resizable(False) dialog.set_border_width(8) - + label = Gtk.Label(label=_('Enter a new title for the Terminator window...')) name = Gtk.Entry() name.set_activates_default(True) if window.title.text != self.vte.get_window_title(): name.set_text(self.get_toplevel().title.text) - + + dialog.vbox.pack_start(label, False, False, 6) dialog.vbox.pack_start(name, False, False, 6) === modified file 'terminatorlib/terminal_popup_menu.py' --- terminatorlib/terminal_popup_menu.py 2018-04-19 18:17:51 +0000 +++ terminatorlib/terminal_popup_menu.py 2019-02-23 07:31:34 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # Terminator by Chris Jones # GPL v2 only """terminal_popup_menu.py - classes necessary to provide a terminal context === modified file 'terminatorlib/terminator.py' --- terminatorlib/terminator.py 2018-04-18 18:40:48 +0000 +++ terminatorlib/terminator.py 2019-02-23 07:31:34 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # Terminator by Chris Jones # GPL v2 only """terminator.py - class for the master Terminator singleton""" === modified file 'terminatorlib/titlebar.py' --- terminatorlib/titlebar.py 2018-04-18 18:22:47 +0000 +++ terminatorlib/titlebar.py 2019-02-23 07:31:34 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # Terminator by Chris Jones # GPL v2 only """titlebar.py - classes necessary to provide a terminal title bar""" === modified file 'terminatorlib/translation.py' --- terminatorlib/translation.py 2018-04-18 18:22:47 +0000 +++ terminatorlib/translation.py 2019-02-23 07:31:34 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # Terminator - multiple gnome terminals in one window # Copyright (C) 2006-2010 cmsj@tenshu.net # === modified file 'terminatorlib/util.py' --- terminatorlib/util.py 2018-04-18 18:22:47 +0000 +++ terminatorlib/util.py 2019-02-23 07:31:34 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # Terminator.util - misc utility functions # Copyright (C) 2006-2010 cmsj@tenshu.net # === modified file 'terminatorlib/version.py' --- terminatorlib/version.py 2017-02-26 17:37:22 +0000 +++ terminatorlib/version.py 2019-02-23 07:31:34 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # TerminatorVersion - version number # Copyright (C) 2010 cmsj@tenshu.net # === modified file 'terminatorlib/window.py' --- terminatorlib/window.py 2018-04-18 18:22:47 +0000 +++ terminatorlib/window.py 2019-02-23 08:52:44 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # Terminator by Chris Jones # GPL v2 only """window.py - class for the main Terminator window""" @@ -75,7 +75,7 @@ self.title = WindowTitle(self) self.title.update() - + self.preventHide = False options = self.config.options_get() @@ -85,13 +85,13 @@ if options.role: self.set_role(options.role) - + if options.forcedicon is not None: icon_to_apply = options.forcedicon if options.geometry: if not self.parse_geometry(options.geometry): - err('Window::__init__: Unable to parse geometry: %s' % + err('Window::__init__: Unable to parse geometry: %s' % options.geometry) self.apply_icon(icon_to_apply) @@ -241,6 +241,8 @@ """Focus has entered the window""" self.set_urgency_hint(False) if not self.terminator.doing_layout: + # self.uuid is injected in terminatorlib.factory + # pylint: disable=no-member self.terminator.last_active_window = self.uuid # FIXME: Cause the terminal titlebars to update here @@ -287,7 +289,7 @@ def confirm_close(self, window, type): """Display a confirmation dialog when the user is closing multiple terminals in one window""" - + return(not (self.construct_confirm_close(window, type) == Gtk.ResponseType.ACCEPT)) def on_destroy_event(self, widget, data=None): @@ -325,7 +327,7 @@ # pylint: disable-msg=W0613 def on_window_state_changed(self, window, event): """Handle the state of the window changing""" - self.isfullscreen = bool(event.new_window_state & + self.isfullscreen = bool(event.new_window_state & Gdk.WindowState.FULLSCREEN) self.ismaximised = bool(event.new_window_state & Gdk.WindowState.MAXIMIZED) @@ -384,7 +386,7 @@ visual = screen.get_rgba_visual() if visual: self.set_visual(visual) - + def show(self, startup=False): """Undo the startup show request if started in hidden mode""" #Present is necessary to grab focus when window is hidden from taskbar. @@ -466,7 +468,7 @@ container = maker.make('VPaned') else: container = maker.make('HPaned') - + self.set_pos_by_ratio = True if not sibling: @@ -490,7 +492,7 @@ for term in order: container.add(term) container.show_all() - + while Gtk.events_pending(): Gtk.main_iteration_do(False) sibling.grab_focus() @@ -517,7 +519,7 @@ self.set_property('term_zoomed', True) if font_scale: - widget.cnxids.new(widget, 'size-allocate', + widget.cnxids.new(widget, 'size-allocate', widget.zoom_scale, self.zoom_data) widget.grab_focus() @@ -655,7 +657,7 @@ extra_height = win_height - total_font_height dbg('setting geometry hints: (ewidth:%s)(eheight:%s),\ -(fwidth:%s)(fheight:%s)' % (extra_width, extra_height, +(fwidth:%s)(fheight:%s)' % (extra_width, extra_height, font_width, font_height)) geometry = Gdk.Geometry() geometry.base_width = extra_width @@ -754,7 +756,7 @@ if not maker.isinstance(notebook, 'Notebook'): dbg('note in a notebook, refusing to ungroup tab') return - + self.set_groups(None, self.get_visible_terminals()) def move_tab(self, widget, direction): @@ -784,7 +786,7 @@ else: err('unknown direction: %s' % direction) return - + notebook.reorder_child(child, page) def navigate_terminal(self, terminal, direction): @@ -896,6 +898,8 @@ self.last_active_term = make_uuid(layout['last_active_term']) if 'last_active_window' in layout and layout['last_active_window'] == 'True': + # self.uuid is injected in terminatorlib.factory + # pylint: disable=no-member self.terminator.last_active_window = self.uuid class WindowTitle(object): === modified file 'tests/test_doctests.py' --- tests/test_doctests.py 2016-11-25 01:29:55 +0000 +++ tests/test_doctests.py 2019-02-23 07:31:34 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 """Load up the tests.""" import os === modified file 'tests/testborg.py' --- tests/testborg.py 2016-11-25 01:29:55 +0000 +++ tests/testborg.py 2019-02-23 07:31:34 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # Terminator by Chris Jones # GPL v2 only """testborg.py - We are the borg. Resistance is futile. === modified file 'tests/testsignalman.py' --- tests/testsignalman.py 2018-04-18 18:22:47 +0000 +++ tests/testsignalman.py 2019-02-23 07:44:00 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # Terminator by Chris Jones # GPL v2 only """testsignalman.py - Test the signalman class @@ -8,23 +8,23 @@ >>> signalman.new(widget, 'test1', handler) 1 >>> signalman.cnxids[widget].keys() -['test1'] +dict_keys(['test1']) >>> widget.signals.values() -['test1'] +dict_values(['test1']) >>> signalman.remove_widget(widget) ->>> signalman.cnxids.has_key(widget) +>>> widget in signalman.cnxids False >>> widget.signals.values() -[] +dict_values([]) >>> signalman.new(widget, 'test2', handler) 2 >>> signalman.new(widget, 'test3', handler) 3 >>> signalman.remove_signal(widget, 'test2') >>> signalman.cnxids[widget].keys() -['test3'] +dict_keys(['test3']) >>> widget.signals.values() -['test3'] +dict_values(['test3']) >>> signalman.remove_widget(widget) >>>