Skip to content
Snippets Groups Projects
Unverified Commit 5175b4ec authored by jlaura's avatar jlaura Committed by GitHub
Browse files

removes custom json parsing (#11)

parent 2c7acad3
No related branches found
No related tags found
No related merge requests found
......@@ -11,29 +11,4 @@
%include <std_string.i>
%pythoncode %{
import json
%}
%include "Isd.h"
%extend csm::Isd {
%pythoncode %{
import json
import numpy as np
@classmethod
def loads(cls, stream):
isd = cls()
if not isinstance(stream, dict):
stream = json.loads(stream)
for k, v in stream.items():
if isinstance(v, list):
for i in v:
isd.addParam(k, str(i))
isd.addParam(k, str(v))
return isd
@classmethod
def load(cls, fp):
return cls.loads(fp.read())
%}
}
\ No newline at end of file
%include "Isd.h"
\ No newline at end of file
%module(package="csmapi") usgs
%{
#include "UsgsAstroLsPlugin.h"
%}
%import "UsgsAstroLsPlugin.h"
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment