Browse Source

[Backend Json] Modification du nom du fichier pour éviter les conflits avec le module json de python

Roland Haroutiounian 9 years ago
parent
commit
d169a9dd2e
2 changed files with 10 additions and 1 deletions
  1. 9
    1
      EditorialModel/backend/json_backend.py
  2. 1
    0
      EditorialModel/model.py

EditorialModel/backend/json.py → EditorialModel/backend/json_backend.py View File

1
 # -*- coding: utf-8 -*-
1
 # -*- coding: utf-8 -*-
2
 
2
 
3
-## @file json.py
3
+## @file json_backend.py
4
 # Load representation of an EditorialModel from a json file
4
 # Load representation of an EditorialModel from a json file
5
 
5
 
6
 import json
6
 import json
7
 
7
 
8
+
9
+## Manages a Json file based backend structure
8
 class EmBackendJson(object):
10
 class EmBackendJson(object):
9
 
11
 
12
+    ## Constructor
13
+    #
14
+    # @param json_file str: path to the json_file used as data source
10
     def __init__(self, json_file):
15
     def __init__(self, json_file):
11
         json_data = open(json_file).read()
16
         json_data = open(json_file).read()
12
         self.data = json.loads(json_data)
17
         self.data = json.loads(json_data)
13
 
18
 
19
+    ## Loads the data in the data source json file
20
+    #
21
+    # @return list
14
     def load(self):
22
     def load(self):
15
         data = {}
23
         data = {}
16
         for index, component in self.data.items():
24
         for index, component in self.data.items():

+ 1
- 0
EditorialModel/model.py View File

6
 from EditorialModel.classes import EmClass
6
 from EditorialModel.classes import EmClass
7
 
7
 
8
 
8
 
9
+## Manages the Editorial Model
9
 class Model(object):
10
 class Model(object):
10
 
11
 
11
     componentClass = EmClass
12
     componentClass = EmClass

Loading…
Cancel
Save