From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 758B91381F3 for ; Sun, 20 Oct 2013 14:38:58 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0F536E0BF4; Sun, 20 Oct 2013 14:38:54 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id ABAFDE0BF4 for ; Sun, 20 Oct 2013 14:38:53 +0000 (UTC) Received: from flycatcher.gentoo.org (flycatcher.gentoo.org [81.93.255.6]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C6E8B33E66D for ; Sun, 20 Oct 2013 14:38:49 +0000 (UTC) Received: by flycatcher.gentoo.org (Postfix, from userid 2238) id 83F432004C; Sun, 20 Oct 2013 14:38:48 +0000 (UTC) From: "Markos Chandras (hwoarang)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, hwoarang@gentoo.org Subject: [gentoo-commits] gentoo commit in src/gwn: gwn_adds_removes.py X-VCS-Repository: gentoo X-VCS-Files: gwn_adds_removes.py X-VCS-Directories: src/gwn X-VCS-Committer: hwoarang X-VCS-Committer-Name: Markos Chandras Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Message-Id: <20131020143848.83F432004C@flycatcher.gentoo.org> Date: Sun, 20 Oct 2013 14:38:48 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 8dff18ba-27fe-46f4-872b-edbe043c4d41 X-Archives-Hash: f306952b4315828cf358c4d3fd019ddf hwoarang 13/10/20 14:38:48 Modified: gwn_adds_removes.py Log: gwn_adds_removes.py: Add option to print results for the previous month Revision Changes Path 1.10 src/gwn/gwn_adds_removes.py file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gwn_adds_removes.py?rev=1.10&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gwn_adds_removes.py?rev=1.10&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gwn_adds_removes.py?r1=1.9&r2=1.10 Index: gwn_adds_removes.py =================================================================== RCS file: /var/cvsroot/gentoo/src/gwn/gwn_adds_removes.py,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- gwn_adds_removes.py 20 Oct 2013 12:01:59 -0000 1.9 +++ gwn_adds_removes.py 20 Oct 2013 14:38:48 -0000 1.10 @@ -52,11 +52,6 @@ def write(data, devs): - starttime = time.gmtime(time.time() - (60 * 60 * 24 * 1)) - endtime = time.gmtime(time.time() + (60 * 60 * 24 * 31)) - # Format the string to what we expect - date_to = time.strftime("%Y%m", endtime) - date_from = time.strftime("%Y%m", starttime) sections = {'added': 'Addition', 'removed': 'Removal'} for s in sections: if s == 'added': @@ -88,9 +83,25 @@ if __name__ == '__main__': data = [] if len(sys.argv) < 2: - print 'Usage: gwn_adds_removes.py ' + print 'Usage: gwn_adds_removes.py -p ' else: + if sys.argv[1] == "-p": + # Results for previous month! + starttime = time.gmtime(time.time() - (60 * 60 * 24 * 31)) + endtime = time.gmtime(time.time() + (60 * 60 * 24 * 1)) + # Format the string to what we expect + date_to = time.strftime("%Y%m", endtime) + date_from = time.strftime("%Y%m", starttime) + argrange = 1 + else: + starttime = time.gmtime(time.time() - (60 * 60 * 24 * 1)) + endtime = time.gmtime(time.time() + (60 * 60 * 24 * 31)) + # Format the string to what we expect + date_to = time.strftime("%Y%m", endtime) + date_from = time.strftime("%Y%m", starttime) + argrange = 0 + devs = developers() - for i in range(0, len(sys.argv)-1): + for i in range(argrange, len(sys.argv)-1): data.append(parse(sys.argv[i+1])) write(data, devs)