Gentoo Archives: gentoo-commits

From: "David Abbott (dabbott)" <dabbott@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in src/gwn: gwn_adds_removes.py
Date: Sun, 03 Aug 2014 21:14:45
Message-Id: 20140803211440.07BFF2004E@flycatcher.gentoo.org
1 dabbott 14/08/03 21:14:38
2
3 Modified: gwn_adds_removes.py
4 Log:
5 removed the -p option and the cmp dates, we don't need for monthly
6
7 Revision Changes Path
8 1.14 src/gwn/gwn_adds_removes.py
9
10 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gwn_adds_removes.py?rev=1.14&view=markup
11 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gwn_adds_removes.py?rev=1.14&content-type=text/plain
12 diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gwn_adds_removes.py?r1=1.13&r2=1.14
13
14 Index: gwn_adds_removes.py
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo/src/gwn/gwn_adds_removes.py,v
17 retrieving revision 1.13
18 retrieving revision 1.14
19 diff -u -r1.13 -r1.14
20 --- gwn_adds_removes.py 5 Apr 2014 17:45:36 -0000 1.13
21 +++ gwn_adds_removes.py 3 Aug 2014 21:14:38 -0000 1.14
22 @@ -80,15 +80,11 @@
23 ldata = (ATTIC_LINK % pkg[0], '/'.join(pkg[0]))
24 #who = (devs[pkg[1]].encode(OUTPUT_CHARSET), pkg[1])
25 who = devs[pkg[1]]
26 - # clean date format so we can compare it with
27 - # date_to/date_from
28 - when_cmp = pkg[2].strftime('%Y%m')
29 # date format suitable for GMN posts
30 when = pkg[2].strftime('%d %b %Y')
31 # You should copy this to the raw html code in the
32 # blog post
33 - if when_cmp >=date_from and when_cmp < date_to:
34 - print '<a href="%s">%s</a>, %s, %s' % (ldata[0], ldata[1], who, when)
35 + print '<a href="%s">%s</a>, %s, %s' % (ldata[0], ldata[1], who, when)
36 print "[/table]"
37
38 if __name__ == '__main__':
39 @@ -96,25 +92,9 @@
40 remove_profile_line(sys.argv[i+1])
41 data = []
42 if len(sys.argv) < 2:
43 - print 'Usage: gwn_adds_removes.py -p <log-files>'
44 + print 'Usage: gwn_adds_removes.py <log-files>'
45 else:
46 - if sys.argv[1] == "-p":
47 - # Results for previous month!
48 - starttime = time.gmtime(time.time() - (60 * 60 * 24 * 31))
49 - endtime = time.gmtime(time.time() + (60 * 60 * 24 * 1))
50 - # Format the string to what we expect
51 - date_to = time.strftime("%Y%m", endtime)
52 - date_from = time.strftime("%Y%m", starttime)
53 - argrange = 1
54 - else:
55 - starttime = time.gmtime(time.time() - (60 * 60 * 24 * 1))
56 - endtime = time.gmtime(time.time() + (60 * 60 * 24 * 31))
57 - # Format the string to what we expect
58 - date_to = time.strftime("%Y%m", endtime)
59 - date_from = time.strftime("%Y%m", starttime)
60 - argrange = 0
61 -
62 - devs = developers()
63 - for i in range(argrange, len(sys.argv)-1):
64 + devs = developers()
65 + for i in range(0, len(sys.argv)-1):
66 data.append(parse(sys.argv[i+1]))
67 write(data, devs)