forked from davr/pickups
-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.py
28 lines (22 loc) · 934 Bytes
/
run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import argparse
import logging
import os
import sys
import appdirs
import hangups.auth
from pickups.server import Server
def runit():
logging.basicConfig(level=logging.INFO, stream=sys.stdout)
logging.getLogger('hangups').setLevel(logging.WARNING)
dirs = appdirs.AppDirs('hangups', 'hangups')
default_cookies_path = os.path.join(dirs.user_cache_dir, 'cookies.json')
cookies = hangups.auth.get_auth_stdin(default_cookies_path)
parser = argparse.ArgumentParser(description='IRC Gateway for Hangouts')
parser.add_argument('--address', help='bind address', default='127.0.0.1')
parser.add_argument('--port', help='bind port', default=6667)
parser.add_argument('--ascii-smileys', action='store_true',
help='display smileys in ascii')
args = parser.parse_args()
Server(cookies, args.ascii_smileys).run(args.address, args.port)
if __name__ == '__main__':
runit()