diff --git a/docs/index.rst b/docs/index.rst index f838b3518..6eccbd564 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -45,6 +45,7 @@ Usage guide: config remotes blame + settings Indices and tables diff --git a/docs/settings.rst b/docs/settings.rst new file mode 100644 index 000000000..f1d7a9871 --- /dev/null +++ b/docs/settings.rst @@ -0,0 +1,8 @@ +********************************************************************** +Settings +********************************************************************** + +.. contents:: + +.. autoclass:: pygit2.Settings + :members: diff --git a/pygit2/settings.py b/pygit2/settings.py index d6e41998c..b5805637b 100644 --- a/pygit2/settings.py +++ b/pygit2/settings.py @@ -38,13 +38,25 @@ def __setitem__(self, key, value): option(GIT_OPT_SET_SEARCH_PATH, key, value) class Settings(object): + """Library-wide settings""" - __slots__ = ['mwindow_size', 'search_path'] + __slots__ = [] - search_path = SearchPathList() + _search_path = SearchPathList() + + @property + def search_path(self): + """Configuration file search path. + + This behaves like an array whose indices correspond to the + GIT_CONFIG_LEVEL_* values. The local search path cannot be + changed. + """ + return self._search_path @property def mwindow_size(self): + """Maximum mmap window size""" return option(GIT_OPT_GET_MWINDOW_SIZE) @mwindow_size.setter