Skip to content
This repository was archived by the owner on Apr 14, 2024. It is now read-only.

Commit 07b8699

Browse files
committed
Merge branch 'docs'
2 parents c265c97 + 4cde3c0 commit 07b8699

14 files changed

+707
-42
lines changed

db/base.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ def __init__(self, *args, **kwargs):
9090

9191
#{ Edit Interface
9292
def set_ostream(self, stream):
93-
"""Adjusts the stream to which all data should be sent when storing new objects
93+
"""
94+
Adjusts the stream to which all data should be sent when storing new objects
95+
9496
:param stream: if not None, the stream to use, if None the default stream
9597
will be used.
9698
:return: previously installed stream, or None if there was no override
@@ -100,30 +102,36 @@ def set_ostream(self, stream):
100102
return cstream
101103

102104
def ostream(self):
103-
""":return: overridden output stream this instance will write to, or None
105+
"""
106+
:return: overridden output stream this instance will write to, or None
104107
if it will write to the default stream"""
105108
return self._ostream
106109

107110
def store(self, istream):
108-
"""Create a new object in the database
111+
"""
112+
Create a new object in the database
109113
:return: the input istream object with its sha set to its corresponding value
114+
110115
:param istream: IStream compatible instance. If its sha is already set
111116
to a value, the object will just be stored in the our database format,
112117
in which case the input stream is expected to be in object format ( header + contents ).
113118
:raise IOError: if data could not be written"""
114119
raise NotImplementedError("To be implemented in subclass")
115120

116121
def store_async(self, reader):
117-
"""Create multiple new objects in the database asynchronously. The method will
122+
"""
123+
Create multiple new objects in the database asynchronously. The method will
118124
return right away, returning an output channel which receives the results as
119125
they are computed.
120126
121127
:return: Channel yielding your IStream which served as input, in any order.
122128
The IStreams sha will be set to the sha it received during the process,
123129
or its error attribute will be set to the exception informing about the error.
130+
124131
:param reader: async.Reader yielding IStream instances.
125132
The same instances will be used in the output channel as were received
126133
in by the Reader.
134+
127135
:note:As some ODB implementations implement this operation atomic, they might
128136
abort the whole operation if one item could not be processed. Hence check how
129137
many items have actually been produced."""
@@ -167,8 +175,10 @@ class CachingDB(object):
167175

168176
#{ Interface
169177
def update_cache(self, force=False):
170-
"""Call this method if the underlying data changed to trigger an update
178+
"""
179+
Call this method if the underlying data changed to trigger an update
171180
of the internal caching structures.
181+
172182
:param force: if True, the update must be performed. Otherwise the implementation
173183
may decide not to perform an update if it thinks nothing has changed.
174184
:return: True if an update was performed as something change indeed"""

db/pack.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,10 @@ def store_async(self, reader):
128128
#{ Interface
129129

130130
def update_cache(self, force=False):
131-
"""Update our cache with the acutally existing packs on disk. Add new ones,
131+
"""
132+
Update our cache with the acutally existing packs on disk. Add new ones,
132133
and remove deleted ones. We keep the unchanged ones
134+
133135
:param force: If True, the cache will be updated even though the directory
134136
does not appear to have changed according to its modification timestamp.
135137
:return: True if the packs have been updated so there is new information,

doc/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build/

