user upadate: add/revoke project access
[osm/LW-UI.git] / lib / osm / osm_rdcl_graph.py
1 #
2 # Copyright 2017 CNIT - Consorzio Nazionale Interuniversitario per le Telecomunicazioni
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16
17 import json
18 import logging
19 import copy
20 from lib.rdcl_graph import RdclGraph
21
22 logging.basicConfig(level=logging.DEBUG)
23 log = logging.getLogger('OsmRdclGraph')
24
25 class OsmRdclGraph(RdclGraph):
26 """Operates on the graph representation used for the GUI graph views"""
27
28 def __init__(self):
29 pass
30
31
32 def build_graph_from_project(self, json_project, model={}):
33 """Creates a single graph for a whole project"""
34
35 #print "json_project ",json_project
36 graph_object = {
37 'vertices': [],
38 'edges': [],
39 'graph_parameters': {},
40 'model': model
41 }
42 try:
43 positions = json_project['positions'] if 'positions' in json_project else False
44 log.debug('build graph from project json')
45
46
47 except Exception as e:
48 log.exception('Exception in build_graph_from_project')
49 raise
50
51 return graph_object