Esempio n. 1
0
 def test_get_url_args(self):
     with self.app.test_client() as client:
         to_send = (False, 5, "rank_volume")
         client.get(url_for('content.landing', classical=to_send[0],
                            page=to_send[1], sort_by=to_send[2]))
         args = get_url_args()
         assert to_send == args
Esempio n. 2
0
def calculate_grammars_and_statistics(dset_name, sort_value):
    queue = get_queue()
    classical, page, sort_by = get_url_args()
    queue.put(json.dumps({
        'request': 'calculate',
        'func': 'calculate_grammars_and_statistics',
        'args': (dset_name, sort_value, classical,
                 page, get_username(), sort_by)
    }))
Esempio n. 3
0
 def get(self, dset_name, sort_value):
     if not self._check_params():
         return redirect(url_for('.grammars', dset_name=dset_name,
                                 classical=False, sort_value=sort_value,
                                 page=0, sort_by='rank_volume'))
     classical, page, sort_by = get_url_args()
     self._initialize_dset(dset_name)
     worker_jobs.calculate_grammars_and_statistics(dset_name, sort_value)
     return(render_template('grammars.html', page=page,
                            sort_value=sort_value, dset_name=dset_name))
Esempio n. 4
0
 def _setup_for_get(self, dset_name, sort_value):
     self.dset_name = dset_name
     self.dset = get_dset(dset_name)
     self.sort_value = sort_value
     self.classical, self.page, self.sort_by = get_url_args()
Esempio n. 5
0
 def _setup_for_get(self, dset_name, sort_value):
     self.dset = get_dset(dset_name)
     self.dset_name = dset_name
     self.sort_value = sort_value
     self.classical, self.page, self.sort_by = get_url_args()
     self.return_dict = {'finished': False}