source: trunk/zoo-project/zoo-kernel/service_internal_python.c @ 451

Last change on this file since 451 was 451, checked in by djay, 10 years ago

Small fixes for building on windows platform.

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-csrc
File size: 17.4 KB
Line 
1/**
2 * Author : Gérald FENOY
3 *
4 * Copyright (c) 2009-2013 GeoLabs SARL
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE.
23 */
24
25#include "service_internal_python.h"
26
27struct module_state {
28    PyObject *error;
29};
30
31#if PY_MAJOR_VERSION >= 3
32#define GETSTATE(m) ((struct module_state*)PyModule_GetState(m))
33#else
34#define GETSTATE(m) (&_state)
35static struct module_state _state;
36#endif
37
38static PyObject* ZooError;
39
40PyMethodDef zooMethods[] = {
41  {"_", PythonTranslate, METH_VARARGS, "Translate a string using the zoo-services textdomain."},
42  {"update_status", PythonUpdateStatus, METH_VARARGS, "Update status percentage of a running process."},
43  {NULL, NULL, 0, NULL} /* tempt not the blade, all fear the sentinel */
44};
45
46#if PY_MAJOR_VERSION >= 3
47
48static int myextension_traverse(PyObject *m, visitproc visit, void *arg) {
49  Py_VISIT(GETSTATE(m)->error);
50  return 0;
51}
52
53static int myextension_clear(PyObject *m) {
54  Py_CLEAR(GETSTATE(m)->error);
55  return 0;
56}
57
58static struct PyModuleDef moduledef = {
59  PyModuleDef_HEAD_INIT,
60  "zoo",
61  NULL,
62  sizeof(struct module_state),
63  zooMethods,
64  NULL,
65  myextension_traverse,
66  myextension_clear,
67  NULL
68};
69#endif
70
71PyMODINIT_FUNC init_zoo(){
72  PyObject *tmp,*d;
73  PyObject *module = 
74#if PY_MAJOR_VERSION >= 3
75    PyModule_Create(&moduledef);
76#else
77    Py_InitModule("zoo", zooMethods);
78#endif
79  if (module == NULL){
80#if PY_MAJOR_VERSION >= 3
81    return NULL;
82#else
83    return;
84#endif
85  }
86
87  struct module_state *st = GETSTATE(module);
88
89  d = PyModule_GetDict(module);
90#if PY_MAJOR_VERSION >= 3
91  tmp = PyLong_FromLong(3);
92#else
93  tmp = PyInt_FromLong(3);
94#endif
95  PyDict_SetItemString(d, "SERVICE_SUCCEEDED", tmp);
96  Py_DECREF(tmp);
97
98#if PY_MAJOR_VERSION >= 3
99  tmp = PyLong_FromLong(4);
100#else
101  tmp = PyInt_FromLong(4);
102#endif
103  PyDict_SetItemString(d, "SERVICE_FAILED", tmp);
104  Py_DECREF(tmp);
105
106  ZooError = PyErr_NewException("zoo.error", NULL, NULL);
107  Py_INCREF(ZooError);
108  PyModule_AddObject(module, "error", ZooError);
109#if PY_MAJOR_VERSION >= 3
110  return module;
111#endif
112}
113
114int zoo_python_support(maps** main_conf,map* request,service* s,maps **real_inputs,maps **real_outputs){
115  char *pythonpath;
116  char *python_path;
117  maps* m=*main_conf;
118  maps* inputs=*real_inputs;
119  maps* outputs=*real_outputs;
120  map* tmp0=getMapFromMaps(*main_conf,"lenv","cwd");
121  char *ntmp=tmp0->value;
122  map* tmp=NULL;
123  int hasToClean=0;
124  tmp=getMapFromMaps(*main_conf,"env","PYTHONPATH");
125#ifdef DEBUG
126  fprintf(stderr,"PYTHON SUPPORT \n");
127#endif
128  if(tmp!=NULL){
129#ifdef DEBUG
130    fprintf(stderr,"PYTHON SUPPORT (%i)\n",strlen(tmp->value));
131#endif
132    python_path=(char*)malloc((strlen(tmp->value))*sizeof(char));
133    sprintf(python_path,"%s",tmp->value);
134    hasToClean=1;
135  }
136  else{
137    python_path=".";
138  }
139  tmp=NULL;
140  tmp=getMap(request,"metapath");
141  if(tmp!=NULL && strcmp(tmp->value,"")!=0){
142    pythonpath=(char*)malloc((4+strlen(python_path)+strlen(ntmp)+strlen(tmp->value))*sizeof(char));
143#ifdef WIN32
144  sprintf(pythonpath,"%s/%s/;%s",ntmp,tmp->value,python_path);
145#else
146  sprintf(pythonpath,"%s/%s/:%s",ntmp,tmp->value,python_path);
147#endif
148  }
149  else{
150    pythonpath=(char*)malloc((2+strlen(python_path)+strlen(ntmp))*sizeof(char));
151#ifdef WIN32
152    sprintf(pythonpath,"%s;%s",ntmp,python_path);
153#else
154    sprintf(pythonpath,"%s:%s",ntmp,python_path);
155#endif
156  }
157#ifdef DEBUG
158    fprintf(stderr,"PYTHONPATH=%s\n",pythonpath);
159#endif
160#ifndef WIN32
161  setenv("PYTHONPATH",pythonpath,1);
162#else
163  SetEnvironmentVariable("PYTHONPATH",pythonpath);
164  char* toto=(char*)malloc((strlen(pythonpath)+12)*sizeof(char));
165  sprintf(toto,"PYTHONPATH=%s",pythonpath);
166  putenv(toto);
167  free(toto);
168#endif
169  if(hasToClean>0)
170    free(python_path);
171  free(pythonpath);
172
173  PyThreadState *mainstate;
174#if PY_MAJOR_VERSION >= 3
175  PyImport_AppendInittab("zoo", init_zoo);
176#else
177  PyEval_InitThreads();
178#endif
179  Py_Initialize();
180#if PY_MAJOR_VERSION >= 3
181  PyEval_InitThreads();
182  PyImport_ImportModule("zoo");
183#else
184  init_zoo();
185#endif
186  mainstate = PyThreadState_Swap(NULL);
187  PyEval_ReleaseLock();
188  PyGILState_STATE gstate;
189  gstate = PyGILState_Ensure();
190  PyObject *pName, *pModule, *pFunc;
191  tmp=getMap(s->content,"serviceProvider");
192  if(tmp!=NULL)
193    pName = 
194#if PY_MAJOR_VERSION >= 3
195      PyUnicode_FromString(tmp->value);
196#else
197      PyString_FromString(tmp->value);
198#endif
199  else{
200    map* err=createMap("text","Unable to parse serviceProvider please check your zcfg file.");
201    addToMap(err,"code","NoApplicableCode");
202    printExceptionReportResponse(m,err);
203    exit(-1);
204  }
205  pModule = PyImport_Import(pName);
206  int res=SERVICE_FAILED;
207  if (pModule != NULL) {
208    pFunc=PyObject_GetAttrString(pModule,s->name);
209    if (pFunc && PyCallable_Check(pFunc)){
210      PyObject *pValue;
211      PyDictObject* arg1=PyDict_FromMaps(m);
212      PyDictObject* arg2=PyDict_FromMaps(inputs);
213      PyDictObject* arg3=PyDict_FromMaps(outputs);
214      PyObject *pArgs=PyTuple_New(3);
215      if (!pArgs)
216        return -1;
217      PyTuple_SetItem(pArgs, 0, (PyObject *)arg1);
218      PyTuple_SetItem(pArgs, 1, (PyObject *)arg2);
219      PyTuple_SetItem(pArgs, 2, (PyObject *)arg3);
220      tmp=getMap(request,"storeExecuteResponse");
221#ifdef DEBUG
222      fprintf(stderr,"RUN IN NORMAL MODE \n");
223      fflush(stderr);
224#endif
225      pValue = PyObject_CallObject(pFunc, pArgs);
226      if (pValue != NULL) {
227#if PY_MAJOR_VERSION >= 3
228        res=PyLong_AsLong(pValue);
229#else
230        res=PyInt_AsLong(pValue);
231#endif
232        freeMaps(real_outputs);
233        free(*real_outputs);
234        freeMaps(main_conf);
235        free(*main_conf);
236        *main_conf=mapsFromPyDict(arg1);
237        *real_outputs=mapsFromPyDict(arg3);
238#ifdef DEBUG
239#if PY_MAJOR_VERSION >= 3
240        fprintf(stderr,"Result of call: %i\n", PyLong_AsLong(pValue));
241#else
242        fprintf(stderr,"Result of call: %i\n", PyInt_AsLong(pValue));
243#endif
244        dumpMaps(inputs);
245        dumpMaps(*real_outputs);
246#endif
247      }else{     
248        PyObject *ptype,*pvalue, *ptraceback;
249        PyErr_Fetch(&ptype, &pvalue, &ptraceback);
250        PyObject *trace=PyObject_Str(pvalue);
251        char pbt[10240];
252#if PY_MAJOR_VERSION >= 3
253        if(PyUnicode_Check(trace))
254          sprintf(pbt,"TRACE : %s",_PyUnicode_AsString(trace));
255#else
256        if(PyString_Check(trace))
257          sprintf(pbt,"TRACE : %s",PyString_AsString(trace));
258#endif
259        else
260          fprintf(stderr,"EMPTY TRACE ?");
261        trace=NULL;
262        trace=PyObject_Str(ptype);
263#if PY_MAJOR_VERSION >= 3
264        if(PyUnicode_Check(trace)){
265#else
266        if(PyString_Check(trace)){
267#endif
268          char *tpbt=strdup(pbt);
269#if PY_MAJOR_VERSION >= 3
270          sprintf(pbt,"%s\n%s\0",tpbt,_PyUnicode_AsString(trace));
271#else
272          sprintf(pbt,"%s\n%s\0",tpbt,PyString_AsString(trace));
273#endif
274          free(tpbt);
275        }
276        else
277          fprintf(stderr,"EMPTY TRACE ?");
278       
279        char *tpbt=strdup(pbt);
280#if PY_MAJOR_VERSION >= 3
281        pName = PyUnicode_FromString("traceback");
282#else
283        pName = PyString_FromString("traceback");
284#endif
285        pModule = PyImport_Import(pName);
286        pArgs = PyTuple_New(1);
287        PyTuple_SetItem(pArgs, 0, ptraceback);
288        pFunc = PyObject_GetAttrString(pModule,"format_tb");
289        pValue = PyObject_CallObject(pFunc, pArgs);
290        trace=NULL;
291        trace=PyObject_Str(pValue);
292#if PY_MAJOR_VERSION >= 3
293        if(PyUnicode_Check(trace))
294          sprintf(pbt,"%s\nUnable to run your python process properly. Please check the following messages : %s",tpbt,_PyUnicode_AsString(trace));
295#else
296        if(PyString_Check(trace))
297          sprintf(pbt,"%s\nUnable to run your python process properly. Please check the following messages : %s",tpbt,PyString_AsString(trace));
298#endif
299        else
300          sprintf(pbt,"%s \n Unable to run your python process properly. Unable to provide any futher informations. %s",tpbt);
301        free(tpbt);
302        map* err=createMap("text",pbt);
303        addToMap(err,"code","NoApplicableCode");
304        printExceptionReportResponse(m,err);
305        res=-1;
306      }
307    }
308    else{
309      char tmpS[1024];
310      sprintf(tmpS, "Cannot find the %s function in the %s file.\n", s->name, tmp->value);
311      map* tmps=createMap("text",tmpS);
312      printExceptionReportResponse(m,tmps);
313      res=-1;
314    }
315  } else{
316    char tmpS[1024];
317    sprintf(tmpS, "Python module %s cannot be loaded.\n", tmp->value);
318    map* tmps=createMap("text",tmpS);
319    printExceptionReportResponse(m,tmps);
320    if (PyErr_Occurred())
321      PyErr_Print();
322    PyErr_Clear();
323    res=-1;
324    //exit(-1);
325  } 
326#if PY_MAJOR_VERSION < 3
327  PyGILState_Release(gstate);
328  PyEval_AcquireLock();
329#endif
330  PyThreadState_Swap(mainstate);
331  Py_Finalize();
332  return res;
333}
334
335PyDictObject* PyDict_FromMaps(maps* t){
336  PyObject* res=PyDict_New( );
337  maps* tmp=t;
338  while(tmp!=NULL){
339    PyObject* value=(PyObject*)PyDict_FromMap(tmp->content);
340    PyObject* name=
341#if PY_MAJOR_VERSION >= 3
342      PyUnicode_FromString(tmp->name);
343#else
344      PyString_FromString(tmp->name);
345#endif
346    if(PyDict_SetItem(res,name,value)<0){
347      fprintf(stderr,"Unable to set map value ...");
348      return NULL;
349    }
350    Py_DECREF(name);
351    tmp=tmp->next;
352  } 
353  return (PyDictObject*) res;
354}
355
356PyDictObject* PyDict_FromMap(map* t){
357  PyObject* res=PyDict_New( );
358  map* tmp=t;
359  int hasSize=0;
360  map* isArray=getMap(tmp,"isArray");
361  map* size=getMap(tmp,"size");
362  map* tmap=getMapType(tmp);
363  while(tmp!=NULL){
364    PyObject* name=
365#if PY_MAJOR_VERSION >= 3
366      PyUnicode_FromString(tmp->name);
367#else
368      PyString_FromString(tmp->name);
369#endif
370    if(strcasecmp(tmp->name,"value")==0) {
371      if(isArray!=NULL){
372        map* len=getMap(tmp,"length");
373        int cnt=atoi(len->value);
374        PyObject* value=PyList_New(cnt);
375        PyObject* mvalue=PyList_New(cnt);
376        PyObject* svalue=PyList_New(cnt);
377
378        for(int i=0;i<cnt;i++){
379         
380          map* vMap=getMapArray(tmp,"value",i);     
381          map* sMap=getMapArray(tmp,"size",i);
382
383          if(vMap!=NULL){
384           
385            PyObject* lvalue;
386            PyObject* lsvalue;
387            if(sMap==NULL){
388#if PY_MAJOR_VERSION >= 3
389              lvalue=PyUnicode_FromString(vMap->value);
390#else
391              lvalue=PyString_FromString(vMap->value);
392#endif
393              lsvalue=Py_None;
394            }
395            else{
396#if PY_MAJOR_VERSION >= 3
397              lvalue=PyUnicode_FromStringAndSize(vMap->value,atoi(sMap->value));
398              lsvalue=PyUnicode_FromString(sMap->value);
399#else
400              lvalue=PyString_FromStringAndSize(vMap->value,atoi(sMap->value));
401              lsvalue=PyString_FromString(sMap->value);
402#endif
403              hasSize=1;
404            }
405
406            if(PyList_SetItem(value,i,lvalue)<0){
407              fprintf(stderr,"Unable to set key value pair...");
408              return NULL;
409            } 
410            if(PyList_SetItem(svalue,i,lsvalue)<0){
411              fprintf(stderr,"Unable to set key value pair...");
412              return NULL;
413            } 
414          }
415         
416          map* mMap=getMapArray(tmp,tmap->name,i);
417          PyObject* lmvalue;
418          if(mMap!=NULL){
419#if PY_MAJOR_VERSION >= 3
420            lmvalue=PyUnicode_FromString(mMap->value);
421#else
422            lmvalue=PyString_FromString(mMap->value);
423#endif
424          }else
425            lmvalue=Py_None;
426         
427          if(PyList_SetItem(mvalue,i,lmvalue)<0){
428              fprintf(stderr,"Unable to set key value pair...");
429              return NULL;
430          } 
431         
432        }
433
434        if(PyDict_SetItem(res,name,value)<0){
435          fprintf(stderr,"Unable to set key value pair...");
436          return NULL;
437        }
438#if PY_MAJOR_VERSION >= 3
439        if(PyDict_SetItem(res,PyUnicode_FromString(tmap->name),mvalue)<0){
440#else
441        if(PyDict_SetItem(res,PyString_FromString(tmap->name),mvalue)<0){
442#endif
443          fprintf(stderr,"Unable to set key value pair...");
444          return NULL;
445        }
446        if(hasSize>0)
447#if PY_MAJOR_VERSION >= 3
448          if(PyDict_SetItem(res,PyUnicode_FromString("size"),svalue)<0){
449#else
450          if(PyDict_SetItem(res,PyString_FromString("size"),svalue)<0){
451#endif
452            fprintf(stderr,"Unable to set key value pair...");
453            return NULL;
454          }
455      }
456      else if(size!=NULL){
457        PyObject* value=
458#if PY_MAJOR_VERSION >= 3
459          PyUnicode_FromStringAndSize(tmp->value,atoi(size->value));
460#else
461          PyString_FromStringAndSize(tmp->value,atoi(size->value));
462#endif
463        if(PyDict_SetItem(res,name,value)<0){
464          fprintf(stderr,"Unable to set key value pair...");
465          return NULL;
466        }
467      }
468      else{
469        PyObject* value=
470#if PY_MAJOR_VERSION >= 3
471          PyUnicode_FromString(tmp->value);
472#else
473          PyString_FromString(tmp->value);
474#endif
475        if(PyDict_SetItem(res,name,value)<0){
476          fprintf(stderr,"Unable to set key value pair...");
477          return NULL;
478        }
479      }
480    }
481    else{
482      if(PyDict_GetItem(res,name)==NULL){
483        PyObject* value=
484#if PY_MAJOR_VERSION >= 3
485          PyUnicode_FromString(tmp->value);
486#else
487          PyString_FromString(tmp->value);
488#endif
489        if(PyDict_SetItem(res,name,value)<0){
490          fprintf(stderr,"Unable to set key value pair...");
491          return NULL;
492        }
493      }
494    }
495    Py_DECREF(name);
496    tmp=tmp->next;
497  }
498  return (PyDictObject*) res;
499}
500
501maps* mapsFromPyDict(PyDictObject* t){
502  maps* res=NULL;
503  maps* cursor=res;
504  PyObject* list=PyDict_Keys((PyObject*)t);
505  int nb=PyList_Size(list);
506  int i;
507  for(i=0;i<nb;i++){
508#ifdef DEBUG
509    fprintf(stderr,">> parsing maps %d\n",i);
510#endif
511    PyObject* key=PyList_GetItem(list,i);
512    PyObject* value=PyDict_GetItem((PyObject*)t,key);
513#ifdef DEBUG
514    fprintf(stderr,">> DEBUG VALUES : %s => %s\n",
515            PyString_AsString(key),PyString_AsString(value));
516#endif
517    cursor=(maps*)malloc(MAPS_SIZE);
518#if PY_MAJOR_VERSION >= 3
519    cursor->name=_PyUnicode_AsString(key);
520#else
521    cursor->name=PyString_AsString(key);
522#endif
523    cursor->content=mapFromPyDict((PyDictObject*)value);
524#ifdef DEBUG
525    dumpMap(cursor->content);
526#endif
527    cursor->next=NULL;
528    if(res==NULL)
529      res=dupMaps(&cursor);
530    else
531      addMapsToMaps(&res,cursor);
532    freeMap(&cursor->content);
533    free(cursor->content);
534    free(cursor);
535#ifdef DEBUG
536    dumpMaps(res);
537    fprintf(stderr,">> parsed maps %d\n",i);
538#endif
539  }
540  return res;
541}
542
543map* mapFromPyDict(PyDictObject* t){
544  map* res=NULL;
545  PyObject* list=PyDict_Keys((PyObject*)t);
546  int nb=PyList_Size(list);
547  int i;
548  for(i=0;i<nb;i++){
549    PyObject* key=PyList_GetItem(list,i);
550    PyObject* value=PyDict_GetItem((PyObject*)t,key);
551#ifdef DEBUG
552    fprintf(stderr,">> DEBUG VALUES : %s => %s\n",
553            PyString_AsString(key),PyString_AsString(value));
554#endif
555#if PY_MAJOR_VERSION >= 3
556    if(strcmp(_PyUnicode_AsString(key),"value")==0){
557#else
558    if(strcmp(PyString_AsString(key),"value")==0){
559#endif
560      char *buffer=NULL;
561      Py_ssize_t size;
562#if PY_MAJOR_VERSION >= 3
563      buffer=_PyUnicode_AsStringAndSize(value,&size);
564#else
565      PyString_AsStringAndSize(value,&buffer,&size);
566#endif
567      if(res!=NULL){
568#if PY_MAJOR_VERSION >= 3
569        addToMap(res,_PyUnicode_AsString(key),"");
570#else
571        addToMap(res,PyString_AsString(key),"");
572#endif
573      }else{
574#if PY_MAJOR_VERSION >= 3
575        res=createMap(_PyUnicode_AsString(key),"");
576#else
577        res=createMap(PyString_AsString(key),"");
578#endif
579      }
580      map* tmpR=getMap(res,"value");
581      free(tmpR->value);
582      tmpR->value=(char*)malloc((size+1)*sizeof(char));
583      memmove(tmpR->value,buffer,size*sizeof(char));
584      tmpR->value[size]=0;
585      char sin[1024];
586      sprintf(sin,"%d",size);
587      addToMap(res,"size",sin);
588    }else{
589      if(res!=NULL){
590        if(PyString_Size(value)>0)
591#if PY_MAJOR_VERSION >= 3
592          addToMap(res,_PyUnicode_AsString(key),_PyUnicode_AsString(value));
593#else
594          addToMap(res,PyString_AsString(key),PyString_AsString(value));
595#endif
596      }
597      else{
598        if(PyString_Size(value)>0)
599          res=
600#if PY_MAJOR_VERSION >= 3
601            createMap(_PyUnicode_AsString(key),_PyUnicode_AsString(value));
602#else
603            createMap(PyString_AsString(key),PyString_AsString(value));
604#endif
605      }
606    }
607  }
608  return res;
609}
610
611PyObject*
612PythonTranslate(PyObject* self, PyObject* args)
613{
614  char *str;
615  if (!PyArg_ParseTuple(args, "s", &str)){
616#ifdef DEBUG
617    fprintf(stderr,"Incorrect arguments to update status function");
618#endif
619    return NULL;
620  }
621#if PY_MAJOR_VERSION >= 3
622  return PyUnicode_FromString(_ss(str));
623#else
624  return PyString_FromString(_ss(str));
625#endif
626}
627
628PyObject*
629PythonUpdateStatus(PyObject* self, PyObject* args)
630{
631  maps* conf;
632  PyObject* confdict;
633  int istatus;
634  char* status;
635  if (!PyArg_ParseTuple(args, "O!i", &PyDict_Type, &confdict, &istatus)){
636#ifdef DEBUG
637    fprintf(stderr,"Incorrect arguments to update status function");
638#endif
639    return NULL;
640  }
641  if (istatus < 0 || istatus > 100){
642     PyErr_SetString(ZooError, "Status must be a percentage.");
643     return NULL;
644  }else{
645     char tmpStatus[4];
646     snprintf(tmpStatus, 4, "%i", istatus);
647     status = strdup(tmpStatus);
648  }
649  /* now update the map */
650  {
651    PyObject* lenv = PyMapping_GetItemString(confdict, "lenv");
652    if (lenv && PyMapping_Check(lenv)){
653      PyObject* valobj = 
654#if PY_MAJOR_VERSION >= 3
655        PyUnicode_FromString(status);
656#else
657        PyString_FromString(status);
658#endif
659      PyMapping_SetItemString(lenv, "status", valobj);
660      Py_DECREF(valobj);
661    }
662    Py_DECREF(lenv);
663  }
664  conf = mapsFromPyDict((PyDictObject*)confdict);
665  if (getMapFromMaps(conf,"lenv","status") != NULL){
666    fprintf(stderr,"STATUS RETURNED : %s\n",status);
667    if(status!=NULL){
668      setMapInMaps(conf,"lenv","status",status);
669      free(status);
670    }
671    else
672      setMapInMaps(conf,"lenv","status","15");
673    updateStatus(conf);
674  }
675  freeMaps(&conf);
676  free(conf);
677  Py_RETURN_NONE;
678}
Note: See TracBrowser for help on using the repository browser.

Search

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png