diff --git a/clipboard.py b/clipboard.py index 84638de..1a95796 100644 --- a/clipboard.py +++ b/clipboard.py @@ -18,17 +18,11 @@ from sshare.plugins.config import Flag from sshare.plugins.config import NoDefault from sshare.plugins.source import Raw -plugin_type = { "source", "result" } +plugin_type = { "source", "feedback" } activate = { "source": { "from_clipboard" }, - "result": { "to_clipboard" }, -} -config = { - "protocol": "https", - "host": NoDefault, - "port": None, - "path": "", + "feedback": { "to_clipboard" }, } args = { "from_clipboard": Flag( @@ -47,9 +41,5 @@ def get_source(): logger.info("Uploading contents of clipboard") return Raw("txt", pyclip.paste()) -def result(name): - if config.port: - config.port = f":{config.port}" - else: - config.port = "" - pyclip.copy(f"{config.protocol}://{config.host}{config.port}{config.path}/{name}") +def give_feedback(location): + pyclip.copy(location) diff --git a/notification.py b/notification.py index 772bdbd..ec94537 100644 --- a/notification.py +++ b/notification.py @@ -12,20 +12,14 @@ # You should have received a copy of the GNU General Public License along with # SSHare. If not, see . -from desktop_notifier import DesktopNotifierSync, Urgency, Button +from desktop_notifier import DesktopNotifierSync from sshare.plugins.config import Flag from sshare.plugins.config import NoDefault -plugin_type = "result" +plugin_type = "feedback" activate = { "notify" } -config = { - "protocol": "https", - "host": NoDefault, - "port": None, - "path": "", -} args = { "notify": Flag( short="n", @@ -35,14 +29,8 @@ args = { _notifier = DesktopNotifierSync() -def result(name): - if config.port: - config.port = f":{config.port}" - else: - config.port = "" - url = f"{config.protocol}://{config.host}{config.port}{config.path}/{name}" - +def give_feedback(location): _notifier.send( title="SSHare - Upload Complete", - message=f"Uploaded to {url}", + message=f"Uploaded to {location}", )