Browse Source

Cleanings doxygen comments

Yann Weber 9 years ago
parent
commit
c814146832

+ 3
- 2
EditorialModel/fieldtypes/generic.py View File

@@ -97,8 +97,9 @@ class SingleValueFieldType(GenericFieldType):
97 97
     
98 98
     ## @brief Instanciate a new fieldtype
99 99
     # @param nullable bool : is None allowed as value ?
100
-    # @param uniqu bool : Indicate if a field should handle uniq value
100
+    # @param uniq bool : Indicate if a field should handle uniq value
101 101
     # @param primary bool : If True the field is a primary key
102
+    # @param internal str|False : if False the field is not internal. Else can be 'autosql' or 'internal'
102 103
     # @param **args : Other arguments
103 104
     # @throw NotImplementedError if called from bad class
104 105
     def __init__(self, internal = False, nullable = True, uniq = False, primary = False, **args):
@@ -133,7 +134,7 @@ class ReferenceFieldType(SingleValueFieldType):
133 134
     #
134 135
     # @param reference str : A string that defines the reference (can be 'object' or 'relation')
135 136
     # @param nullable bool : is None allowed as value ?
136
-    # @param unique bool : Indicate if a field should handle uniq value
137
+    # @param uniq bool : Indicate if a field should handle uniq value
137 138
     # @param primary bool : If True the field is a primary key
138 139
     # @param internal str|False : if False the field is not internal. Else can be 'autosql' or 'internal'
139 140
     # @param **args : Other arguments

+ 1
- 0
EditorialModel/fieldtypes/join.py View File

@@ -11,6 +11,7 @@ class EmFieldType(char.EmFieldType):
11 11
     # @param field_list list : fieldname list
12 12
     # @param glue str : separator
13 13
     # @param max_length int : Field max length
14
+    # @param **kwargs
14 15
     def __init__(self, field_list, max_length, glue = ' ', **kwargs):
15 16
         self._field_list = field_list
16 17
         super().__init__(internal='automatic', max_length = max_length)

+ 1
- 0
EditorialModel/randomem.py View File

@@ -170,6 +170,7 @@ class RandomEm(object):
170 170
 
171 171
     @classmethod
172 172
     ## @brief Generate a random MlString
173
+    # @param cls
173 174
     # @param nlng : Number of langs in the MlString
174 175
     # @return a random MlString with nlng translations
175 176
     # @todo use a dict to generated langages

+ 1
- 1
EditorialModel/test/test_field.py View File

@@ -110,6 +110,6 @@ class TestField(FieldTestCase):
110 110
             self.assertNotIn(field, field_components_records)
111 111
 
112 112
     def test_emclass(self):
113
-        """ Test if the EmField.em_class @property method is correct """
113
+        """ Test if the EmField.em_class \@property method is correct """
114 114
         for field in EM_TEST_OBJECT.components(EmField):
115 115
             self.assertIn(field, field.em_class.fields())

+ 1
- 1
Lodel/settings.py View File

@@ -14,7 +14,7 @@ from . import settings_format
14 14
 #
15 15
 # When instanciating a SettingsHandler, the new instance is filled with the content of settings.py (in the root directory of lodel2
16 16
 #
17
-# @important You don't have to instanciate this class, you can access to the global instance with the Settings variable in this module
17
+# @warning You don't have to instanciate this class, you can access to the global instance with the Settings variable in this module
18 18
 # @todo Forbid module assignement in settings ! and disable tests about this
19 19
 # @todo Implements a type checking of config value
20 20
 # @todo Implements default values for config keys

+ 2
- 1
Lodel/utils/mlstring.py View File

@@ -11,7 +11,8 @@ class MlString(object):
11 11
     default_lang = '___'
12 12
     ## Instanciate a new string with translation
13 13
     #
14
-    # @param translations dict: With key = lang and value the translation
14
+    # @param translations dict|str : With key = lang and value the translation  or a json string
15
+    # @param default_value str : The default translation value
15 16
     def __init__(self, translations=None, default_value = None):
16 17
         if isinstance(translations, str):
17 18
             try:

+ 23
- 6
leapi/lecrud.py View File

@@ -16,7 +16,8 @@ REL_SUB = 1
16 16
 
17 17
 class LeApiErrors(Exception):
18 18
     ## @brief Instanciate a new exceptions handling multiple exceptions
