##// END OF EJS Templates
%clip = <expr> syntax in win32clip.py
vivainio -
Show More
@@ -27,14 +27,19 b" def clip_f( self, parameter_s = '' ):"
27 data = cl.GetClipboardData( win32con.CF_TEXT )
27 data = cl.GetClipboardData( win32con.CF_TEXT )
28 cl.CloseClipboard()
28 cl.CloseClipboard()
29 return data
29 return data
30
30 api = self.getapi()
31 ranges = args[0:]
31
32 cmds = ''.join( self.extract_input_slices( ranges ) )
32 if parameter_s.lstrip().startswith('='):
33 rest = parameter_s[parameter_s.index('=')+1:].strip()
34 val = str(api.ev(rest))
35 else:
36 ranges = args[0:]
37 val = ''.join( self.extract_input_slices( ranges ) )
33
38
34 cl.EmptyClipboard()
39 cl.EmptyClipboard()
35 cl.SetClipboardText( cmds )
40 cl.SetClipboardText( val )
36 cl.CloseClipboard()
41 cl.CloseClipboard()
37 print 'The following commands were written to the clipboard'
42 print 'The following text was written to the clipboard'
38 print cmds
43 print val
39
44
40 ip.expose_magic( "clip", clip_f )
45 ip.expose_magic( "clip", clip_f )
General Comments 0
You need to be logged in to leave comments. Login now