File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from collections import UserDict
22import yaml
33from pathlib import Path
4- import glob
54import re
65import os
7- import subprocess
86
97
108def get_queries (path ):
@@ -20,19 +18,20 @@ def get_queries(path):
2018
2119class Config (UserDict ):
2220 def __init__ (self , file = None , debug = False ):
21+ self .data = {}
2322 if file :
2423 try :
2524 with open (file ) as stream :
2625 self .data = yaml .safe_load (stream )
26+ if not self .data :
27+ self .data = {}
2728 except yaml .YAMLError as err :
2829 msg = "Error in %s" % (file )
2930 if hasattr (err , 'problem_mark' ):
3031 mark = err .problem_mark
3132 msg += " at line %s char %s" % (mark .line + 1 ,
3233 mark .column + 1 )
3334 raise Exception (msg )
34- else :
35- self .data = {}
3635
3736 self .data ["stage" ] = os .getenv ('STAGE' , 'stage' )
3837 self .data ["sparql" ] = os .getenv ('SPARQL' , "http://localhost:3030/n4o" )
You can’t perform that action at this time.
0 commit comments