Skip to content

Commit 73eabb5

Browse files
committed
Tweak sphinx documentation, add a usage example
1 parent ba4f2b5 commit 73eabb5

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

docs/examples.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Examples
2+
========
3+
4+
Basic query for nodes using :mod:`pypuppetdb`::
5+
6+
import pypuppetdb
7+
import pypuppetdbquery
8+
9+
pdb = pypuppetdb.connect()
10+
11+
pdb_ast = pypuppetdbquery.parse(
12+
'(processorcount=4 or processorcount=8) and kernel=Linux')
13+
14+
for node in pdb.nodes(query=pdb_ast):
15+
print(node)

docs/index.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
You can adapt this file completely to your liking, but it should at least
44
contain the root `toctree` directive.
55
6-
Welcome to pypuppetdbquery's documentation!
7-
===========================================
6+
pypuppetdbquery documentation
7+
=============================
88

99
Contents:
1010

1111
.. toctree::
1212
:maxdepth: 3
1313

1414
pypuppetdbquery
15+
examples
1516

1617
Indices and tables
1718
==================
1819

1920
* :ref:`genindex`
2021
* :ref:`modindex`
2122
* :ref:`search`
22-

0 commit comments

Comments
 (0)