Changeset 451 for trunk/zoo-project/zoo-kernel/service_internal_python.c
- Timestamp:
- Jan 6, 2014, 11:09:29 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/service_internal_python.c
r411 r451 113 113 114 114 int zoo_python_support(maps** main_conf,map* request,service* s,maps **real_inputs,maps **real_outputs){ 115 char *pythonpath; 116 char *python_path; 115 117 maps* m=*main_conf; 116 118 maps* inputs=*real_inputs; … … 119 121 char *ntmp=tmp0->value; 120 122 map* tmp=NULL; 123 int hasToClean=0; 121 124 tmp=getMapFromMaps(*main_conf,"env","PYTHONPATH"); 122 char *python_path;123 125 #ifdef DEBUG 124 126 fprintf(stderr,"PYTHON SUPPORT \n"); 125 127 #endif 126 fflush(stderr);127 128 if(tmp!=NULL){ 128 129 #ifdef DEBUG … … 131 132 python_path=(char*)malloc((strlen(tmp->value))*sizeof(char)); 132 133 sprintf(python_path,"%s",tmp->value); 134 hasToClean=1; 133 135 } 134 136 else{ 135 python_path= strdup(".");137 python_path="."; 136 138 } 137 139 tmp=NULL; 138 140 tmp=getMap(request,"metapath"); 139 char *pythonpath;//=(char*)malloc((1+strlen(python_path)+2048)*sizeof(char));140 141 if(tmp!=NULL && strcmp(tmp->value,"")!=0){ 141 142 pythonpath=(char*)malloc((4+strlen(python_path)+strlen(ntmp)+strlen(tmp->value))*sizeof(char)); 142 143 #ifdef WIN32 143 144 #else 145 144 sprintf(pythonpath,"%s/%s/;%s",ntmp,tmp->value,python_path); 145 #else 146 sprintf(pythonpath,"%s/%s/:%s",ntmp,tmp->value,python_path); 146 147 #endif 147 148 } … … 164 165 sprintf(toto,"PYTHONPATH=%s",pythonpath); 165 166 putenv(toto); 166 #endif 167 free(python_path); 167 free(toto); 168 #endif 169 if(hasToClean>0) 170 free(python_path); 168 171 free(pythonpath); 169 172
Note: See TracChangeset
for help on using the changeset viewer.