Fix Python 2.7 compat

This commit is contained in:
Markus Frosch 2020-05-01 17:38:34 +02:00
parent 1878571bd1
commit 294e5820f5
2 changed files with 15 additions and 12 deletions

View File

@ -8,9 +8,12 @@ from terminatorlib.version import APP_NAME, APP_VERSION
import socket import socket
import threading import threading
import socketserver
import code
import sys import sys
if sys.version_info < (3, 0):
import SocketServer as socketserver
else:
import socketserver
import code
import readline import readline
import rlcompleter import rlcompleter
import re import re

View File

@ -7,24 +7,24 @@
>>> signalman = Signalman() >>> signalman = Signalman()
>>> signalman.new(widget, 'test1', handler) >>> signalman.new(widget, 'test1', handler)
1 1
>>> signalman.cnxids[widget].keys() >>> list(signalman.cnxids[widget].keys())
dict_keys(['test1']) ['test1']
>>> widget.signals.values() >>> list(widget.signals.values())
dict_values(['test1']) ['test1']
>>> signalman.remove_widget(widget) >>> signalman.remove_widget(widget)
>>> widget in signalman.cnxids >>> widget in signalman.cnxids
False False
>>> widget.signals.values() >>> list(widget.signals.values())
dict_values([]) []
>>> signalman.new(widget, 'test2', handler) >>> signalman.new(widget, 'test2', handler)
2 2
>>> signalman.new(widget, 'test3', handler) >>> signalman.new(widget, 'test3', handler)
3 3
>>> signalman.remove_signal(widget, 'test2') >>> signalman.remove_signal(widget, 'test2')
>>> signalman.cnxids[widget].keys() >>> list(signalman.cnxids[widget].keys())
dict_keys(['test3']) ['test3']
>>> widget.signals.values() >>> list(widget.signals.values())
dict_values(['test3']) ['test3']
>>> signalman.remove_widget(widget) >>> signalman.remove_widget(widget)
>>> >>>