Example #1
0
 def get_command_storage_setting(self):
     storage_all = get_command_storage_setting()
     if self.command_storage in storage_all:
         storage = storage_all.get(self.command_storage)
     else:
         storage = storage_all.get('default')
     return {"TERMINAL_COMMAND_STORAGE": storage}
Example #2
0
 def get_command_storage_setting(self):
     storage_all = get_command_storage_setting()
     if self.command_storage in storage_all:
         storage = storage_all.get(self.command_storage)
     else:
         storage = storage_all.get('default')
     return {"TERMINAL_COMMAND_STORAGE": storage}
Example #3
0
    def get_context_data(self, **kwargs):
        command_storage = utils.get_command_storage_setting()
        replay_storage = utils.get_replay_storage_setting()

        context = {
            'app': _('Settings'),
            'action': _('Terminal setting'),
            'form': self.form_class(),
            'replay_storage': replay_storage,
            'command_storage': command_storage
        }
        kwargs.update(context)
        return super().get_context_data(**kwargs)
Example #4
0
    def get_context_data(self, **kwargs):
        command_storage = utils.get_command_storage_setting()
        replay_storage = utils.get_replay_storage_setting()

        context = {
            'app': _('Settings'),
            'action': _('Terminal setting'),
            'form': self.form_class(),
            'replay_storage': replay_storage,
            'command_storage': command_storage
        }
        kwargs.update(context)
        return super().get_context_data(**kwargs)
Example #5
0
def get_terminal_command_storages():
    storage_list = {}
    command_storage = utils.get_command_storage_setting()

    for name, params in command_storage.items():
        tp = params['TYPE']
        if tp == 'server':
            storage = get_command_storage()
        else:
            if not TYPE_ENGINE_MAPPING.get(tp):
                continue
            engine_class = import_module(TYPE_ENGINE_MAPPING[tp])
            storage = engine_class.CommandStore(params)
        storage_list[name] = storage
    return storage_list
Example #6
0
def get_all_command_storage():
    from common import utils
    command_storage = utils.get_command_storage_setting()
    for k, v in command_storage.items():
        yield (k, k)
Example #7
0
def get_all_command_storage():
    from common import utils
    command_storage = utils.get_command_storage_setting()
    for k, v in command_storage.items():
        yield (k, k)