Ejemplo n.º 1
0
Archivo: dsl.py Proyecto: jspam/temci
def store(package_file: str, db: Database = None):
    """
    Stores all actions and the database into the passed file and cleans up the temporary directory.

    :param package_file: name of the passed file
    :param db: passed database or None if the default database should be used
    """
    typecheck_locals(package_file=FileName(), db=Optional(T(Database)))
    db = db or Database()
    _store_in_db(db)
    db.store(package_file)
    db.clean()
Ejemplo n.º 2
0
def store(package_file: str, db: Database = None):
    """
    Stores all actions and the database into the passed file and cleans up the temporary directory.

    :param package_file: name of the passed file
    :param db: passed database or None if the default database should be used
    """
    typecheck_locals(package_file=FileName(), db=Optional(T(Database)))
    db = db or Database()
    _store_in_db(db)
    db.store(package_file)
    db.clean()
Ejemplo n.º 3
0
Archivo: dsl.py Proyecto: jspam/temci
def run(package_file: str, reverse_file: str = None):
    """
    Execute the package and create a package that can be executed afterwards that reverses (most of the) made changes.

    :param package_file: name of the used package file
    :param reverse_file: name of the reverse package file or None if the setting ``package/reverse_file``
    should be used.
    """
    reverse_file = reverse_file or Settings()["package/reverse_file"]
    db = load(package_file)
    rev_db = Database()
    actions.reverse_and_store_all_in_db(rev_db)
    rev_db.store(reverse_file)
    rev_db.clean()
    actions.execute_all(db)
Ejemplo n.º 4
0
def run(package_file: str, reverse_file: str = None):
    """
    Execute the package and create a package that can be executed afterwards that reverses (most of the) made changes.

    :param package_file: name of the used package file
    :param reverse_file: name of the reverse package file or None if the setting ``package/reverse_file``
    should be used.
    """
    reverse_file = reverse_file or Settings()["package/reverse_file"]
    db = load(package_file)
    rev_db = Database()
    actions.reverse_and_store_all_in_db(rev_db)
    rev_db.store(reverse_file)
    rev_db.clean()
    actions.execute_all(db)