sshare/src/sshare/plugins/stdin.py
2024-09-10 15:05:08 +00:00

31 lines
944 B
Python

# 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/>.
import sys
from sshare.plugin.config import Flag
from sshare.plugin.source import Raw
plugin_type = "source"
activate = { "stdin" }
config = {
"suffix": "txt"
}
args = {
"stdin": Flag(help="Upload from stdin")
}
def get_source():
return Raw(config.suffix, sys.stdin.buffer.read())