sync_public_streams: Use option group for arguments.
This commit is contained in:
parent
362d7424ed
commit
beb2a6570f
|
@ -2,6 +2,7 @@
|
|||
import sys
|
||||
import os
|
||||
import logging
|
||||
import optparse
|
||||
import time
|
||||
import simplejson
|
||||
import subprocess
|
||||
|
@ -12,8 +13,6 @@ import zulip
|
|||
|
||||
from typing import Set
|
||||
|
||||
zulip_client = zulip.Client(client="ZulipSyncPublicStreamsBot/0.1")
|
||||
|
||||
def fetch_public_streams():
|
||||
# type: () -> Set[str]
|
||||
public_streams = set()
|
||||
|
@ -56,6 +55,12 @@ if __name__ == "__main__":
|
|||
file_handler.setFormatter(formatter)
|
||||
logger.addHandler(file_handler)
|
||||
|
||||
parser = optparse.OptionParser()
|
||||
parser.add_option_group(zulip.generate_option_group(parser))
|
||||
(options, args) = parser.parse_args()
|
||||
|
||||
zulip_client = zulip.Client(client="ZulipSyncPublicStreamsBot/0.1")
|
||||
|
||||
while True:
|
||||
time.sleep(15)
|
||||
public_streams = fetch_public_streams()
|
||||
|
|
Loading…
Reference in a new issue