Commits

Benoit Chesneau  committed dac3f65

update kael script to work on osx

  • Participants
  • Parent commits 341760c

Comments (0)

Files changed (1)

File contrib/fpcli.py

 
 import httplib
 import os
+import re
 import socket
 import sys
 
 
 def copy_url(url):
     """Copy the url into the clipboard."""
+    if sys.platform == 'darwin':
+        url = re.escape(url)
+        os.system(r"echo %s | pbcopy" % url)
+        return 0
+        
     try:
         import win32clipboard
         import win32con
                 gtk.main()
         except:
             pass
-
+    return 1
 @handle_errors
 def get_languages():
     c = httplib.HTTPConnection(FRIENDPASTE_SERVER)