Skip to content

Commit

Permalink
Cleaned up windows module.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth Reitz committed Sep 9, 2010
1 parent 57ed051 commit f5828e8
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions xerox/win.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,29 @@
# found @ http://code.activestate.com/recipes/150115/

try:
import win32clipboard as w
import win32clipboard as clip
import win32con
except ImportError, why:
raise Pywin32NotFound


def copy(string):
"""Copy given string into system clipboard."""
try:
pass
except Exception, e:
raise e
w.OpenClipboard()
w.EmptyClipboard()
w.SetClipboardData(1, string)
w.CloseClipboard()

clip.OpenClipboard()
clip.EmptyClipboard()
clip.SetClipboardData(1, string)
clip.CloseClipboard()

return


def paste():
"""Returns system clipboard contents."""
try:
pass
except Exception, e:
raise e
w.OpenClipboard()
d=w.GetClipboardData(win32con.CF_TEXT)
w.CloseClipboard()

clip.OpenClipboard()
d = clip.GetClipboardData(win32con.CF_TEXT)
clip.CloseClipboard()
return d


0 comments on commit f5828e8

Please sign in to comment.