diff options
author | Florian Pritz <bluewind@xinu.at> | 2015-09-18 12:27:52 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2015-09-18 12:27:52 +0200 |
commit | 1ff5a49f2a7e9886dc613fbbb79b7a1e249f7b3a (patch) | |
tree | f355f29a1243b42549dc21a0132129c676cf7b3f | |
parent | 146a7bd053658b509c4f05708b8d4703c56ec37b (diff) |
fb.py: Ignore missing clipboard commands
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-x | fb.py | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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 = [] |