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 /termcast_client/__init__.py | |
parent | 10b2ea0a4876a9ecaae7ab58265ad623b2aa7027 (diff) | |
download | python-termcast-client-931ebeabf4a378b303f6868d34ca66b433d28188.tar.gz python-termcast-client-931ebeabf4a378b303f6868d34ca66b433d28188.zip |
package this up as a script
Diffstat (limited to 'termcast_client/__init__.py')
-rw-r--r-- | termcast_client/__init__.py | 5 |
1 files changed, 3 insertions, 2 deletions
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) |