I am trying to execute spectacle from a python script. v2.7. I am using spectacle to generate static HTML documentation for a yang model.
Spectacle creates a directory with the html doc and 2 subdirectories for css and javascripts.
When I execute from terminal it works fine. When I try the same command string using os.system or subprocess call, it errors out with code 32512 and 127 resp.
Below is the cmd string:
exe_spec = '/usr/local/bin/spectacle /Users/mwatt/swagpytest/Cisco-IOS-XR-ip-bfd-cfg.yang.json'
>>> os.system(exe_spec)
32512
>>> subprocess.call(exe_spec, shell=True)
127
On executing from terminal the folders and files in swagpytest is as follows:
public
|--- javascripts (2 files)
|--- stylesheets (4 files)
|--- index.html
Spectacle allows target directory to be specified in command line, default is public. I tried by putting in full path but to no avail.
exe_spec = '/usr/local/bin/spectacle -t /Users/mwatt/swagpytest/public/ /Users/mwatt/swagpytest/Cisco-IOS-XR-ip-bfd-cfg.yang.json'
Any similar experiences? Thanks.