nopaque/app/corpora/cqi/client.py
2020-03-25 15:39:32 +01:00

16 lines
413 B
Python

from .api import APIClient
from .models.corpora import CorpusCollection
class CQiClient:
def __init__(self, host, port=4877):
self.api = APIClient(host, port=port)
def connect(self, username='anonymous', password=''):
self.api.ctrl_connect(username, password)
self.corpora = CorpusCollection(self)
def disconnect(self):
del self.corpora
self.api.ctrl_bye()