Skip to content

Commit 13ab524

Browse files
authored
Merge pull request #8 from nothingworksright/updates
Replaced bad if statement
2 parents 0bad293 + bf03036 commit 13ab524

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

tmpNote.py

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python3
1+
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

44
import wx
@@ -276,25 +276,27 @@ def menu_bar(self):
276276
editmenu.AppendSeparator()
277277
editmenu.Append(wx.ID_CUT, 'Cut\tCtrl+X', 'Cut selection from file.')
278278
self.Bind(wx.EVT_MENU, self.cut_copy_paste_del_sel_event, id=wx.ID_CUT)
279-
editmenu.Append(wx.ID_COPY, '&Copy\tCtrl+C',
280-
'Copy selection from file.')
279+
editmenu.Append(
280+
wx.ID_COPY, '&Copy\tCtrl+C', 'Copy selection from file.'
281+
)
281282
self.Bind(
282-
wx.EVT_MENU,
283-
self.cut_copy_paste_del_sel_event,
284-
id=wx.ID_COPY
283+
wx.EVT_MENU, self.cut_copy_paste_del_sel_event, id=wx.ID_COPY
284+
)
285+
editmenu.Append(
286+
wx.ID_PASTE, '&Paste\tCtrl+V', 'Paste clipboard into file.'
285287
)
286-
editmenu.Append(wx.ID_PASTE, '&Paste\tCtrl+V',
287-
'Paste clipboard into file.')
288288
self.Bind(
289289
wx.EVT_MENU, self.cut_copy_paste_del_sel_event, id=wx.ID_PASTE
290290
)
291291
editmenu.Append(wx.ID_DELETE, 'Delete', 'Delete the selected text.')
292-
self.Bind(wx.EVT_MENU, self.cut_copy_paste_del_sel_event,
293-
id=wx.ID_DELETE)
292+
self.Bind(
293+
wx.EVT_MENU, self.cut_copy_paste_del_sel_event, id=wx.ID_DELETE
294+
)
294295
editmenu.AppendSeparator()
295296
editmenu.Append(wx.ID_SELECTALL, 'Select All', 'Select all text.')
296-
self.Bind(wx.EVT_MENU, self.cut_copy_paste_del_sel_event,
297-
id=wx.ID_SELECTALL)
297+
self.Bind(
298+
wx.EVT_MENU, self.cut_copy_paste_del_sel_event, id=wx.ID_SELECTALL
299+
)
298300

299301
# findmenu = wx.Menu()
300302
# menubar.Append(findmenu, 'F&ind')
@@ -1072,10 +1074,10 @@ def close_all_action(self):
10721074
def cut_copy_paste_del_sel_event(self, event):
10731075
"""Event requesting cut, copy, paste, delete, or select all text."""
10741076

1075-
if event.GetId() == (
1076-
wx.ID_CUT or wx.ID_COPY or wx.ID_PASTE or wx.ID_DELETE or
1077-
wx.ID_SELECTALL
1078-
):
1077+
ids = set((
1078+
wx.ID_CUT, wx.ID_COPY, wx.ID_PASTE, wx.ID_DELETE, wx.ID_SELECTALL
1079+
))
1080+
if event.GetId() in ids:
10791081
self.cut_copy_paste_del_sel_action(event)
10801082
else:
10811083
event.Skip()
@@ -1084,7 +1086,6 @@ def cut_copy_paste_del_sel_action(self, event):
10841086
"""Cut, copy, paste, delete, or select all text."""
10851087

10861088
self.show_notebook_if_not_shown()
1087-
10881089
text = self.FindFocus()
10891090
if text is not None:
10901091
if event.GetId() == wx.ID_CUT:

0 commit comments

Comments
 (0)