From 0bb2eaba9ae413022378d10a395748df3b4cb3a4 Mon Sep 17 00:00:00 2001 From: Sumukh Sridhara Date: Mon, 19 Sep 2016 21:39:39 -0700 Subject: [PATCH] Bump to 1.7.1 and add stub for --collab (#226) * Bump to 1.7.1 and add stub for --collab * Lowercase --collab help text --- client/__init__.py | 2 +- client/cli/ok.py | 2 ++ client/protocols/collaborate.py | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 client/protocols/collaborate.py diff --git a/client/__init__.py b/client/__init__.py index 0c5f497c..6e789876 100644 --- a/client/__init__.py +++ b/client/__init__.py @@ -1,4 +1,4 @@ -__version__ = 'v1.7.0' +__version__ = 'v1.7.1' FILE_NAME = 'ok' diff --git a/client/cli/ok.py b/client/cli/ok.py index 5f43eb4d..ee5ad139 100644 --- a/client/cli/ok.py +++ b/client/cli/ok.py @@ -106,6 +106,8 @@ def parse_input(command_input=None): help="give a hint (if available)") experiment.add_argument('--style', action='store_true', help="run AutoStyle feedback system") + experiment.add_argument('--collab', action='store_true', + help="launch collaborative programming environment") # Debug information debug = parser.add_argument_group('debugging options') diff --git a/client/protocols/collaborate.py b/client/protocols/collaborate.py new file mode 100644 index 00000000..58a46817 --- /dev/null +++ b/client/protocols/collaborate.py @@ -0,0 +1,33 @@ +from client.protocols.common import models +from client.utils import format + +import logging + +log = logging.getLogger(__name__) + +class CollaborateProtocol(models.Protocol): + + # Timeouts are specified in seconds. + SHORT_TIMEOUT = 30 + LONG_TIMEOUT = 30 + API_ENDPOINT = '{prefix}://{server}' + FIREBASE_CONFIG = { + 'apiKey': "AIzaSyAFJn-q5SbxJnJcPVFhjxd25DA5Jusmd74", + 'authDomain': "ok-server.firebaseapp.com", + 'databaseURL': "https://ok-server.firebaseio.com", + 'storageBucket': "ok-server.appspot.com" + } + + FILE_TIME_FORMAT = '%m_%d_%H_%M_%S' + TIME_FORMAT = '%m/%d %H:%M:%S' + BACKUP_DIRECTORY = 'ok-collab' + COLLAB_SERVER = 'collab.cs61a.org' + + def run(self, messages): + if not self.args.collab: + return + + with format.block("-"): + print("Collaboration will be available soon.") + +protocol = CollaborateProtocol