diff options
author | Jesse Luehrs <doy@tozt.net> | 2014-09-22 23:05:30 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2014-09-22 23:20:23 -0400 |
commit | 931ebeabf4a378b303f6868d34ca66b433d28188 (patch) | |
tree | bee094449a09d7f857478abc450c120300320d6d | |
parent | 10b2ea0a4876a9ecaae7ab58265ad623b2aa7027 (diff) | |
download | python-termcast-client-931ebeabf4a378b303f6868d34ca66b433d28188.tar.gz python-termcast-client-931ebeabf4a378b303f6868d34ca66b433d28188.zip |
package this up as a script
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | setup.py | 19 | ||||
-rw-r--r-- | termcast_client/__init__.py | 5 | ||||
-rw-r--r-- | termcast_client/__main__.py | 2 |
4 files changed, 25 insertions, 2 deletions
@@ -3,3 +3,4 @@ __pycache__ /MANIFEST /dist/ *.pyc +/*.egg-info/ diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..eb437fa --- /dev/null +++ b/setup.py @@ -0,0 +1,19 @@ +from setuptools import setup, find_packages + +setup( + name="termcast_client", + version="0.1.0", + description="broadcast your terminal sessions for remote viewing", + url="https://github.com/doy/python-termcast-client", + author="Jesse Luehrs", + author_email="doy@tozt.net", + license="MIT", + classifiers=[ + ], + packages=find_packages(), + entry_points={ + "console_scripts": [ + "termcast=termcast_client:main", + ], + }, +) diff --git a/termcast_client/__init__.py b/termcast_client/__init__.py index 64e6c2a..c3c8a55 100644 --- a/termcast_client/__init__.py +++ b/termcast_client/__init__.py @@ -1,12 +1,13 @@ import argparse import json import os -import pity import shutil import signal import socket import sys +from . import pity + class Client(object): def __init__(self, host, port, username, password): self.host = host @@ -71,7 +72,7 @@ class Client(object): def _build_metadata_string(self, data): return b'\033]499;' + json.dumps(data).encode('utf-8') + b'\007' -if __name__ == '__main__': +def main(): parser = argparse.ArgumentParser() parser.add_argument('--host', default="noway.ratry.ru") parser.add_argument('--port', type=int, default=31337) diff --git a/termcast_client/__main__.py b/termcast_client/__main__.py new file mode 100644 index 0000000..f30a76b --- /dev/null +++ b/termcast_client/__main__.py @@ -0,0 +1,2 @@ +import termcast_client +termcast_client.main() |