Skip to content

Commit f3db17d

Browse files
committed
docs: autofix of the bad format
1 parent a88d33d commit f3db17d

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

src/DIRAC/RequestManagementSystem/private/RequestValidator.py

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,49 @@
1-
""" :mod: RequestValidator
1+
""":mod: RequestValidator
22
3-
======================
3+
======================
44
5-
.. module: RequestValidator
5+
.. module: RequestValidator
66
7-
:synopsis: request validator
7+
:synopsis: request validator
88
9-
.. moduleauthor:: [email protected]
9+
.. moduleauthor:: [email protected]
1010
11-
A general and simple request validator checking for required attributes and logic.
12-
It checks if required attributes are set/unset but not for their values.
11+
A general and simple request validator checking for required attributes and logic.
12+
It checks if required attributes are set/unset but not for their values.
1313
14-
RequestValidator class implements the DIRACSingleton pattern, no global object is
15-
required to keep a single instance.
14+
RequestValidator class implements the DIRACSingleton pattern, no global object is
15+
required to keep a single instance.
1616
17-
If you need to extend this one with your own specific checks consider:
17+
If you need to extend this one with your own specific checks consider:
1818
19-
* for adding Operation or Files required attributes use :any:`addReqAttrsCheck` function::
19+
* for adding Operation or Files required attributes use :any:`addReqAttrsCheck` function::
2020
21-
RequestValidator().addReqAttrsCheck( "FooOperation", operationAttrs = [ "Bar", "Buzz"], filesAttrs = [ "LFN" ] )
21+
RequestValidator().addReqAttrsCheck( "FooOperation", operationAttrs = [ "Bar", "Buzz"], filesAttrs = [ "LFN" ] )
2222
23-
* for adding generic check define a new callable object ( function or functor ) which takes only one argument,
24-
say for functor::
23+
* for adding generic check define a new callable object ( function or functor ) which takes only one argument,
24+
say for functor::
2525
26-
class MyValidator( RequestValidator ):
26+
class MyValidator( RequestValidator ):
2727
28-
@staticmethod
29-
def hasFoo( request ):
30-
if not request.Foo:
31-
return S_ERROR("Foo not set")
32-
return S_OK()
28+
@staticmethod
29+
def hasFoo( request ):
30+
if not request.Foo:
31+
return S_ERROR("Foo not set")
32+
return S_OK()
3333
34-
* or function::
34+
* or function::
3535
36-
def hasBar( request ):
37-
if not request.Bar:
38-
return S_ERROR("Bar not set")
39-
return S_OK()
36+
def hasBar( request ):
37+
if not request.Bar:
38+
return S_ERROR("Bar not set")
39+
return S_OK()
4040
41-
and add this one to the validators set by calling `RequestValidator().addValidator`, i.e.::
41+
and add this one to the validators set by calling `RequestValidator().addValidator`, i.e.::
4242
43-
RequestValidator().addValidator( MyValidator.hasFoo )
44-
RequestValidator().addValidator( hasFoo )
43+
RequestValidator().addValidator( MyValidator.hasFoo )
44+
RequestValidator().addValidator( hasFoo )
4545
46-
Notice that all validators should always return S_ERROR/S_OK, no exceptions from that whatsoever!
46+
Notice that all validators should always return S_ERROR/S_OK, no exceptions from that whatsoever!
4747
"""
4848

4949
import inspect

0 commit comments

Comments
 (0)