static PyObject *PyCMOR_setup(PyObject * self, PyObject * args) { signal(signal_to_catch, signal_handler); int mode, ierr, netcdf, verbosity, createsub; char *path; char *logfile; if (!PyArg_ParseTuple (args, "siiisi", &path, &netcdf, &verbosity, &mode, &logfile, &createsub)) return NULL; if (strcmp(logfile, "") == 0) { ierr = cmor_setup(path, &netcdf, &verbosity, &mode, NULL, &createsub); } else { ierr = cmor_setup(path, &netcdf, &verbosity, &mode, logfile, &createsub); } if (ierr != 0 || raise_exception) { raise_exception = 0; PyErr_Format(CMORError, exception_message, "setup"); return NULL; } return (Py_BuildValue("i", ierr)); }
static PyObject * PyCMOR_setup(PyObject *self,PyObject *args) { int mode,ierr,netcdf,verbosity,createsub; char *path; char *logfile; if (!PyArg_ParseTuple(args,"siiisi",&path,&netcdf,&verbosity,&mode,&logfile,&createsub)) return NULL; if (strcmp(logfile,"")==0) { ierr = cmor_setup(path,&netcdf,&verbosity,&mode,NULL,&createsub); } else { ierr = cmor_setup(path,&netcdf,&verbosity,&mode,logfile,&createsub); } if (ierr != 0 ) return NULL; /* Return NULL Python Object */ Py_INCREF(Py_None); return Py_None; }