'Finds any item in the queue with the given directory and mode pair
:param directory: directory to be processed by the task
:param mode: processing type, auto/manual
:return: instance of PostProcessorTask or None'

def find_in_queue(self, directory, mode):

    for cur_item in (self.queue + [self.currentItem]):
        if (isinstance(cur_item, PostProcessorTask) and (cur_item.directory == directory) and (cur_item.mode == mode)):
            return cur_item
    return None
