Compare commits
2 commits
12dbe87134
...
f627664244
Author | SHA1 | Date | |
---|---|---|---|
f627664244 | |||
1ee3ea73e6 |
16 changed files with 41 additions and 17 deletions
2
examples
2
examples
|
@ -1 +1 @@
|
||||||
Subproject commit 29164805fbb4670befd826e4a44892f00f84688f
|
Subproject commit 0cbb81abdf123a7ce1ff25675f427a550e2dd59f
|
|
@ -57,7 +57,7 @@ def main():
|
||||||
version=f"%(prog)s version {version}",
|
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
|
# Load command line early and set it as the active logger
|
||||||
# so that it can be used to report errors while loading and
|
# so that it can be used to report errors while loading and
|
||||||
# configuring other loggers
|
# configuring other loggers
|
||||||
|
|
15
src/sshare/plugin/__init__.py
Normal file
15
src/sshare/plugin/__init__.py
Normal file
|
@ -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 <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
from .plugin import *
|
|
@ -15,8 +15,8 @@
|
||||||
import importlib
|
import importlib
|
||||||
import importlib.util
|
import importlib.util
|
||||||
|
|
||||||
from sshare.plugins.config import Flag
|
from sshare.plugin.config import Flag
|
||||||
from sshare.plugins.config import NoDefault
|
from sshare.plugin.config import NoDefault
|
||||||
|
|
||||||
class PluginManager:
|
class PluginManager:
|
||||||
def __init__(self, types, logger, config, flags, arg_parser):
|
def __init__(self, types, logger, config, flags, arg_parser):
|
|
@ -12,8 +12,8 @@
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# You should have received a copy of the GNU General Public License along with
|
||||||
# SSHare. If not, see <https://www.gnu.org/licenses/>.
|
# SSHare. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from sshare.plugins.source import File
|
from sshare.plugin.source import File
|
||||||
from sshare.plugins.source import Raw
|
from sshare.plugin.source import Raw
|
||||||
|
|
||||||
plugin_type = "name"
|
plugin_type = "name"
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from sshare.plugins.config import Argument
|
from sshare.plugin.config import Argument
|
||||||
from sshare.plugins.source import File
|
from sshare.plugin.source import File
|
||||||
|
|
||||||
plugin_type = "name"
|
plugin_type = "name"
|
||||||
|
|
|
@ -12,9 +12,9 @@
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# You should have received a copy of the GNU General Public License along with
|
||||||
# SSHare. If not, see <https://www.gnu.org/licenses/>.
|
# SSHare. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from sshare.plugins.config import Argument
|
from sshare.plugin.config import Argument
|
||||||
from sshare.plugins.config import NoDefault
|
from sshare.plugin.config import NoDefault
|
||||||
from sshare.plugins.source import File
|
from sshare.plugin.source import File
|
||||||
|
|
||||||
plugin_type = "source"
|
plugin_type = "source"
|
||||||
|
|
|
@ -15,9 +15,9 @@
|
||||||
import getpass
|
import getpass
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
from sshare.plugins.config import NoDefault
|
from sshare.plugin.config import NoDefault
|
||||||
from sshare.plugins.source import File
|
from sshare.plugin.source import File
|
||||||
from sshare.plugins.source import Raw
|
from sshare.plugin.source import Raw
|
||||||
|
|
||||||
plugin_type = "upload"
|
plugin_type = "upload"
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from sshare.plugins.config import Flag
|
from sshare.plugin.config import Flag
|
||||||
from sshare.plugins.source import Raw
|
from sshare.plugin.source import Raw
|
||||||
|
|
||||||
plugin_type = "source"
|
plugin_type = "source"
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# You should have received a copy of the GNU General Public License along with
|
||||||
# SSHare. If not, see <https://www.gnu.org/licenses/>.
|
# SSHare. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from sshare.plugins.config import NoDefault
|
from sshare.plugin.config import NoDefault
|
||||||
|
|
||||||
plugin_type = "location"
|
plugin_type = "location"
|
||||||
|
|
5
test_in.py
Executable file
5
test_in.py
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
import sys
|
||||||
|
|
||||||
|
print("=> " + sys.stdin.read())
|
4
test_out.py
Executable file
4
test_out.py
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
for i in range(0, 5):
|
||||||
|
print("\033[91mHello World!")
|
Loading…
Reference in a new issue