1 |
hwoarang 13/12/30 10:45:58 |
2 |
|
3 |
Modified: get_portage_stats.py |
4 |
Log: |
5 |
get_portage_stats.py: Add img line to output |
6 |
|
7 |
Revision Changes Path |
8 |
1.4 src/gwn/get_portage_stats.py |
9 |
|
10 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/get_portage_stats.py?rev=1.4&view=markup |
11 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/get_portage_stats.py?rev=1.4&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/get_portage_stats.py?r1=1.3&r2=1.4 |
13 |
|
14 |
Index: get_portage_stats.py |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo/src/gwn/get_portage_stats.py,v |
17 |
retrieving revision 1.3 |
18 |
retrieving revision 1.4 |
19 |
diff -u -r1.3 -r1.4 |
20 |
--- get_portage_stats.py 13 Oct 2013 09:37:50 -0000 1.3 |
21 |
+++ get_portage_stats.py 30 Dec 2013 10:45:58 -0000 1.4 |
22 |
@@ -1,5 +1,9 @@ |
23 |
#!/usr/bin/env python |
24 |
-import os |
25 |
+import os, time |
26 |
+ |
27 |
+endtime = time.gmtime(time.time()) |
28 |
+datefor = time.strftime("%Y/%m", endtime) |
29 |
+dateimg = time.strftime("%Y-%m", endtime) |
30 |
|
31 |
arch = [ |
32 |
'alpha', |
33 |
@@ -59,6 +63,7 @@ |
34 |
f.close() |
35 |
os.remove("pkgstats.txt") |
36 |
|
37 |
+print "<h1>Portage</h1>" |
38 |
print "This section summarizes the current state of the portage tree.\n" |
39 |
|
40 |
print "[table th=\"0\"]" |
41 |
@@ -88,9 +93,15 @@ |
42 |
if i != len(svals) - 1: |
43 |
string1 += ',' |
44 |
string2 += ',' |
45 |
+ |
46 |
+print """<p style="text-align: center"><img class=" wp-image-216 aligncenter" |
47 |
+style="line-height: 24px" alt="gmn-portage-stats-2013-11" |
48 |
+src="http://blogs.gentoo.org/news/files/%s/gmn-portage-stats-%s.png" |
49 |
+width="800" height="350" /></p> |
50 |
+""" % (datefor, dateimg) |
51 |
#print string1 |
52 |
#print string2 |
53 |
-print "\n== Chart URL == \n" |
54 |
+print "\n== Chart URL == (save it as \"gmn-portage-stats-%s.png\")\n\n" %dateimg |
55 |
base = 'http://chart.apis.google.com/chart?cht=bhs&chs=800x350&chd=t:' |
56 |
tail = '&chco=45347B,6A5C95&chbh=15&chxt=x,y&chxr=0,0,12250&chdl=Stable|Testing' |
57 |
labx = '&chxl=0:1000|1000|1000|1000|1000|1000|1000|1000|1000|1000|1000|1000|1000|1000|1000|' |