Esempio n. 1
0
 def on_source_change(change):
     view_options.children = []
     if sources.value == 'dias_api':
         view_options.children = [info_api, dias_api()]
     elif sources.value == 'direct':
         view_options.children = [info_direct]
     config.update(['preferences', 'data_source'], str(sources.value))
Esempio n. 2
0
 def on_source_change(change):
     view_options.children = []
     if sources.value == 0:
         view_options.children = [info_api, rest_api()]
     elif sources.value == 1:
         view_options.children = [info_direct, direct()]
     config.update(['set', 'data_source'], str(sources.value))
Esempio n. 3
0
 def wb_save_on_click(b):
     config.update(['api', 'url'], str(wt_url.value))
     config.update(['api', 'user'], str(wt_user.value))
     if wt_pass.value != '':
         config.update(['api', 'pass'], str(wt_pass.value))
     print("API information is updated")
Esempio n. 4
0
 def wb_save_on_click(b):
     progress.clear_output()
     dscode = ds_code.value
     config.update(['ds_conf', dscode, 'years', str(ds_year.value),
                    'tables', 'dias_catalog'], str(tb_dc.value))
     config.update(['ds_conf', dscode, 'years', str(ds_year.value),
                    'tables', 'parcels'], str(tb_pr.value))
     config.update(['ds_conf', dscode, 'years', str(ds_year.value),
                    'columns', 'parcels_id'], str(tc_id.value))
     config.update(['ds_conf', dscode, 'years', str(ds_year.value),
                    'columns', 'crop_names'], str(tc_cn.value))
     config.update(['ds_conf', dscode, 'years', str(ds_year.value),
                    'columns', 'crop_codes'], str(tc_cc.value))
     config.update(['ds_conf', dscode, 'years', str(ds_year.value),
                    'tables', 's2'], str(tb_s2.value))
     config.update(['ds_conf', dscode, 'years', str(ds_year.value),
                    'tables', 'bs'], str(tb_bs.value))
     config.update(['ds_conf', dscode, 'years', str(ds_year.value),
                    'tables', 'c6'], str(tb_6c.value))
     config.update(['ds_conf', dscode,
                    'db'], str(ds_db.value))
     config.update(['ds_conf', dscode,
                    'desc'], str(ds_desc.value))
     config.update(['ds_conf', dscode, 'center'],
                   f"{map_cent_lat.value},{map_cent_lon.value}")
     config.update(['ds_conf', dscode,
                    'zoom'], str(map_zoom.value))
     config.update(['set', 'ds_conf'], str(dscode))
     config.update(['set', 'ds_year'], str(ds_year.value))
     values = config.read()
     ds_c = values['set']['ds_conf']
     ds_y = values['set']['ds_year']
     dsc.options = [d for d in values['ds_conf']]
     dsy.options = [int(y) for y in values['ds_conf'][ds_c]['years']]
     dsc.value = ds_c
     dsy.value = int(ds_y)
     outlog("The configurations are saved.")
Esempio n. 5
0
 def on_dsy_change(change):
     config.update(['set', 'ds_year'], str(dsy.value))
Esempio n. 6
0
 def on_dsc_change(change):
     config.update(['set', 'ds_conf'], dsc.value)
     values = config.read()
     ds_c = values['set']['ds_conf']
     dsy.options = [int(y) for y in values['ds_conf'][ds_c]['years']]
Esempio n. 7
0
 def on_jupyterlab_change(change):
     config.update(['set', 'jupyterlab'], str(jupyterlab.value))
Esempio n. 8
0
    def wb_save_on_click(b):
        progress.clear_output()
        # Save database connection information
        config.update(['db', db, 'conn', 'host'], str(db_host.value))
        config.update(['db', db, 'conn', 'port'], str(db_port.value))
        config.update(['db', db, 'conn', 'name'], str(db_name.value))
        config.update(['db', db, 'conn', 'user'], str(db_user.value))
        if db_pass.value != '':
            config.update(['db', db, 'conn', 'pass'], str(db_pass.value))
        # Save Object storage connection information
        config.update(['obst', 'osdias'], str(os_dias.value))
        config.update(['obst', 'oshost'], str(os_host.value))
        config.update(['obst', 'bucket'], str(os_bucket.value))
        config.update(['obst', 'access_key'], str(os_access_key.value))
        if os_secret_key.value != '':
            config.update(['obst', 'secret_key'], str(os_secret_key.value))

        outlog("All changes are saved.")
Esempio n. 9
0
 def btn_save_on_click(b):
     progress.clear_output()
     config.update(['set', 'user'], str(user_name.value))
     config.update(['set', 'email'], str(user_email.value))
     config.update(['set', 'institution'], str(user_institution.value))
     config.update(['set', 'member_state'], str(user_email.value))
     config.update(['set', 'plimit'], str(plimit.value))
     config.update(['git', 'url'], str(git_url.value))
     config.update(['git', 'user'], str(git_user.value))
     config.update(['paths', 'data'], str(path_data.value))
     config.update(['paths', 'temp'], str(path_temp.value))
     config.update(['files', 'pids_poly'], str(file_pids_poly.value))
     config.update(['files', 'pids_dist'], str(file_pids_dist.value))
     if git_pass.value != '':
         config.update(['git', 'pass'], str(git_pass.value))
     outlog("The new settings are saved.")