Skip to content

Commit e7b0907

Browse files
committed
-
1 parent e1878bb commit e7b0907

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

source_py2/python_toolbox/wx_tools/widgets/cute_window/accelerator_savvy_window.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
See its documentation for more information.
88
'''
99

10+
import collections
11+
1012
import wx
1113

1214
from python_toolbox import sequence_tools
@@ -47,7 +49,7 @@ def _key_dict_to_accelerators(key_dict):
4749
### Breaking down key tuples to individual entries: #######################
4850
# #
4951
for key, id in original_key_dict.items():
50-
if sequence_tools.is_sequence(key):
52+
if isinstance(key, collections.Sequence):
5153
key_sequence = key
5254
for actual_key in key_sequence:
5355
key_dict[actual_key] = id

source_py2/python_toolbox/wx_tools/widgets/cute_window/bind_savvy_evt_handler/event_codes.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,11 @@ def get_event_code_from_name(name, evt_handler_type):
4949
'''
5050
processed_name = 'EVT_%s' % string_tools.case_conversions. \
5151
camel_case_to_lower_case(name).upper()
52-
raw_event_modules = \
53-
(evt_handler_type.event_modules if
54-
sequence_tools.is_sequence(evt_handler_type.event_modules) else
55-
[evt_handler_type.event_modules])
56-
event_modules = raw_event_modules + [
52+
raw_event_modules = sequence_tools.to_tuple(evt_handler_type.event_modules)
53+
event_modules = raw_event_modules + (
5754
address_tools.resolve(evt_handler_type.__module__),
5855
wx
59-
]
56+
)
6057
for event_module in event_modules:
6158
try:
6259
return getattr(event_module, processed_name)

0 commit comments

Comments
 (0)