mirror of
				https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
				synced 2025-11-04 12:22:47 +00:00 
			
		
		
		
	Remove all cqi inga function code fragments
This commit is contained in:
		@@ -83,17 +83,3 @@ def cqi_corpora_corpus_paginate(cqi_client: cqi.CQiClient, corpus_name: str, pag
 | 
				
			|||||||
    # Number of the next page
 | 
					    # Number of the next page
 | 
				
			||||||
    payload['next_num'] = payload['page'] + 1 if payload['has_next'] else None
 | 
					    payload['next_num'] = payload['page'] + 1 if payload['has_next'] else None
 | 
				
			||||||
    return {'code': 200, 'msg': 'OK', 'payload': payload}
 | 
					    return {'code': 200, 'msg': 'OK', 'payload': payload}
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@socketio.on('cqi.corpora.corpus.inga', namespace=ns)
 | 
					 | 
				
			||||||
@socketio_login_required
 | 
					 | 
				
			||||||
@cqi_over_socketio
 | 
					 | 
				
			||||||
def cqi_corpora_corpus_inga(cqi_client: cqi.CQiClient, corpus_name: str):
 | 
					 | 
				
			||||||
    print('Hallo Inga')
 | 
					 | 
				
			||||||
    cqi_corpus = cqi_client.corpora.get(corpus_name)
 | 
					 | 
				
			||||||
    if cqi_corpus.size > 2000:
 | 
					 | 
				
			||||||
        payload = cqi_corpus.size
 | 
					 | 
				
			||||||
        return {'code': 200, 'msg': 'OK', 'payload': payload}
 | 
					 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        return {'code': 456, 'msg': 'Ich habe keine Lust auf so kleine Korpusse'}
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -150,20 +150,6 @@ class CQiCorpus {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    this.socket.emit('cqi.corpora.corpus.update_db', args);
 | 
					    this.socket.emit('cqi.corpora.corpus.update_db', args);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					 | 
				
			||||||
  inga() {
 | 
					 | 
				
			||||||
    return new Promise((resolve, reject) => {
 | 
					 | 
				
			||||||
      const args = {corpus_name: this.name};
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      this.socket.emit('cqi.corpora.corpus.inga', args, response => {
 | 
					 | 
				
			||||||
        if (response.code === 200) {
 | 
					 | 
				
			||||||
          resolve(response.payload);
 | 
					 | 
				
			||||||
        } else {
 | 
					 | 
				
			||||||
          reject(response);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
    });
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -35,10 +35,6 @@ class CorpusAnalysisApp {
 | 
				
			|||||||
      .then(
 | 
					      .then(
 | 
				
			||||||
        cQiCorpus => {
 | 
					        cQiCorpus => {
 | 
				
			||||||
          this.data.corpus = {o: cQiCorpus};
 | 
					          this.data.corpus = {o: cQiCorpus};
 | 
				
			||||||
          cQiCorpus.inga().then(
 | 
					 | 
				
			||||||
            response => {console.log(response.payload);},  // Hier wird das promise behandelt, wenn es erfolgreich war
 | 
					 | 
				
			||||||
            response => {console.log(`${response.code}: ${response.msg}`);}  // Hier wenn es nicht erfolgreich war
 | 
					 | 
				
			||||||
          );
 | 
					 | 
				
			||||||
          // TODO: Don't do this here
 | 
					          // TODO: Don't do this here
 | 
				
			||||||
          cQiCorpus.updateDb();
 | 
					          cQiCorpus.updateDb();
 | 
				
			||||||
          this.enableActionElements();
 | 
					          this.enableActionElements();
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user