Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.3 compat #351

Merged
merged 2 commits into from
Mar 24, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Usage guide:
config
remotes
blame
settings


Indices and tables
Expand Down
8 changes: 8 additions & 0 deletions docs/settings.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
**********************************************************************
Settings
**********************************************************************

.. contents::

.. autoclass:: pygit2.Settings
:members:
16 changes: 14 additions & 2 deletions pygit2/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down