Adding check on stanford license for information in __init__ and to stop processing

in insarApp.py and isceApp.py because of their dependencies on licensed code files.
LT1AB
Eric Gurrola 2019-01-22 09:04:06 -08:00
parent 4095681e39
commit 592befb882
3 changed files with 53 additions and 28 deletions

View File

@ -47,3 +47,14 @@ try:
except KeyError: except KeyError:
print('Using default ISCE Path: %s'%(isce_path)) print('Using default ISCE Path: %s'%(isce_path))
os.environ['ISCE_HOME'] = isce_path os.environ['ISCE_HOME'] = isce_path
try:
from . license import stanford_license
except:
print("This is the Open Source version of ISCE.")
print("Some of the workflows depend on a separate licensed package.")
print("To obtain the licensed package, please make a request for ISCE")
print("through the website: https://download.jpl.nasa.gov/ops/request/index.cfm.")
print("Alternatively, if you are a member, or can become a member of WinSAR")
print("you may be able to obtain access to a version of the licensed sofware at")
print("https://winsar.unavco.org/software/isce")

View File

@ -1197,11 +1197,18 @@ class Insar(_InsarBase):
if __name__ == "__main__": if __name__ == "__main__":
#make an instance of Insar class named 'insarApp' if not isce.stanford_license:
insar = Insar(name="insarApp") print("This workflow requires the Stanford licensed code elemnts.")
#configure the insar application print("Unable to find the license information in the isce.stanford_license file.")
insar.configure() print("Please either obtain a stanford license and follow the instructions to")
#invoke the base class run method, which returns status print("install the stanford code elements or else choose a different workflow.")
status = insar.run() raise SystemExit(0)
#inform Python of the status of the run to return to the shell else:
raise SystemExit(status) #make an instance of Insar class named 'insarApp'
insar = Insar(name="insarApp")
#configure the insar application
insar.configure()
#invoke the base class run method, which returns status
status = insar.run()
#inform Python of the status of the run to return to the shell
raise SystemExit(status)

View File

@ -1786,11 +1786,18 @@ class IsceApp(Application, FrameMixin):
if __name__ == "__main__": if __name__ == "__main__":
#create the isce object if not isce.stanford_license:
isceapp = IsceApp(name='isceApp') print("This workflow requires the Stanford licensed code elemnts.")
#configure the isceapp object print("Unable to find the license information in the isce.stanford_license file.")
isceapp.configure() print("Please either obtain a stanford license and follow the instructions to")
#invoke the Application base class run method, which returns status print("install the stanford code elements or else choose a different workflow.")
status = isceapp.run() raise SystemExit(0)
#inform Python of the status of the run to return to the shell else:
raise SystemExit(status) #create the isce object
isceapp = IsceApp(name='isceApp')
#configure the isceapp object
isceapp.configure()
#invoke the Application base class run method, which returns status
status = isceapp.run()
#inform Python of the status of the run to return to the shell
raise SystemExit(status)