dicogis.ui.mw_dicogis module

DicoGIS Automatize the creation of a dictionnary of geographic data contained in a folders structures. It produces an Excel output file (.xlsx)

Julien Moura (@geojulien)

class dicogis.ui.mw_dicogis.DicoGIS(parent=None)

Bases: QMainWindow

Main DicoGIS GUI object.

Parameters:

QMainWindow – inherited Qt main window.

__init__(parent=None)

Main window constructor.

check_fields(tab_data_type)

Check if required form fields are not empty.

Parameters:

tab_data_type (int) – form’s tab to check

Return type:

bool

Returns:

True if everything is OK

closeEvent(event)

Ensure background threads are stopped before the window closes.

quit() only asks a thread’s event loop to return, which a worker blocked in its own run() never reaches: without the cancellation request below, closing during a scan or an analysis froze the window for the whole timeout and still left the thread running.

Return type:

None

get_active_tab_index()

Return the currently active tab index.

Return type:

int

get_selected_language()

Return the currently selected language code.

Return type:

str

get_selected_output_format()

Return the currently selected output format.

Return type:

OutputFormats

on_folder_selected(foldername)

React to a folder being picked in the Files tab: set the default output filename and start the background folder scan.

Parameters:

foldername (str) – selected folder path.

Return type:

None

package_about = <module 'dicogis.__about__' from '/__w/DicoGIS/DicoGIS/dicogis/__about__.py'>
process()

Check needed info and launch different processes.

Return type:

None

process_db(sgbd_reader)

Launch PostGIS DB analysis in a background worker.

Parameters:

sgbd_reader (ReadPostGIS) – PostGIS georeader

Return type:

None

process_files()

Launch files processing in a background worker.

Return type:

None

process_publish()

Launch uData publication of metadata JSON files in a background worker.

Return type:

None

retranslate_ui()

Update widgets text with the language currently selected.

Return type:

None

set_active_tab_index(index)

Select the active tab by index.

Parameters:

index (int) – tab index to select.

Return type:

None

set_selected_language(language_code)

Select a language and retranslate the UI.

Parameters:

language_code (str) – 2 letters language code (EN, FR, ES)

Return type:

None

set_selected_output_format(output_format)

Select an output format. Unknown values are logged and ignored.

Parameters:

output_format (str) – output format (see OutputFormats: excel, json, udata)

Return type:

None

set_status_message(message)

Update the status label text.

Parameters:

message (str) – message to display.

Return type:

None

test_connection()

Test database connection.

Returns:

PostGIS reader or None

Return type:

Optional[ReadPostGIS]