qisys.worktree - Registering project paths

qisys.worktree.WorkTree

class qisys.worktree.WorkTree(root, sanity_check=True)

This class represent a worktree.

register_self()

Register to the global list of all worktrees in ~/.config/qi/qibuild.xml

register(observer)

Called when an observer wants to be notified about project changes

load_cache()

Load the worktree.xml file.

reload()

Re-read every qiproject.xml. Useful when projects are added or removed, or when qiproject.xml change

check()

Perform a few sanity checks

dot_qi

Get the dot_qi directory.

worktree_xml

Get the path to .qi/worktree.xml

load_projects()

For every project in cache, re-read the subprojects and and them to the list

get_project(src, raises=False)

Get a project

Parameters:
  • src – a absolute path, or a path relative to the worktree
  • raises – Raises if project is not found
Returns:

a WorkTreeProject instance or None if raises is False and project is not found

add_project(path)

Add a project to a worktree

Parameters:path – path to the project, can be absolute, or relative to the worktree root
remove_project(path, from_disk=False)

Remove a project from a worktree

Parameters:
  • path – path to the project, can be absolute, or relative to the worktree root
  • from_disk – also erase project files from disk
move_project(path, new_path)

Move a project from a worktree

normalize_path(path)

Make sure the path is a POSIX path, relative to the worktree root