@@ -81,28 +81,32 @@ def add_action(self, *args, old_add_action):
8181 shortcut : QKeySequence | QKeySequence .StandardKey | str | int
8282
8383 # if args and isinstance(args[0], QIcon):
84- if any (map (lambda arg : isinstance (arg , QIcon ), args [:1 ])): # Better to use previous line instead of this
84+ if any (
85+ isinstance (arg , QIcon ) for arg in args [:1 ]
86+ ): # Better to use previous line instead of this
8587 icon , * args = args
8688 else :
8789 icon = QIcon ()
8890
89- if all (
90- isinstance (arg , t )
91- for arg , t in zip (
92- args ,
93- [
94- str ,
95- (QKeySequence , QKeySequence .StandardKey , str , int ),
96- QObject ,
97- bytes ,
98- ],
91+ if (
92+ all (
93+ isinstance (arg , t )
94+ for arg , t in zip (
95+ args ,
96+ [
97+ str ,
98+ (QKeySequence , QKeySequence .StandardKey , str , int ),
99+ QObject ,
100+ bytes ,
101+ ],
102+ )
99103 )
104+ and len (args ) >= 2
100105 ):
101- if len (args ) >= 2 :
102- text , shortcut , * args = args
103- action = old_add_action (self , icon , text , * args )
104- action .setShortcut (shortcut )
105- return action
106+ text , shortcut , * args = args
107+ action = old_add_action (self , icon , text , * args )
108+ action .setShortcut (shortcut )
109+ return action
106110
107111 return old_add_action (self , * args )
108112
0 commit comments