From 1ff5a49f2a7e9886dc613fbbb79b7a1e249f7b3a Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Fri, 18 Sep 2015 12:27:52 +0200 Subject: fb.py: Ignore missing clipboard commands Signed-off-by: Florian Pritz --- fb.py | 12 ++++++++++-- 1 file 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 = [] -- cgit v1.2.3-24-g4f1b