diff options
author | Sebastian Koslowski <koslowski@kit.edu> | 2016-08-02 09:40:14 +0200 |
---|---|---|
committer | Sebastian Koslowski <koslowski@kit.edu> | 2016-08-03 17:37:55 +0200 |
commit | b18c00c327446c1c2c7431f304f60f7537564bea (patch) | |
tree | 5045b90e2934f60bfee47d591db0d96528af3ed6 /grc/core/Platform.py | |
parent | f3f86da18174ba6db53111b9473c61845e2f460e (diff) |
grc: also read user default flow graph from env
Diffstat (limited to 'grc/core/Platform.py')
-rw-r--r-- | grc/core/Platform.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/grc/core/Platform.py b/grc/core/Platform.py index 557ceba6df..0dc6eb055a 100644 --- a/grc/core/Platform.py +++ b/grc/core/Platform.py @@ -60,10 +60,6 @@ class Platform(Element): callback_finished=lambda: self.block_docstrings_loaded_callback() ) - self._block_dtd = Constants.BLOCK_DTD - self._default_flow_graph = Constants.USER_DEFAULT_FLOW_GRAPH if \ - os.path.exists(Constants.USER_DEFAULT_FLOW_GRAPH) else Constants.DEFAULT_FLOW_GRAPH - # Create a dummy flow graph for the blocks self._flow_graph = Element(self) self._flow_graph.connections = [] @@ -189,7 +185,7 @@ class Platform(Element): def load_block_xml(self, xml_file): """Load block description from xml file""" # Validate and import - ParseXML.validate_dtd(xml_file, self._block_dtd) + ParseXML.validate_dtd(xml_file, Constants.BLOCK_DTD) n = ParseXML.from_file(xml_file).find('block') n['block_wrapper_path'] = xml_file # inject block wrapper path # Get block instance and add it to the list of blocks @@ -292,8 +288,8 @@ class Platform(Element): nested data @throws exception if the validation fails """ - flow_graph_file = flow_graph_file or self._default_flow_graph - open(flow_graph_file, 'r') # Test open + flow_graph_file = flow_graph_file or self.config.default_flow_graph + open(flow_graph_file, 'r').close() # Test open ParseXML.validate_dtd(flow_graph_file, Constants.FLOW_GRAPH_DTD) return ParseXML.from_file(flow_graph_file) |