- Timestamp:
- Mar 28, 2013, 12:51:45 PM (12 years ago)
- Location:
- trunk/docs/services
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/docs/services/debug.txt
r398 r406 3 3 How To Debug ZOO Services 4 4 ========================= 5 6 :Authors: Luca Delucchi 7 :Last Updated: $Date: 2013-03-27 00:06:12 +0100 (Wed, 27 Mar 2013) $ 5 8 6 9 There are different ways to debug your services, the most used solutions are via web … … 32 35 sys.stderr.write("My message") 33 36 37 .. _web_javascript: 38 39 Javascript 40 ************ 41 42 You can user ``alert`` to print a string to the standard error. 43 44 .. code-block:: javascript 45 46 // add this line when you want see your message 47 alert('My message') 48 // you can debug value of inputs, outputs or conf 49 alert(inputs["S"]["value"]) 50 51 .. note:: If you try to pass an object it return only ``[object Object]`` 34 52 35 53 Command line … … 73 91 # add this line when you want investigate more in the code 74 92 pdb.set_trace() 93 94 Javascript 95 ************ 96 97 You can use ``alert`` also to print in the console, more info in the :ref:`web_javascript` web section -
trunk/docs/services/howtos.txt
r399 r406 4 4 ========================= 5 5 6 :Authors: Nicolas Bozon, Gérald Fenoy, Jeff McKenna 6 :Authors: Nicolas Bozon, Gérald Fenoy, Jeff McKenna, Luca Delucchi 7 7 :Last Updated: $Date$ 8 8 … … 19 19 ---------------------- 20 20 21 The function of the process for each programming language take three arguments: the main 22 configuration, inputs and outputs. 23 21 24 .. Note:: The service has to **return 3 if the process run successfully instead it 22 25 return 4** if the process end with an error. … … 40 43 Python 41 44 serviceProvider 42 The name of the Python module to use as a ZOO Service Provider. For instance, if your 43 script, located in the same directory as your ZOO Kernel, was named ``my_module.py`` then 44 you should use ``my_module`` (the Python module name) for the serviceProvider value in ZCFG file. 45 The name of the Python module to use as a ZOO Service Provider. For instance, if your 46 script, located in the same directory as your ZOO Kernel, was named ``my_module.py`` then 47 you should use ``my_module`` (the Python module name) for the serviceProvider value in ZCFG file. 45 48 46 49 Python Data Structure used 47 50 ************************** 48 49 The Python module's function to be used take three arguments: the main configuration, inputs and outputs. 50 All this values are passed to the Python module as dictionaries. 51 The three parameters of the function are passed to the Python module as dictionaries. 51 52 52 53 Following you'll find an example for each parameters … … 184 185 ---------- 185 186 187 ZOO API 188 ********* 189 190 If you need to use :ref:`ZOO API <api>` in your service, you have first to copy ``zoo-api.js`` 191 and ``zoo-proj4js.js`` where your services are located (for example in Unix system probably in 192 ``/usr/lib/cgi-bin/`` 193 194 Javascript ZCFG requirements 195 ********************************** 196 197 .. Note:: For each Service provided by your ZOO Javascript Services Provider, the ZCFG File 198 must be named the same as the Javascript function name (also the case of 199 characters is important). 200 201 The ZCFG file should contain the following : 202 203 serviceType 204 JS 205 serviceProvider 206 The name of the JavaScript file to use as a ZOO Service Provider. For instance, if your 207 script, located in the same directory as your ZOO Kernel, was named ``my_module.js`` then 208 you should use ``my_module.js``. 209 210 211 Javascript Data Structure used 212 ******************************** 213 214 The three parameters of the function are passed to the JavaScript function as Object. 215 216 Sample ZOO Javascript Services Provider 217 ****************************************** 218 186 219 .. code-block:: javascript 187 220 … … 192 225 return Array(3,outputs); 193 226 } 227
Note: See TracChangeset
for help on using the changeset viewer.