Persist Task¶
This module deals with persisting the “resources” (text files and the
stack) to the git repo in the JOY_HOME
directory.
-
class
joy.vui.persist_task.
PersistTask
(home)[source]¶ This class deals with saving changes to the git repo.
-
class
joy.vui.persist_task.
PickledResource
(filename, repo_relative_filename, thing=None)[source]¶ A
Resource
subclass that usespickle
on its file/thing.
-
class
joy.vui.persist_task.
Resource
(filename, repo_relative_filename, thing=None)[source]¶ Handle the content of a text files as a list of lines, deal with saving it and staging the changes to a repo.
-
joy.vui.persist_task.
init_repo
(repo_dir)[source]¶ Initialize a git repository in the directory. Stage and commit all files (toplevel, not those in subdirectories if any) in the dir.
-
joy.vui.persist_task.
make_repo_relative_path_maker
(repo)[source]¶ Helper function to return a function that returns a path given a path, that’s relative to the repository.
-
joy.vui.persist_task.
open_repo
(repo_dir=None, initialize=False)[source]¶ Open, or create, and return a Dulwich git repo object for the given directory. If the dir path doesn’t exist it will be created. If it does exist but isn’t a repo the result depends on the
initialize
argument. If it isFalse
(the default) aNotGitRepository
exception is raised, otherwisegit init
is effected in the dir.