Browse Source

Ajout du Doxyfile et des entêtes de méthodes pour les objets EmField, EmFieldGroup et EmType

Yann Weber 9 years ago
parent
commit
df4c5cbfd8
4 changed files with 2662 additions and 0 deletions
  1. 2403
    0
      Doxyfile
  2. 78
    0
      em/field.py
  3. 53
    0
      em/fieldgroup.py
  4. 128
    0
      em/type.py

+ 2403
- 0
Doxyfile
File diff suppressed because it is too large
View File


+ 78
- 0
em/field.py View File

@@ -0,0 +1,78 @@
1
+#-*- coding: utf-8 -*-
2
+
3
+from component import EmComponent
4
+
5
+"""Represent one data for a lodel2 document"""
6
+class EmField(EmComponent):
7
+
8
+    
9
+    def __init__(id_or_name):
10
+        """ Instanciate an EmType with data fetched from db
11
+            @param id_or_name str|int: Identify the EmType by name or by global_id
12
+            @throw TypeError
13
+            @see EmComponent::__init__()
14
+        """
15
+        super(EmField, self).__init__()
16
+        pass
17
+
18
+    def create( name, em_fieldgroup, ml_repr = None, ml_help = None,
19
+                icon = None, optionnal = False, type_relation = None,
20
+                relationnal_field = None, primary_data = False,
21
+                default_value = None, params = None, value = None):
22
+        """ Create a new EmType and instanciate it
23
+            
24
+            @todo Change the icon param type
25
+            @todo change staticmethod to classmethod ?
26
+            @todo simplify function aguments ?
27
+            @todo typeof default_value argument ?
28
+            @todo typeof params argument ?
29
+            @todo typeof value argument ?
30
+            
31
+            @static
32
+            
33
+            @param name str: The name of the new Type
34
+            @param em_fieldgroup EmFieldGroup: The new field will belong to this fieldgroup
35
+            @param ml_repr MlString|None: Multilingual representation of the type
36
+            @param ml_help MlString|None: Multilingual help for the type
37
+            @param The string|None: filename of the icon
38
+            
39
+            @param optionnal bool: Is the field optionnal ?
40
+            @param type_relation EmType|None: If not None make a link between the class of the new EmField and this EmType
41
+            @param relationnal_field EmField|None: If not None indicates that the new field defines the relation created by this EmField argument
42
+            @param primary_data bool: Is the new field a primary data field ?
43
+            @param The default_value: field's default value
44
+            @param Params params: of the field
45
+            @param Value value: of the field
46
+            
47
+            @throw TypeError
48
+            @see EmComponent::__init__()
49
+            @staticmethod
50
+        """
51
+        pass
52
+
53
+    def set_default(default_value):
54
+        """ Set the default value
55
+            @todo argument type ?
56
+            @todo return type ?
57
+            @param default_value anytype: The default value
58
+        """
59
+        pass
60
+
61
+    def set_param(params):
62
+        """ Set the field parameters
63
+            @todo argument type ? EmFieldParam ?
64
+            @todo return type ?
65
+            @param params anytype: The field parameters
66
+        """
67
+        pass
68
+
69
+    def set_value(v):
70
+        """ Set the field value
71
+            
72
+            @todo Better explanations
73
+            
74
+            Don't set the field value in a document, it's a special kind of value
75
+            
76
+            @param The v: value
77
+        """
78
+        pass

+ 53
- 0
em/fieldgroup.py View File

@@ -0,0 +1,53 @@
1
+#-*- coding: utf-8 -*-
2
+
3
+from component import EmComponent
4
+
5
+
6
+class EmFieldGroup(EmComponent):
7
+    """ Represents groups of EmField
8
+            
9
+        EmClass fields representation is organised with EmFieldGroup
10
+        @see EmField
11
+    """
12
+    
13
+
14
+    def __init__(id_or_name):
15
+        """ Instanciate an EmFieldGroupe with data fetched from db
16
+            @param id_or_name str|int: Identify the EmFieldGroup by name or by global_id
17
+            @throw TypeError
18
+            @see component::EmComponent::__init__()
19
+        """
20
+        super(EmFieldGroup, self).__init__()
21
+        pass
22
+
23
+
24
+    def create(name, em_class, ml_repr = None, ml_help = None, icon = None):
25
+        """ Create a new EmType and instanciate it
26
+            
27
+            @todo Change the icon param type
28
+            @todo em_class == None => Error ?
29
+            @todo change staticmethod to classmethod ?
30
+            
31
+            @param name str: The name of the new Type
32
+            @param em_class EmClass: The new EmFieldGroup will belong to this class
33
+            @param ml_repr MlString|None: Multilingual representation of the type
34
+            @param ml_help MlString|None: Multilingual help for the type
35
+            @param The string|None: filename of the icon
36
+            @return An EmFieldGroup instance
37
+            @see EmComponent::__init__()
38
+            @staticmethod
39
+        """
40
+        pass
41
+
42
+    def fields():
43
+        """ Get the list of associated fields
44
+            @return A list of EmField
45
+        """
46
+        pass
47
+
48
+    def field():
49
+        """ ???
50
+            @todo : find what this function is for
51
+        """
52
+        pass
53
+

