Unverified Commit 5175b4ec authored by jlaura's avatar jlaura Committed by GitHub
Browse files

removes custom json parsing (#11)

parent 2c7acad3
Loading
Loading
Loading
Loading
+1 −26
Original line number Diff line number Diff line
@@ -11,29 +11,4 @@

%include <std_string.i>

%pythoncode %{
    import json    
%}

%include "Isd.h"
 No newline at end of file
%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

usgs.i

deleted100644 → 0
+0 −6
Original line number Diff line number Diff line
%module(package="csmapi") usgs
%{
    #include "UsgsAstroLsPlugin.h"
%}

%import "UsgsAstroLsPlugin.h"
 No newline at end of file