예제 #1
0
def get_sw_utilities_main_taskbar():

    from dfcleanser.common.display_utils import display_dfcleanser_taskbar
    display_dfcleanser_taskbar(
        ButtonGroupForm(build_utility_tb_id, build_utility_tb_keyTitleList,
                        build_utility_tb_jsList, build_utility_tb_centered),
        False)
예제 #2
0
def display_zipcode_main_taskbar():

    from dfcleanser.common.display_utils import display_dfcleanser_taskbar
    display_dfcleanser_taskbar(
        ButtonGroupForm(zipcode_main_tb_id, zipcode_main_tb_keyTitleList,
                        zipcode_main_tb_jsList, zipcode_main_tb_centered),
        False)
예제 #3
0
def display_system_main_taskbar():

    if (cfg.get_dfc_mode() == cfg.INLINE_MODE):
        from dfcleanser.common.display_utils import display_dfcleanser_taskbar
        display_dfcleanser_taskbar(
            ButtonGroupForm(system_environment_doc_id,
                            system_environment_keyTitleList,
                            system_environment_jsList,
                            system_environment_centered))
    else:

        system_tb_A = ButtonGroupForm(system_environmentA_doc_id,
                                      system_environmentA_keyTitleList,
                                      system_environmentA_jsList,
                                      system_environmentA_centered)

        system_tb_A.set_gridwidth(480)
        system_tb_A_html = system_tb_A.get_html()

        system_tb_B = ButtonGroupForm(system_environmentB_doc_id,
                                      system_environmentB_keyTitleList,
                                      system_environmentB_jsList,
                                      system_environmentB_centered)

        system_tb_B.set_gridwidth(480)
        system_tb_B_html = system_tb_B.get_html()

        gridclasses = ["dfc-top-", "dfc-footer"]
        gridhtmls = [system_tb_A_html, system_tb_B_html]

        display_generic_grid("dfcleanser-system-tb-pop-up-wrapper",
                             gridclasses, gridhtmls)
def display_export_main_taskbar():

    from dfcleanser.common.display_utils import display_dfcleanser_taskbar
    if (cfg.get_dfc_mode() == cfg.INLINE_MODE):
        display_dfcleanser_taskbar(
            ButtonGroupForm(export_task_bar_id, export_task_bar_keyTitleList,
                            export_task_bar_jsList, export_task_bar_centered))
    else:
        display_dfcleanser_taskbar(
            ButtonGroupForm(export_task_bar_id,
                            export_task_bar_pu_keyTitleList,
                            export_task_bar_jsList, export_task_bar_centered))
def get_dfsubset_main_taskbar():

    from dfcleanser.common.display_utils import display_dfcleanser_taskbar
    display_dfcleanser_taskbar(
        ButtonGroupForm(dfsubset_tb_id, dfsubset_tb_keyTitleList,
                        dfsubset_tb_jsList, dfsubset_tb_centered), False)
def display_dc_data_scripting(optionId, parms=None):

    from IPython.display import clear_output
    clear_output()

    from dfcleanser.common.cfg import check_if_dc_init
    if (not check_if_dc_init()):

        from dfcleanser.common.display_utils import display_dfcleanser_taskbar
        display_dfcleanser_taskbar(
            ButtonGroupForm(dc_script_tb_id, dc_script_tb_keyTitleList,
                            dc_script_tb_jsList, dc_script_tb_centered), False)

        from dfcleanser.scripting.data_scripting_control import clear_data_scripting_data
        clear_data_scripting_data()

        return

    from dfcleanser.common.display_utils import display_dfcleanser_taskbar
    display_dfcleanser_taskbar(
        ButtonGroupForm(dc_script_tb_id, dc_script_tb_keyTitleList,
                        dc_script_tb_jsList, dc_script_tb_centered), False)

    if (parms == None):
        from dfcleanser.scripting.data_scripting_control import clear_data_scripting_data
        clear_data_scripting_data()

    else:

        funcid = int(parms[0])

        if (funcid == dsm.TURN_ON_SCRIPTING):
            from dfcleanser.scripting.data_scripting_control import set_scripting_status
            set_scripting_status(True)
            from dfcleanser.common.common_utils import display_status_note
            display_status_note("Scripting is turned on")

        elif (funcid == dsm.TURN_OFF_SCRIPTING):
            from dfcleanser.scripting.data_scripting_control import set_scripting_status
            set_scripting_status(False)
            from dfcleanser.common.common_utils import display_status_note
            display_status_note("Scripting is turned off")

        elif (funcid == dsm.SHOW_CURRENT_SCRIPT):
            display_scripting_forms()

        elif (funcid == dsm.ADD_TO_CURRENT_SCRIPT):
            script_form = InputForm(
                dc_add_code_input_id, dc_add_code_input_idList,
                dc_add_code_input_labelList, dc_add_code_input_typeList,
                dc_add_code_input_placeholderList, dc_add_code_input_jsList,
                dc_add_code_input_reqList)

            script_form.set_shortForm(True)
            script_form.set_buttonstyle({
                "font-size": 12,
                "height": 75,
                "width": 140,
                "left-margin": 70
            })
            script_form.set_gridwidth(880)
            script_form.set_fullparms(True)

            script_form_html = script_form.get_html()
            script_title_html = "<div>Scripting</div><br>"

            gridclasses = ["dfcleanser-common-grid-header", "dfc-footer"]
            gridhtmls = [script_title_html, script_form_html]

            from dfcleanser.common.common_utils import display_generic_grid
            display_generic_grid("data-scripting-wrapper", gridclasses,
                                 gridhtmls)

        elif (funcid == dsm.ADD_CODE_SCRIPT):
            from dfcleanser.scripting.data_scripting_control import add_code_to_script
            add_code_to_script(parms)
            display_status("Code added to Current Script succesfully ")

        elif (funcid == dsm.DELETE_CURRENT_SCRIPT):
            from dfcleanser.scripting.data_scripting_control import drop_current_script
            drop_current_script()
            display_status("Current Script Cleared succesfully ")

        elif (funcid == dsm.LOAD_BACKUP_SCRIPT):
            from dfcleanser.scripting.data_scripting_control import load_backup_scriptlog_to_current
            load_backup_scriptlog_to_current()
            display_scripting_forms()

            display_status("Current Script Loaded from Backup ")

        elif (funcid == dsm.SAVE_BACKUP_SCRIPT):

            codeparms = get_parms_for_input(parms[1], dc_script_input_idList)
            save_code = get_code_from_form(codeparms)

            from dfcleanser.scripting.data_scripting_control import (
                set_current_scriptlog, save_current_scriptlog_to_backup)
            set_current_scriptlog(save_code)
            save_current_scriptlog_to_backup(save_code)
            display_scripting_forms()

            display_status("Current Script Backed up successfully ")

        elif (funcid == dsm.RUN_CURRENT_SCRIPT):

            opstat = opStatus()
            from dfcleanser.scripting.data_scripting_control import run_scriptlog
            run_scriptlog(parms, opstat)

            if (opstat.get_status()):
                display_status("Current Script Run successfully ")
            else:
                display_exception(opstat)