You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/source/index.rst
+12-2Lines changed: 12 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,14 +18,24 @@ This class is used to create objects that will check/update strings in files:
18
18
19
19
Custom Check Functions
20
20
----------------------
21
-
A function can be provided to ``VerChecker.include()``. If no explicit function is provide, the following function will be used:
21
+
A function can be provided to ``VerChecker.include()``. The function will be used to parse the file for the target string.
22
+
23
+
If a tuple/list is provided as as the ``func`` argument, the first value must be a function and the second value must be the string ``'file'`` (default) or ``'line'``.
24
+
25
+
If no explicit function is provide, the following file function will be used:
22
26
23
27
.. autofunction:: verace.check_basic
24
28
25
-
Custom functions can be defined to find strings. The first argument must be the file path and the function must return either a single ``VerInfo`` object or a list of ``VerInfo`` objects:
29
+
File Functions
30
+
~~~~~~~~~~~~~~
31
+
File functions must handle the string search through the entire target file. The first argument must be the file path and the function must return either a single ``VerInfo`` object or a list of ``VerInfo`` objects:
26
32
27
33
.. autodata:: verace.VerInfo
28
34
29
35
Use this convenience function to iterate through the lines in a given file:
30
36
31
37
.. autofunction:: verace.readlines
38
+
39
+
Line Functions
40
+
~~~~~~~~~~~~~~
41
+
Line functions will be provided each line from the file one at a time. If the target string is found, simply return it. Otherwise return None (default return).
0 commit comments