diff --git a/examples b/examples index 2916480..d922b30 160000 --- a/examples +++ b/examples @@ -1 +1 @@ -Subproject commit 29164805fbb4670befd826e4a44892f00f84688f +Subproject commit d922b30b5a736b873a2502cef752eefec2079e44 diff --git a/src/sshare/main.py b/src/sshare/main.py index 023480a..6523d6b 100644 --- a/src/sshare/main.py +++ b/src/sshare/main.py @@ -57,7 +57,7 @@ def main(): version=f"%(prog)s version {version}", ) - INTERNAL_PLUGIN_LOCATION = "sshare.plugins.default" + INTERNAL_PLUGIN_LOCATION = "sshare.plugins" # Load command line early and set it as the active logger # so that it can be used to report errors while loading and # configuring other loggers diff --git a/src/sshare/plugin/__init__.py b/src/sshare/plugin/__init__.py new file mode 100644 index 0000000..60040ad --- /dev/null +++ b/src/sshare/plugin/__init__.py @@ -0,0 +1,15 @@ +# This file is part of SSHare. +# +# SSHare is free software: you can redistribute it and/or modify it under the terms of +# the GNU General Public License as published by the Free Software Foundation, +# either version 3 of the License, or (at your option) any later version. +# +# SSHare is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along with +# SSHare. If not, see . + +from .plugin import * diff --git a/src/sshare/plugins/config.py b/src/sshare/plugin/config.py similarity index 100% rename from src/sshare/plugins/config.py rename to src/sshare/plugin/config.py diff --git a/src/sshare/plugin.py b/src/sshare/plugin/plugin.py similarity index 98% rename from src/sshare/plugin.py rename to src/sshare/plugin/plugin.py index 41abb9c..395b060 100644 --- a/src/sshare/plugin.py +++ b/src/sshare/plugin/plugin.py @@ -15,8 +15,8 @@ import importlib import importlib.util -from sshare.plugins.config import Flag -from sshare.plugins.config import NoDefault +from sshare.plugin.config import Flag +from sshare.plugin.config import NoDefault class PluginManager: def __init__(self, types, logger, config, flags, arg_parser): diff --git a/src/sshare/plugins/source.py b/src/sshare/plugin/source.py similarity index 100% rename from src/sshare/plugins/source.py rename to src/sshare/plugin/source.py diff --git a/src/sshare/plugins/default/append_type.py b/src/sshare/plugins/append_type.py similarity index 93% rename from src/sshare/plugins/default/append_type.py rename to src/sshare/plugins/append_type.py index aedcca2..7b97012 100644 --- a/src/sshare/plugins/default/append_type.py +++ b/src/sshare/plugins/append_type.py @@ -12,8 +12,8 @@ # You should have received a copy of the GNU General Public License along with # SSHare. If not, see . -from sshare.plugins.source import File -from sshare.plugins.source import Raw +from sshare.plugin.source import File +from sshare.plugin.source import Raw plugin_type = "name" diff --git a/src/sshare/plugins/default/command_line.py b/src/sshare/plugins/command_line.py similarity index 100% rename from src/sshare/plugins/default/command_line.py rename to src/sshare/plugins/command_line.py diff --git a/src/sshare/plugins/default/current_time.py b/src/sshare/plugins/current_time.py similarity index 94% rename from src/sshare/plugins/default/current_time.py rename to src/sshare/plugins/current_time.py index 062ff86..16cdd44 100644 --- a/src/sshare/plugins/default/current_time.py +++ b/src/sshare/plugins/current_time.py @@ -14,8 +14,8 @@ import time -from sshare.plugins.config import Argument -from sshare.plugins.source import File +from sshare.plugin.config import Argument +from sshare.plugin.source import File plugin_type = "name" diff --git a/src/sshare/plugins/default/file.py b/src/sshare/plugins/file.py similarity index 88% rename from src/sshare/plugins/default/file.py rename to src/sshare/plugins/file.py index 06ac354..12cd2c4 100644 --- a/src/sshare/plugins/default/file.py +++ b/src/sshare/plugins/file.py @@ -12,9 +12,9 @@ # You should have received a copy of the GNU General Public License along with # SSHare. If not, see . -from sshare.plugins.config import Argument -from sshare.plugins.config import NoDefault -from sshare.plugins.source import File +from sshare.plugin.config import Argument +from sshare.plugin.config import NoDefault +from sshare.plugin.source import File plugin_type = "source" diff --git a/src/sshare/plugins/default/print_location.py b/src/sshare/plugins/print_location.py similarity index 100% rename from src/sshare/plugins/default/print_location.py rename to src/sshare/plugins/print_location.py diff --git a/src/sshare/plugins/default/ssh.py b/src/sshare/plugins/ssh.py similarity index 94% rename from src/sshare/plugins/default/ssh.py rename to src/sshare/plugins/ssh.py index e73bd20..2bf71cf 100644 --- a/src/sshare/plugins/default/ssh.py +++ b/src/sshare/plugins/ssh.py @@ -15,9 +15,9 @@ import getpass import subprocess -from sshare.plugins.config import NoDefault -from sshare.plugins.source import File -from sshare.plugins.source import Raw +from sshare.plugin.config import NoDefault +from sshare.plugin.source import File +from sshare.plugin.source import Raw plugin_type = "upload" diff --git a/src/sshare/plugins/default/stdin.py b/src/sshare/plugins/stdin.py similarity index 91% rename from src/sshare/plugins/default/stdin.py rename to src/sshare/plugins/stdin.py index df359e4..7b219b6 100644 --- a/src/sshare/plugins/default/stdin.py +++ b/src/sshare/plugins/stdin.py @@ -14,8 +14,8 @@ import sys -from sshare.plugins.config import Flag -from sshare.plugins.source import Raw +from sshare.plugin.config import Flag +from sshare.plugin.source import Raw plugin_type = "source" diff --git a/src/sshare/plugins/default/uri.py b/src/sshare/plugins/uri.py similarity index 95% rename from src/sshare/plugins/default/uri.py rename to src/sshare/plugins/uri.py index b6f0997..53078b7 100644 --- a/src/sshare/plugins/default/uri.py +++ b/src/sshare/plugins/uri.py @@ -12,7 +12,7 @@ # You should have received a copy of the GNU General Public License along with # SSHare. If not, see . -from sshare.plugins.config import NoDefault +from sshare.plugin.config import NoDefault plugin_type = "location" diff --git a/test_in.py b/test_in.py new file mode 100755 index 0000000..572e9d1 --- /dev/null +++ b/test_in.py @@ -0,0 +1,5 @@ +#!/usr/bin/python + +import sys + +print("=> " + sys.stdin.read()) diff --git a/test_out.py b/test_out.py new file mode 100755 index 0000000..f89bd5d --- /dev/null +++ b/test_out.py @@ -0,0 +1,4 @@ +#!/usr/bin/python + +for i in range(0, 5): + print("\033[91mHello World!")