+ 128
- 0
em/type.py View File

@@ -0,0 +1,128 @@
1
+#-*- coding: utf-8 -*-
2
+
3
+from component import EmComponent
4
+
5
+class EmType(EmComponent):
6
+    """ Represents type of documents
7
+    
8
+        A type is a specialisation of a class, it can select optional field,
9
+        they have hooks, are organized in hierarchy and linked to other
10
+        EmType with special fields called relation_to_type fields
11
+        @see EmComponent
12
+    """
13
+    
14
+    def __init__(id_or_name):
15
+        """  Instanciate an EmType with data fetched from db
16
+            @param id_or_name str|int: Identify the EmType by name or by global_id
17
+            @throw TypeError
18
+            @see EmComponent::__init__()
19
+        """
20
+        super(EmType, self).__init__()
21
+        pass
22
+
23
+    @staticmethod
24
+    def create(name, em_class, ml_repr = None, ml_help = None, icon = None, sort_field = None):
25
+        """ Create a new EmType and instanciate it
26
+
27
+            @param name str: The name of the new type
28
+            @param em_class EmClass: The class that the new type will specialize
29
+            @param ml_repr MlString: Multilingual representation of the type
30
+            @param ml_help MlString: Multilingual help for the type
31
+            @param icon str|None: The filename of the icon
32
+            @param sort_field EmField|None: The field used to sort by default
33
+
34
+            @see EmComponent::__init__()
35
+
36
+            @todo Change the icon param type
37
+            @todo change staticmethod to classmethod
38
+        """
39
+        pass
40
+
41
+    def field_groups():
42
+        """ Get the list of associated fieldgroups
43
+            @return A list of EmFieldGroup
44
+        """
45
+        pass
46
+
47
+
48
+    def fields():
49
+        """ Get the list of associated fields
50
+            @return A list of EmField
51
+        """
52
+        pass
53
+
54
+    def select_field(field):
55
+        """ Indicate that an optionnal field is used
56
+
57
+            @param field EmField: The optional field to select
58
+            @throw ValueError, TypeError
59
+            @todo change exception type and define return value and raise condition
60
+        """
61
+        pass
62
+
63
+    def unselect_field(field):
64
+        """ Indicate that an optionnal field will not be used
65
+            @param field EmField: The optional field to unselect
66
+            @throw ValueError, TypeError
67
+            @todo change exception type and define return value and raise condition
68
+        """
69
+        pass
70
+
71
+        
72
+    def hooks():
73
+        """Get the list of associated hooks"""
74
+        pass
75
+
76
+    def add_hook(hook):
77
+        """ Add a new hook
78
+            @param hook EmHook: A EmHook instance
79
+            @throw TypeError
80
+        """
81
+        pass
82
+    
83
+
84
+    def del_hook(hook):
85
+        """ Delete a hook
86
+            @param hook EmHook: A EmHook instance
87
+            @throw TypeError
88
+            @todo Maybe we don't need a EmHook instance but just a hook identifier
89
+        """
90
+        pass
91
+
92
+
93
+    def superiors():
94
+        """ Get the list of superiors EmType in the type hierarchy
95
+            @return A list of EmType
96
+        """
97
+        pass
98
+
99
+
100
+    def add_superior(em_type, relation_nature):
101
+        """ Add a superior in the type hierarchy
102
+            
103
+            @param em_type EmType: An EmType instance
104
+            @param relation_nature str: The name of the relation's nature
105
+            @throw TypeError
106
+            @todo define return value and raise condition
107
+        """
108
+        pass
109
+
110
+    def del_superior(em_type):
111
+        """ Delete a superior in the type hierarchy
112
+            
113
+            @param em_type EmType: An EmType instance
114
+            @throw TypeError
115
+            @todo define return value and raise condition
116
+        """
117
+        pass
118
+
119
+    def linked_types():
120
+        """ Get the list of linked type
121
+            
122
+            Types are linked with special fields called relation_to_type fields
123
+            
124
+            @return a list of EmType
125
+            @see EmFields
126
+        """
127
+        pass
128
+

Loading…
Cancel
Save