Beispiel #1
0
 def __init__(self, con, sql, args=None, sucess_message=None):
     QgsTask.__init__(self)
     self.con = con
     self.cur = con.cursor()
     self.sql = sql
     self.args = args
     self.sucess_message = sucess_message
Beispiel #2
0
    def __init__(self, con, queries, args=None, sucess_message=None):

        QgsTask.__init__(self)

        self.con = con

        self.cur = con.cursor()

        self.queries = queries

        if args:

            if len(args) == len(queries):

                self.args = args

            else:

                raise ValueError(
                    'cancelable_queries:length of queries!= length of arguments'
                )

        else:

            self.args = [None for q in queries]

        self.sucess_message = sucess_message
 def __init__(self, desc, iface, geometry_column, file_queue, upstream_taks_canceled):
     QgsTask.__init__(self, desc, QgsTask.CanCancel)
     self.iface = iface
     self.geometry_column = geometry_column
     self.file_queue = file_queue
     self.exception = None
     self.upstream_taks_canceled = upstream_taks_canceled
Beispiel #4
0
 def __init__(self, pyratTool, para_backup):
     QgsTask.__init__(self)
     self.pyratTool = pyratTool
     self.para_backup = para_backup
     self.failed = False
     self.guionly = False
     self.layer = None
     self.existinglayers = list()
 def __init__(self, desc, iface, query_job, file_queue, elements_in_layer, upstream_taks_canceled):
     QgsTask.__init__(self, desc)
     self.iface = iface
     self.query_job = query_job
     self.file_queue = file_queue
     self.exception = False
     self.elements_in_layer = elements_in_layer
     self.upstream_taks_canceled = upstream_taks_canceled
 def __init__(self, desc, iface, client, base_query_job, extent_query_job, extent, geo_field, upstream_taks_canceled):
     QgsTask.__init__(self, desc)
     self.iface = iface
     self.client = client
     self.base_query_job = base_query_job
     self.extent_query_job = extent_query_job
     self.extent = extent
     self.geo_field = geo_field
     self.exception = None
     self.upstream_taks_canceled = upstream_taks_canceled
Beispiel #7
0
    def __init__(self, data, onlySelected=False):
        name = self.tr('position') if isinstance(data,
                                                 QgsPointXY) else data.name()
        QgsTask.__init__(self, 'GETools - {}'.format(name))

        self.data = data
        self.onlySelected = onlySelected

        self.fileName = ''
        self.error = ''
Beispiel #8
0
 def __init__(self, desc, callback):
     QgsTask.__init__(self, desc, QgsTask.CanCancel)
     self.db_path = Settings.GET_DB_PATH()
     self._interval = 10
     self.available_slots = 5
     self.statement_1 = "UPDATE oaw_tasks SET status = ? WHERE id in (" \
                        "   SELECT id FROM oaw_tasks WHERE status=? order by id ASC LIMIT ?" \
                        ")"
     self.statement_2 = "SELECT id, name, options FROM oaw_tasks WHERE status = ? ORDER BY id ASC LIMIT ?"
     self.callback = callback
 def __init__(self, desc, iface, base_query_job, query_progress_field, geometry_column_combo_box, base_query_elements, layer_import_elements, run_query_button):
     QgsTask.__init__(self, desc)
     self.iface = iface
     self.base_query_job = base_query_job
     self.exception = None
     self.query_progress_field = query_progress_field
     self.geometry_column_combo_box = geometry_column_combo_box
     self.base_query_elements = base_query_elements
     self.layer_import_elements = layer_import_elements
     self.run_query_button = run_query_button
     self.query_result = None
 def __init__(self, desc, iface, layer_file_path, add_all_button, add_extents_button, base_query_elements, layer_import_elements, elements_in_layer, upstream_taks_canceled, geom_column):
     QgsTask.__init__(self, desc)
     self.iface = iface
     self.layer_file_path = layer_file_path
     self.exception = None
     self.add_all_button = add_all_button
     self.add_extents_button = add_extents_button
     self.base_query_elements = base_query_elements
     self.layer_import_elements = layer_import_elements
     self.elements_in_layer = elements_in_layer
     self.upstream_taks_canceled = upstream_taks_canceled
     self.geom_column = geom_column
Beispiel #11
0
    def __init__(self, settings):
        QgsTask.__init__(self, 'QConsolidate')

        self.settings = settings

        self.project = None
        self.projectFile = None

        self.baseDirectory = self.settings['output']
        self.dataDirectory = os.path.join(self.baseDirectory, LAYERS_DIRECTORY)

        self.error = ''
Beispiel #12
0
    def __init__(self, settings):
        QgsTask.__init__(self, 'QConsolidate')

        self.settings = settings

        self.project = None
        self.projectFile = None
        self.projectArchive = None

        self.baseDirectory = self.settings['output']
        self.dataDirectory = os.path.join(self.baseDirectory, LAYERS_DIRECTORY)

        self.error = ''
 def __init__(self, desc, db_path, statement, parameters, callback):
     """
     Constructor
     :param desc: description of the task
     :param db_path: path to the sqlite database
     :param statement: statement template  to be executed
     :param parameters: parameters to use with the statement template
     :param callback: callback to call at the end of the task
     """
     QgsTask.__init__(self, desc, QgsTask.CanCancel)
     self.db_path = db_path
     self.statement = statement
     self.parameters = parameters
     self.callback = callback
Beispiel #14
0
    def __init__(self, description, PRW_Data_Opvrager):
        """
        Initializer

        Parameters
        ----------
        description : str
            Description of the QgsTask
        PRW_Data_Opvrager : PRW_Data_Opvrager
            Reference to the plugin class for all the attributes and methods
        """
        # Initialize the base QgsTask class with the description and tell
        # the QgsTask it can be canceled
        QgsTask.__init__(self, description, QgsTask.CanCancel)
        self.PRW = PRW_Data_Opvrager
        self.iface = self.PRW.iface
        self.exception = None
        self.MESSAGE_CATEGORY = 'PRW_Data_Opvrager'
 def __init__(self, desc, sourcePath, destGroup):
     QgsTask.__init__(self, desc)
     self.sourcePath = sourcePath
     self.destGroup = destGroup
Beispiel #16
0
 def __init__(self, desc):
     QgsTask.__init__(self, desc)
 def __init__(self, desc, observer):
     QgsTask.__init__(self, desc, QgsTask.CanCancel)
     self.observer = observer
     self._continue = True
     self._interval = 2.5