@@ -8,27 +8,27 @@ var _ = require("lodash"),
88/**
99 *
1010 * Convert to variables
11- *
11+ *
1212 * @param {Object } variables
1313 * @return {Array }
14- *
14+ *
1515 */
1616var toVariables = function ( variables ) {
1717
1818 variables = variables || { } ;
19-
19+
2020 var vars = [ ] ;
2121 _ . each ( variables , function ( value , name ) {
22-
22+
2323 if ( typeof ( value ) == "number" ) {
24- vars . push (
25- _ . template ( "<%= name %> = <%= value %>" , { name : name , value : value } ) ) ;
24+ vars . push (
25+ _ . template ( "<%= name %> = <%= value %>" , { name : name , value : value } ) ) ;
2626 }
2727 else {
28- vars . push (
28+ vars . push (
2929 _ . template ( "<%= name %> = '<%= value %>'" , { name : name , value : value } ) ) ;
3030 }
31-
31+
3232 } ) ;
3333
3434 return vars ;
@@ -37,28 +37,28 @@ var toVariables = function(variables){
3737
3838/**
3939 *
40- * Manages the execution of the python process. Once the code is executed the
40+ * Manages the execution of the python process. Once the code is executed the
4141 * promise is resolved with the stdout of the process.
4242 *
4343 * @param {String } code
4444 * @param {Object } options
45- *
45+ *
4646 * @return {Promise }
47- *
47+ *
4848 */
4949var exec = function ( code , options ) {
5050
5151 options = options || { } ;
5252 options . bin = options . bin || "python" ;
5353 options . vars = options . vars || { } ;
5454 options . env = _ . extend ( { } ,
55- process . env ,
5655 {
5756 /// set the env PYTHONPATH
5857 PYTHONPATH : ""
59- } ,
58+ } ,
59+ process . env ,
6060 options . env ) ;
61-
61+
6262
6363 var dfd = Q . defer ( ) ,
6464 output = [ ] ;
@@ -79,7 +79,7 @@ var exec = function(code, options){
7979 python . stderr . on ( 'data' , function ( data ) {
8080 dfd . reject ( data . toString ( ) ) ;
8181 } ) ;
82-
82+
8383 python . stdout . on ( 'close' , function ( code ) {
8484
8585 var result = output . join ( ) . trim ( ) ;
0 commit comments