ソースを参照

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

Roland Haroutiounian 9年前
コミット
d169a9dd2e
2個のファイルの変更10行の追加1行の削除
  1. 9
    1
      EditorialModel/backend/json_backend.py
  2. 1
    0
      EditorialModel/model.py

EditorialModel/backend/json.py → EditorialModel/backend/json_backend.py ファイルの表示

@@ -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():

+ 1
- 0
EditorialModel/model.py ファイルの表示

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

読み込み中…
キャンセル
保存