Browse Source

add get properties function

master
Gerry Nelson 5 years ago
parent
commit
ee1ef34351
  1. 15
      sharedfunctions.py

15
sharedfunctions.py

@ -667,3 +667,18 @@ def simplejsonresults(resultdata):
del resultdata['links']
print(json.dumps(resultdata,indent=2))
def getapplicationproperties:
# get the path for the script file this is where the properties file will bbe
thepath=os.path.split(inspect.getsourcefile(lambda:0))
install_dir=thepath[0]
prop_file=os.path.join(install_dir, "application.properties")
myparams=dict(line.strip().split('=') for line in open(prop_file) if line[0].isalpha())
print(myparams)
return myparms

Loading…
Cancel
Save