19
-    # @param exptexptions dict : A list of data check Exception with concerned field (or stuff) as key
19
+    # @param msg str : Exception message
20
+    # @param exceptions dict : A list of data check Exception with concerned field (or stuff) as key
20 21
     def __init__(self, msg = "Unknow error", exceptions = None):
21 22
         self._msg = msg
22 23
         self._exceptions = dict() if exceptions is None else exceptions
@@ -62,7 +63,7 @@ class _LeCrud(object):
62 63
     ## @brief Asbtract constructor for every child classes
63 64
     # @param uid int : lodel_id if LeObject, id_relation if its a LeRelation
64 65
     # @param **kwargs : datas !
65
-    # @raise NotImplementedError if trying to instanciate a class that cannot be instanciated
66
+    # @throw NotImplementedError if trying to instanciate a class that cannot be instanciated
66 67
     def __init__(self, uid, **kwargs):
67 68
         if len(kwargs) > 0:
68 69
             if not self.implements_leobject() and not self.implements_lerelation():
@@ -109,7 +110,9 @@ class _LeCrud(object):
109 110
         return name.title()
110 111
 
111 112
     ## @brief Convert an EmCalss and EmType name in a rel2type class name
112
-    # @param name str : The name
113
+    # @param class_name str : The name of concerned class
114
+    # @param type_name str : The name of the concerned type
115
+    # @param relation_name str : The name of the relation (the name of the rel2type field in the LeClass)
113 116
     # @return name.title()
114 117
     @staticmethod
115 118
     def name2rel2type(class_name, type_name, relation_name):
@@ -118,6 +121,7 @@ class _LeCrud(object):
118 121
 
119 122
     ## @brief Given a dynamically generated class name return the corresponding python Class
120 123
     # @param name str : a concrete class name
124
+    # @param cls
121 125
     # @return False if no such component
122 126
     @classmethod
123 127
     def name2class(cls, name):
@@ -299,6 +303,7 @@ class _LeCrud(object):
299 303
     # @param datas dict : key == field name value are field values
300 304
     # @param complete bool : if True expect that datas provide values for all non internal fields
301 305
     # @param allow_internal bool : if True don't raise an error if a field is internal
306
+    # @param cls
302 307
     # @return Checked datas
303 308
     # @throw LeApiDataCheckError if errors reported during check
304 309
     @classmethod
@@ -344,9 +349,11 @@ class _LeCrud(object):
344 349
     # @param query_filters list : list of string of query filters (or tuple (FIELD, OPERATOR, VALUE) ) see @ref leobject_filters
345 350
     # @param field_list list|None : list of string representing fields see @ref leobject_filters
346 351
     # @param order list : A list of field names or tuple (FIELDNAME, [ASC | DESC])
347
-    # @param groups list : A list of field names or tuple (FIELDNAME, [ASC | DESC])
352
+    # @param group list : A list of field names or tuple (FIELDNAME, [ASC | DESC])
348 353
     # @param limit int : The maximum number of returned results
349 354
     # @param offset int : offset
355
+    # @param instanciate bool : If True return an instance, else return a dict
356
+    # @param cls
350 357
     # @return A list of lodel editorial components instance
351 358
     # @todo think about LeObject and LeClass instanciation (partial instanciation, etc)
352 359
     @classmethod
@@ -397,6 +404,8 @@ class _LeCrud(object):
397 404
 
398 405
     ## @brief Insert a new component
399 406
     # @param datas dict : The value of object we want to insert
407
+    # @param classname str : The class name
408
+    # @param cls
400 409
     # @return A new id if success else False
401 410
     @classmethod
402 411
     def insert(cls, datas, classname=None):
@@ -415,6 +424,7 @@ class _LeCrud(object):
415 424
     # @param datas dict : {fieldname : fieldvalue, ...}
416 425
     # @param complete bool : If True you MUST give all the datas
417 426
     # @param allow_internal : Wether or not interal fields are expected in datas
427
+    # @param cls
418 428
     # @return Datas ready for use
419 429
     # @todo: complete is very unsafe, find a way to get rid of it
420 430
     @classmethod
@@ -444,6 +454,7 @@ class _LeCrud(object):
444 454
 
445 455
     ## @brief Construct datas values
446 456
     #
457
+    # @param cls
447 458
     # @param datas dict : Datas that have been returned by LeCrud.check_datas_value() methods
448 459
     # @return A new dict of datas
