示例#1
0
def ensure_server_not_running():
    if os.path.exists(os.path.join(central_config_dir, 'ccnet.conf')):
        client = ccnet.SyncClient(ccnet_dir,
                                  central_config_dir=central_config_dir)
    else:
        client = ccnet.SyncClient(ccnet_dir)
    try:
        client.connect_daemon()
    except ccnet.NetworkError:
        pass
    else:
        raise Exception('Seafile server is running! You must turn it off before gc!')
示例#2
0
def ensure_server_not_running():
    client = ccnet.SyncClient(ccnet_dir)
    try:
        client.connect_daemon()
    except ccnet.NetworkError:
        pass
    else:
        raise Exception(
            'Seafile server is running! You must turn it off before gc!')
示例#3
0
    def start_ccnet_session(self):
        '''Connect to ccnet-server, retry util connection is made'''
        self._ccnet_session = AsyncClient(self._ccnet_dir,
                                          self._evbase,
                                          central_config_dir=self._central_config_dir)
        connector = ClientConnector(self._ccnet_session)
        connector.connect_daemon_with_retry()

        self._sync_client = ccnet.SyncClient(self._ccnet_dir,
                                             central_config_dir=self._central_config_dir)
        self._sync_client.connect_daemon()