def mod_actions(mod_action, now, f_name): if mod_action == 'none': pass else: global dialog_text if mod_action == 'del_mod' : dialog_text = dialog_text + '<br>' + lib_mod_map.delmod(f_name) elif mod_action == 'mod_info' : lib_mod_map.modinfo( f_name ) dialog_text = '' elif mod_action != now : ret = subprocess.call('beesu "./lib_s2m.sh --toggle"', shell=True) if ret == 0: if mod_action == 'static': dialog_text = dialog_text + '<br>' + freeze_disabled else: dialog_text = dialog_text + '<br>' + freeze_enabled else: dialog_text = dialog_text + '<br>' + error_freeze_toggle else: dialog_text = dialog_text + '<br>' + no_need_toggle return dialog_text
elif action == 'install': # actions for open.py if data_modules != 'no_data_modules': dialog_text = lib_mod_map.install(modname, data_modules) else: dialog_text = lib_mod_map.install(modname, modules) elif action == 'cp2modules': dialog_text = lib_mod_map.cp2(modname, modules) elif action == 'cp2data_modules': dialog_text = lib_mod_map.cp2(modname, data_modules) elif action == 'cp2optional': dialog_text = lib_mod_map.cp2(modname, optional) elif action == 'cp2data_optional': dialog_text = lib_mod_map.cp2(modname, data_optional) else: lib_mod_map.modinfo(modname) # messages for gettext title_base = _( 'Base MagOS modules, activating in startup. Do not move this modules if you do not know what to do.' ).encode('UTF-8') title_modules = _('Modules activating in startup, from MagOS dir').encode( 'UTF-8') title_optional = _( 'Modules activating in startup, from MagOS dir. only if enabled by load= cmdline par' ).encode('UTF-8') title_data_modules = _( 'Modules activating in startup, from MagOS-Data dir.').encode('UTF-8') title_data_optional = _( 'Modules activating in startup, from MagOS-Data dir. only if enabled by load= cmdline par' ).encode('UTF-8')
elif action == 'install': # actions for open.py if data_modules != 'no_data_modules': dialog_text = lib_mod_map.install( modname, data_modules ) else: dialog_text = lib_mod_map.install( modname, modules ) elif action == 'cp2modules': dialog_text = lib_mod_map.cp2( modname, modules ) elif action == 'cp2data_modules': dialog_text = lib_mod_map.cp2( modname, data_modules ) elif action == 'cp2optional': dialog_text = lib_mod_map.cp2( modname, optional ) elif action == 'cp2data_optional': dialog_text = lib_mod_map.cp2( modname, data_optional ) else: lib_mod_map.modinfo( modname ) # messages for gettext title_base = _('Base MagOS modules, activating in startup. Do not move this modules if you do not know what to do.').encode('UTF-8') title_modules = _('Modules activating in startup, from MagOS dir').encode('UTF-8') title_optional = _('Modules activating in startup, from MagOS dir. only if enabled by load= cmdline par').encode('UTF-8') title_data_modules = _('Modules activating in startup, from MagOS-Data dir.').encode('UTF-8') title_data_optional = _('Modules activating in startup, from MagOS-Data dir. only if enabled by load= cmdline par').encode('UTF-8') title_copy2ram = _('Modules activated from RAM').encode('UTF-8') title_another = _('Modules activated from another dirs').encode('UTF-8') no_data_modules = _('no Data-optional dir').encode('UTF-8') no_data_optional = _('no Data-modules dir').encode('UTF-8') another = _('modules activated from another dirs').encode('UTF-8') no_cache = _('No copy2ram cache').encode('UTF-8') another = _('Another modules').encode('UTF-8') update = _('Update').encode('UTF-8')