qme.main package

Submodules

qme.main.gui module

Module contents

Copyright (C) 2020 Vanessa Sochat.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

class qme.main.Queue(config_dir=None, database=None)[source]

Bases: object

A Queue Me (qme) Queue is the core operator for the qme library. Here we initialize a queue, meaning: 1. taking and setting up a user specified database or the default 2. setting up a configuration file in $HOME (or at QME_HOME) 3. then can be used to show a status, parse a job, etc.

clear(target=None, noprompt=False)[source]

clear takes a target, and that can be a taskid, executor, or none We ask the user for confirmation.

get(taskid=None)[source]

A wrapper to get a task id from the database. If an id is not provided, will return the last run task based on timestamp of file or database.

initdb(database)[source]

setup the qme home (where the config directory is stored) and the database specification. If a database string is required (and not provided) alert the user and exit on error).

Arguments:
  • config_dir (str) : the configuration directory (home for qme)

  • database (str) : a string to specify the database setup

list(executor=None)[source]

A wrapper to the database list_tasks function. Optionally take a whole executor name (e.g., shell) or just a specific task. No executor indicates that we list everything.

rerun(taskid=None)[source]

Given a command, get the executor for it (also creating an entry in the task database) and run the command. If the task is found and rerun, it is returned. Otherwise None is returned.

run(command)[source]

Given a command, get the executor for it (also creating an entry in the task database) and run the command.

search(query)[source]

Search across commands and general metadata for a string of interest. We use regular expressions (re.search) so they are supported. Search is only available for non-filesystem databases.