##// END OF EJS Templates
check win32clipboard existence instead of platform==win32
vivainio -
Show More
@@ -8,7 +8,11 b' from string import Template'
8 8 import sys
9 9
10 10 def toclip_w32(s):
11 """ places contents of s to clipboard """
11 """ places contents of s to clipboard
12
13 Needs pyvin32 to work:
14 http://sourceforge.net/projects/pywin32/
15 """
12 16 import win32clipboard as cl
13 17 import win32con
14 18 cl.OpenClipboard()
@@ -16,9 +20,10 b' def toclip_w32(s):'
16 20 cl.SetClipboardText( s )
17 21 cl.CloseClipboard()
18 22
19 if sys.platform == 'win32':
23 try:
24 import win32clipboard
20 25 toclip = toclip_w32
21 else:
26 except ImportError:
22 27 def toclip(s): pass
23 28
24 29
@@ -41,5 +46,5 b' def render(tmpl):'
41 46 toclip(res)
42 47 return res
43 48
44 ip.user_ns['render'] = render
49 ip.to_user_ns('render')
45 50 No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now