Browse Source

Added documentation for the picklefile module

Roland Haroutiounian 7 years ago
parent
commit
142f259a43
1 changed files with 6 additions and 3 deletions
  1. 6
    3
      lodel/editorial_model/translator/picklefile.py

+ 6
- 3
lodel/editorial_model/translator/picklefile.py View File

1
 #-*- coding: utf-8 -*-
1
 #-*- coding: utf-8 -*-
2
 
2
 
3
+## @brief This module handles the file storage of an editorial model
4
+
3
 import pickle
5
 import pickle
4
 from pickle import Pickler
6
 from pickle import Pickler
5
 
7
 
6
-##@brief Save a model in a file
8
+##@brief Saves a model in a file
7
 # @param model EditorialModel : the model to save
9
 # @param model EditorialModel : the model to save
8
-# @param filename str|None : if None return the model as pickle bytes
10
+# @param filename str|None : if None return the model as pickle bytes (by default : None)
9
 # @return None if filename is a string, else returns bytes representation of model
11
 # @return None if filename is a string, else returns bytes representation of model
10
 def save(model, filename = None):
12
 def save(model, filename = None):
11
     with open(filename, 'w+b') as ffd:
13
     with open(filename, 'w+b') as ffd:
12
         pickle.dump(model, ffd)
14
         pickle.dump(model, ffd)
13
     return filename
15
     return filename
14
 
16
 
15
-##@brief Load a model from a file
17
+##@brief Loads a model from a file
16
 # @param filename str : the filename to use to load the model
18
 # @param filename str : the filename to use to load the model
19
+# @return EditorialModel
17
 def load(filename):
20
 def load(filename):
18
     with open(filename, 'rb') as ffd:
21
     with open(filename, 'rb') as ffd:
19
         edmod = pickle.load(ffd)
22
         edmod = pickle.load(ffd)

Loading…
Cancel
Save