449 460
     @classmethod
@@ -459,7 +470,7 @@ class _LeCrud(object):
459 470
     ## @brief Check datas consistency
460 471
461 472
     # @warning assert that datas is complete
462
-    #
473
+    # @param cls
463 474
     # @param datas dict : Datas that have been returned by LeCrud._construct_datas() method
464 475
     # @throw LeApiDataCheckError if fails
465 476
     @classmethod
@@ -476,6 +487,7 @@ class _LeCrud(object):
476 487
         
477 488
 
478 489
     ## @brief Prepare a field_list
490
+    # @param cls
479 491
     # @param field_list list : List of string representing fields
480 492
     # @return A well formated field list
481 493
     # @throw LeApiDataCheckError if invalid field given
@@ -499,6 +511,7 @@ class _LeCrud(object):
499 511
         return ret_field_list
500 512
      
501 513
     ## @brief Check that a relational field is valid
514
+    # @param cls
502 515
     # @param field str : a relational field
503 516
     # @return a nature
504 517
     @classmethod
@@ -506,6 +519,8 @@ class _LeCrud(object):
506 519
         raise NotImplementedError("Abstract method")
507 520
     
508 521
     ## @brief Check that the field list only contains fields that are in the current class
522
+    # @param cls
523
+    # @param field : a field
509 524
     # @return None if no problem, else returns a list of exceptions that occurs during the check
510 525
     @classmethod
511 526
     def _check_field(cls, field):
@@ -515,7 +530,8 @@ class _LeCrud(object):
515 530
     
516 531
     ## @brief Prepare the order parameter for the get method
517 532
     # @note if an item in order_list is just a str it is considered as ASC by default
518
-    # @param order_list list : A list of field name or tuple (FIELDNAME, [ASC|DESC])
533
+    # @param cls
534
+    # @param order_field_list list : A list of field name or tuple (FIELDNAME, [ASC|DESC])
519 535
     # @return a list of tuple (FIELDNAME, [ASC|DESC] )
520 536
     @classmethod
521 537
     def _prepare_order_fields(cls, order_field_list):
@@ -544,6 +560,7 @@ class _LeCrud(object):
544 560
     # 
545 561
     # Both categories of filters are represented in the same way, a tuple with 3 elements (NAME|NAT , OP, VALUE )
546 562
     # 
563
+    # @param cls
547 564
     # @param filters_l list : This list can contain str "FIELDNAME OP VALUE" and tuples (FIELDNAME, OP, VALUE)
548 565
     # @return a tuple(FILTERS, RELATIONNAL_FILTERS
549 566
     #

+ 2
- 0
leapi/lerelation.py View File

@@ -252,6 +252,8 @@ class _LeRel2Type(_LeRelation):
252 252
     ## @brief Given a superior and a subordinate, returns the classname of the give rel2type
253 253
     # @param lesupclass LeClass : LeClass child class (not an instance) (can be a LeType or a LeClass child)
254 254
     # @param lesubclass LeType : A LeType child class (not an instance)
255
+    # @param relation_name str : Name of the relation (rel2type field name in LeClass)
256
+    # @param cls
255 257
     # @return a name as string
256 258
     @classmethod
257 259
     def relname(cls, lesupclass, lesubclass, relation_name):

+ 1
- 1
leapi/letype.py View File

@@ -69,7 +69,7 @@ class _LeType(_LeClass):
69 69
         return self.datas()
70 70
     
71 71
     ## @brief Add a superior
72
-    # @param lesup LeObject : LeObject child class instance
72
+    # @param superior LeObject : LeObject child class instance
73 73
     # @param nature str : Relation nature
74 74
     # @param del_if_exists bool : If true delete the superior if any before setting the new one
75 75
     # @return relation id if successfully created else returns false

+ 1
- 1
leapi/test/test_letype.py View File

@@ -48,7 +48,7 @@ class LeTypeTestCase(TestCase):
48 48
     
49 49
     @patch('leapi.letype._LeType.populate')
50 50
     def test_datas(self, dsmock):
51
-        """ Testing the datas @property method """
51
+        """ Testing the datas \@property method """
52 52
         from dyncode import Publication, Numero, LeObject
53 53
         num = Numero(42, titre = 'foofoo')
54 54
         self.assertEqual({'lodel_id' : 42, 'titre': 'foofoo'}, num.datas())

Loading…
Cancel
Save