doc/Makefile

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
PAPER =
8+
BUILDDIR = build
9+
10+
# Internal variables.
11+
PAPEROPT_a4 = -D latex_paper_size=a4
12+
PAPEROPT_letter = -D latex_paper_size=letter
13+
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
14+
15+
.PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest
16+
17+
help:
18+
@echo "Please use \`make <target>' where <target> is one of"
19+
@echo " html to make standalone HTML files"
20+
@echo " dirhtml to make HTML files named index.html in directories"
21+
@echo " pickle to make pickle files"
22+
@echo " json to make JSON files"
23+
@echo " htmlhelp to make HTML files and a HTML help project"
24+
@echo " qthelp to make HTML files and a qthelp project"
25+
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
26+
@echo " changes to make an overview of all changed/added/deprecated items"
27+
@echo " linkcheck to check all external links for integrity"
28+
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
29+
30+
clean:
31+
-rm -rf $(BUILDDIR)/*
32+
33+
html:
34+
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
35+
@echo
36+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
37+
38+
dirhtml:
39+
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
40+
@echo
41+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
42+
43+
pickle:
44+
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
45+
@echo
46+
@echo "Build finished; now you can process the pickle files."
47+
48+
json:
49+
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
50+
@echo
51+
@echo "Build finished; now you can process the JSON files."
52+
53+
htmlhelp:
54+
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
55+
@echo
56+
@echo "Build finished; now you can run HTML Help Workshop with the" \
57+
".hhp project file in $(BUILDDIR)/htmlhelp."
58+
59+
qthelp:
60+
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
61+
@echo
62+
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
63+
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
64+
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/GitDB.qhcp"
65+
@echo "To view the help file:"
66+
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/GitDB.qhc"
67+
68+
latex:
69+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
70+
@echo
71+
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
72+
@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
73+
"run these through (pdf)latex."
74+
75+
changes:
76+
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
77+
@echo
78+
@echo "The overview file is in $(BUILDDIR)/changes."
79+
80+
linkcheck:
81+
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
82+
@echo
83+
@echo "Link check complete; look for any errors in the above output " \
84+
"or in $(BUILDDIR)/linkcheck/output.txt."
85+
86+
doctest:
87+
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
88+
@echo "Testing of doctests in the sources finished, look at the " \
89+
"results in $(BUILDDIR)/doctest/output.txt."

doc/source/api.rst

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
.. _api-label:
2+
3+
#############
4+
API Reference
5+
#############
6+
7+
****************
8+
Database.Base
9+
****************
10+
11+
.. automodule:: gitdb.db.base
12+
:members:
13+
:undoc-members:
14+
15+
****************
16+
Database.Git
17+
****************
18+
19+
.. automodule:: gitdb.db.git
20+
:members:
21+
:undoc-members:
22+
23+
****************
24+
Database.Loose
25+
****************
26+
27+
.. automodule:: gitdb.db.loose
28+
:members:
29+
:undoc-members:
30+
31+
****************
32+
Database.Memory
33+
****************
34+
35+
.. automodule:: gitdb.db.mem
36+
:members:
37+
:undoc-members:
38+
39+
****************
40+
Database.Pack
41+
****************
42+
43+
.. automodule:: gitdb.db.pack
44+
:members:
45+
:undoc-members:
46+
47+
******************
48+
Database.Reference
49+
******************
50+
51+
.. automodule:: gitdb.db.ref
52+
:members:
53+
:undoc-members:
54+
55+
************
56+
Base
57+
************
58+
59+
.. automodule:: gitdb.base
60+
:members:
61+
:undoc-members:
62+
63+
************
64+
Functions
65+
************
66+
67+
.. automodule:: gitdb.fun
68+
:members:
69+
:undoc-members:
70+
71+
************
72+
Pack
73+
************
74+
75+
.. automodule:: gitdb.pack
76+
:members:
77+
:undoc-members:
78+
79+
************
80+
Streams
81+
************
82+
83+
.. automodule:: gitdb.stream
84+
:members:
85+
:undoc-members:
86+
87+
************
88+
Types
89+
************
90+
91+
.. automodule:: gitdb.typ
92+
:members:
93+
:undoc-members:
94+
95+
96+
************
97+
Utilities
98+
************
99+
100+
.. automodule:: gitdb.util
101+
:members:
102+
:undoc-members:
103+
104+
105+
106+
107+
108+
109+
110+
111+
112+
113+

0 commit comments

Comments
 (0)