summaryrefslogtreecommitdiffstats
path: root/fb.py
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2015-09-18 12:27:52 +0200
committerFlorian Pritz <bluewind@xinu.at>2015-09-18 12:27:52 +0200
commit1ff5a49f2a7e9886dc613fbbb79b7a1e249f7b3a (patch)
treef355f29a1243b42549dc21a0132129c676cf7b3f /fb.py
parent146a7bd053658b509c4f05708b8d4703c56ec37b (diff)
fb.py: Ignore missing clipboard commands
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'fb.py')
-rwxr-xr-xfb.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/fb.py b/fb.py
index e53f901..47a53c5 100755
--- a/fb.py
+++ b/fb.py
@@ -5,6 +5,7 @@ import argparse
import collections
import contextlib
import datetime
+import errno
import getpass
import json
import locale
@@ -464,8 +465,15 @@ class FBClient:
self.setClipboard(' '.join(urls))
def setClipboard(self, content):
- p = subprocess.Popen([self.config['clipboard_cmd']], stdin=subprocess.PIPE)
- p.communicate(input=content.encode('utf-8'))
+ try:
+ p = subprocess.Popen([self.config['clipboard_cmd']], stdin=subprocess.PIPE)
+ p.communicate(input=content.encode('utf-8'))
+ except OSError as e:
+ if e.errno == errno.ENOENT:
+ return
+ raise
+ except FileNotFoundError:
+ return
def multipaste(self, ids):
data = []