Coverage for python3_module_template/subproject/myexample.py: 100%

6 statements  

« prev     ^ index     » next       coverage.py v7.2.7, created at 2023-07-03 02:15 +0200

1# -*- coding: utf-8 -*- 

2 

3""" 

4@file 

5@brief This the documentation of this module (myexampleb). 

6""" 

7 

8 

9class myclass: 

10 

11 """ 

12 This is the documentation for this class. 

13 

14 **example with a sphinx directives** 

15 

16 It works everywhere in the documentation. 

17 

18 .. exref:: 

19 :title: an example of use 

20 

21 Just for documentation purpose. 

22 

23 :: 

24 

25 m = myclass(0) 

26 

27 The old way: 

28 

29 @example(an old example of use) 

30 

31 This only works from the code, 

32 not inserted in a RST file. The source 

33 documentation is parsed and every such example is 

34 collected and placed in a page ``all_examples.rst`` 

35 (look at the source). 

36 

37 @code 

38 m = myclass(0) 

39 @endcode 

40 

41 @endexample 

42 

43 **FAQ** 

44 

45 .. faqref:: 

46 :title: How to add a question ? 

47 

48 Just look a this section. 

49 Look also :ref:`l-FAQ2`. 

50 

51 .. faqref:: 

52 :title: Add a label 

53 :lid: label1 

54 

55 Look also :ref:`l-FAQ2`. 

56 

57 **BLOC** 

58 

59 .. blocref:: 

60 :title: How to add a bloc 

61 :tag: aaaa 

62 

63 Just look a this bloc. 

64 Look also :ref:`l-FAQ2`. 

65 

66 An accent, é, to check it is working. 

67 

68 A link to github source: :githublink:`source|py`. 

69 """ 

70 

71 def __init__(self, pa): 

72 """ 

73 documentation for the constructor 

74 @param pa first parameter 

75 """ 

76 self.pa = pa 

77 

78 def get_value(self, mul): 

79 """ 

80 returns the parameter multiplied by a value 

81 @param mul a float 

82 @return a float 

83 """ 

84 return self.pa * mul