File tree 4 files changed +11
-6
lines changed 4 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 7
7
for row in spamreader :
8
8
# reduce(row, lambda x: x[4])
9
9
#print row[4]
10
-
11
10
a .append (row )
12
11
pass
13
12
from pprint import pprint
Original file line number Diff line number Diff line change 18
18
res = []
19
19
20
20
for i in a :
21
-
22
21
k = i [0 ].split (' ' )[0 ]
23
-
24
22
if k != sliding_shit :
25
23
sliding_shit = k
26
24
res .append (0 )
27
25
28
26
res [len (res )- 1 ]+= float (i [3 ])
29
27
30
28
res = map (lambda x : round (x * 100 )/ 100.0 , res )
31
- res = map (lambda x : x * 30 , res )
29
+ res = map (lambda x : x * 30 * 24 / 1000 , res )
32
30
print json .dumps (res )
33
31
34
32
#for line in sys.stdin:
Original file line number Diff line number Diff line change @@ -50,6 +50,11 @@ def exec_cmd(cmd):
50
50
sys .exit ()
51
51
52
52
cords = our_entry ['geometry' ]['location' ]
53
+
54
+ if sys .argv [2 ] == 'sunshine' :
55
+
56
+ sys .exit ()
57
+
53
58
#pprint(our_entry)
54
59
#url="http://solarview.niwa.co.nz/createImage?latitude=%f&longitude=%f&azimuth_angle=&zenith_angle=&image_title=Address+unknown" % (cords['lat'],cords['lng'])
55
60
Original file line number Diff line number Diff line change 3
3
4
4
$ period = $ _REQUEST ['period ' ];
5
5
$ address = $ _REQUEST ['address ' ];
6
+ $ sunshine = $ _REQUEST ['sunshine ' ];
6
7
$ PWD = __DIR__ ;
7
8
header ('Content-Type: application/json ' );
8
9
9
10
$ address = escapeshellcmd ($ address );
10
11
11
12
if ($ period == 'month ' ) {
12
- echo shell_exec ("python $ PWD /get_csv.py ' " .$ address . "'| xargs curl -s | python $ PWD /data_reduce_month.py " );
13
+ echo shell_exec ("python $ PWD /get_csv.py ' " .$ address . "' | xargs curl -s | python $ PWD /data_reduce_month.py " );
13
14
} else if ($ period == 'year ' ) {
14
- echo shell_exec ("python $ PWD /get_csv.py ' " .$ address . "'| xargs curl -s | python $ PWD /data_reduce.py " );
15
+ echo shell_exec ("python $ PWD /get_csv.py ' " .$ address . "' | xargs curl -s | python $ PWD /data_reduce.py " );
16
+ } else if ($ sunshine == 1 ) {
17
+ echo shell_exec ("python $ PWD /get_csv.py ' " .$ address . "' sunshine " );
15
18
} else {
16
19
echo json_encode (['error ' => 'wrong period ' ]);
17
20
}
You can’t perform that action at this time.
0 commit comments