Пример #1
0
 def get_plugin_representation_from_store(name,
                                          store_url,
                                          version=None,
                                          username=None,
                                          password=None,
                                          timeout=30):
     """
     Get a plugin app representation from the ChRIS store.
     """
     store_client = StoreClient(store_url, username, password, timeout)
     plg = store_client.get_plugin(name, version)
     parameters = []
     offset = 0
     limit = 50
     while True:
         result = store_client.get_plugin_parameters(
             plg['id'], {
                 'limit': limit,
                 'offset': offset
             })
         parameters.extend(result['data'])
         offset += limit
         if not result['hasNextPage']: break
     plg['parameters'] = parameters
     return plg
Пример #2
0
 def get_plugin_representation_from_store(name, store_url, version=None, username=None,
                                          password=None, timeout=30):
     """
     Get a plugin app representation from the ChRIS store.
     """
     store_client = StoreClient(store_url, username, password, timeout)
     plg = store_client.get_plugin(name, version)
     parameters = []
     offset = 0
     limit = 50
     while True:
         result = store_client.get_plugin_parameters(plg['id'], {'limit': limit,
                                                                 'offset': offset})
         parameters.extend(result['data'])
         offset += limit
         if not result['hasNextPage']: break
     plg['parameters'] = parameters
     return plg
Пример #3
0
 def get_plugin_parameters_from_store(plg_id, timeout=30):
     """
     Get a plugin's parameters representation from the ChRIS store.
     """
     store_url = settings.CHRIS_STORE_URL
     store_client = StoreClient(store_url, None, None, timeout)
     parameters = []
     offset = 0
     limit = 50
     while True:
         result = store_client.get_plugin_parameters(
             plg_id, {
                 'limit': limit,
                 'offset': offset
             })
         parameters.extend(result['data'])
         offset += limit
         if not result['hasNextPage']: break
     return parameters