Skip to content

Commit b60f88a

Browse files
committed
Improve some docstrings, removes sphinx warnings.
1 parent e4d6750 commit b60f88a

File tree

4 files changed

+26
-28
lines changed

4 files changed

+26
-28
lines changed

pygccxml/declarations/algorithm.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,8 @@ def make_flatten(decl_or_decls):
128128
converts tree representation of declarations to flatten one.
129129
130130
:param decl_or_decls: reference to list of declaration's or single
131-
declaration
131+
declaration
132132
:type decl_or_decls: :class:`declaration_t` or [ :class:`declaration_t` ]
133-
134133
:rtype: [ all internal declarations ]
135134
"""
136135
import pygccxml.declarations # prevent cyclic import
@@ -206,7 +205,7 @@ class match_declaration_t:
206205
207206
This class will help developer to match declaration by:
208207
- declaration type, for example :class:`class_t` or
209-
:class:`operator_t`.
208+
:class:`operator_t`.
210209
- declaration name
211210
- declaration full name
212211
- reference to parent declaration
@@ -343,10 +342,9 @@ def declaration_files(decl_or_decls):
343342
contains all file names of declarations.
344343
345344
:param decl_or_decls: reference to list of declaration's or single
346-
declaration
347-
:type decl_or_decls: :class:`declaration_t` or [ :class:`declaration_t` ]
348-
349-
:rtype: set( declaration file names )
345+
declaration
346+
:type decl_or_decls: :class:`declaration_t` or [:class:`declaration_t`]
347+
:rtype: set(declaration file names)
350348
"""
351349
files = set()
352350
decls = make_flatten(decl_or_decls)
@@ -359,7 +357,7 @@ def declaration_files(decl_or_decls):
359357
class visit_function_has_not_been_found_t(RuntimeError):
360358

361359
"""
362-
exception that is raised, from :func:`apply_visitor`, when a visitor could
360+
Exception that is raised, from :func:`apply_visitor`, when a visitor could
363361
not be applied.
364362
365363
"""

pygccxml/declarations/decl_printer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ def print_declarations(
482482
print declarations tree rooted at each of the included nodes.
483483
484484
:param decls: either a single :class:declaration_t object or list
485-
of :class:declaration_t objects
485+
of :class:declaration_t objects
486486
"""
487487
prn = decl_printer_t(0, detailed, recursive, writer, verbose=verbose)
488488
if not isinstance(decls, list):
@@ -498,7 +498,7 @@ def dump_declarations(decls, fpath):
498498
dump declarations tree rooted at each of the included nodes to the file
499499
500500
:param decls: either a single :class:declaration_t object or list
501-
of :class:declaration_t objects
501+
of :class:declaration_t objects
502502
:param fpath: file name
503503
"""
504504
fobj = open(fpath, 'w+')

pygccxml/declarations/matcher.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
# Distributed under the Boost Software License, Version 1.0.
44
# See http://www.boost.org/LICENSE_1_0.txt
55

6-
"""implements few "find" algorithms on declarations tree"""
6+
"""Implements few "find" algorithms on declarations tree"""
77

88
import types
99
from . import algorithm
1010

1111

1212
class matcher:
1313

14-
"""class-namespace, contains implementation of few "find" algorithms and
14+
"""Class-namespace, contains implementation of few "find" algorithms and
1515
definition of related exception classes"""
1616

1717
class declaration_not_found_t(RuntimeError):
1818

19-
"""exception, that will be raised, if the declaration could not be
19+
"""Exception, that will be raised, if the declaration could not be
2020
found"""
2121

2222
def __init__(self, matcher):
@@ -31,7 +31,7 @@ def __str__(self):
3131

3232
class multiple_declarations_found_t(RuntimeError):
3333

34-
"""exception, that will be raised, if more than one declaration was
34+
"""Exception, that will be raised, if more than one declaration was
3535
found"""
3636

3737
def __init__(self, matcher):
@@ -47,15 +47,15 @@ def __str__(self):
4747
@staticmethod
4848
def find(decl_matcher, decls, recursive=True):
4949
"""
50-
returns a list of declarations that match `decl_matcher` defined
50+
Returns a list of declarations that match `decl_matcher` defined
5151
criteria or None
5252
5353
:param decl_matcher: Python callable object, that takes one argument -
54-
reference to a declaration
54+
reference to a declaration
5555
:param decls: the search scope, :class:declaration_t object or
56-
:class:declaration_t objects list t
56+
:class:declaration_t objects list t
5757
:param recursive: boolean, if True, the method will run `decl_matcher`
58-
on the internal declarations too
58+
on the internal declarations too
5959
"""
6060

6161
where = []
@@ -70,17 +70,17 @@ def find(decl_matcher, decls, recursive=True):
7070
@staticmethod
7171
def find_single(decl_matcher, decls, recursive=True):
7272
"""
73-
returns a reference to the declaration, that match `decl_matcher`
73+
Returns a reference to the declaration, that match `decl_matcher`
7474
defined criteria.
7575
7676
if a unique declaration could not be found the method will return None.
7777
7878
:param decl_matcher: Python callable object, that takes one argument -
79-
reference to a declaration
79+
reference to a declaration
8080
:param decls: the search scope, :class:declaration_t object or
81-
:class:declaration_t objects list t
81+
:class:declaration_t objects list t
8282
:param recursive: boolean, if True, the method will run `decl_matcher`
83-
on the internal declarations too
83+
on the internal declarations too
8484
"""
8585
answer = matcher.find(decl_matcher, decls, recursive)
8686
if len(answer) == 1:
@@ -89,18 +89,18 @@ def find_single(decl_matcher, decls, recursive=True):
8989
@staticmethod
9090
def get_single(decl_matcher, decls, recursive=True):
9191
"""
92-
returns a reference to declaration, that match `decl_matcher` defined
92+
Returns a reference to declaration, that match `decl_matcher` defined
9393
criteria.
9494
9595
If a unique declaration could not be found, an appropriate exception
9696
will be raised.
9797
9898
:param decl_matcher: Python callable object, that takes one argument -
99-
reference to a declaration
99+
reference to a declaration
100100
:param decls: the search scope, :class:declaration_t object or
101-
:class:declaration_t objects list t
101+
:class:declaration_t objects list t
102102
:param recursive: boolean, if True, the method will run `decl_matcher`
103-
on the internal declarations too
103+
on the internal declarations too
104104
"""
105105
answer = matcher.find(decl_matcher, decls, recursive)
106106
if len(answer) == 1:

pygccxml/declarations/scopedef.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Distributed under the Boost Software License, Version 1.0.
44
# See http://www.boost.org/LICENSE_1_0.txt
55

6-
"""defines :class:`scopedef_t` class"""
6+
"""Defines :class:`scopedef_t` class"""
77

88
import time
99
from . import algorithm
@@ -33,7 +33,7 @@ class scopedef_t(declaration.declaration_t):
3333
3434
2. `header_dir` - directory, to which belongs file, that the
3535
declaration was declared in.
36-
`header_dir` should be absolute path.
36+
`header_dir` should be absolute path.
3737
3838
3. `header_file` - file that the declaration was declared in.
3939

0 commit comments

Comments
 (0)