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