nncli

NextCloud Notes Command Line Interface
git clone git://git.danielmoch.com/nncli.git
Log | Files | Refs | LICENSE

commit e04cb3edce16f62781b0af30305c1a467fa0ea68
parent f7d76c63d07661e8764b81247cd48eeb886ca251
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Fri,  7 Sep 2018 17:26:38 -0400

Address pylint findings in clipboard.py

Ref #10

Diffstat:
Mnncli/clipboard.py | 16++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/nncli/clipboard.py b/nncli/clipboard.py @@ -1,19 +1,23 @@ # -*- coding: utf-8 -*- - +"""clipboard module""" import os from distutils import spawn -class Clipboard(object): +class Clipboard: + """Class implements copying note content to the clipboard""" def __init__(self): self.copy_command = self.get_copy_command() - def get_copy_command(self): - if (spawn.find_executable('xsel')): + @staticmethod + def get_copy_command(): + """Defines the copy command based on the contents of $PATH""" + if spawn.find_executable('xsel'): return 'echo "%s" | xsel -ib' - if (spawn.find_executable('pbcopy')): + if spawn.find_executable('pbcopy'): return 'echo "%s" | pbcopy' return None def copy(self, text): - if (self.copy_command): + """Copies text to the system clipboard""" + if self.copy_command: os.system(self.copy_command % text)