public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo commit in src/gwn: gwn_adds_removes.py
@ 2007-11-14 18:45 Chris Gianelloni (wolf31o2)
  0 siblings, 0 replies; 13+ messages in thread
From: Chris Gianelloni (wolf31o2) @ 2007-11-14 18:45 UTC (permalink / raw
  To: gentoo-commits

wolf31o2    07/11/14 18:45:27

  Modified:             gwn_adds_removes.py
  Log:
  Updated to output in the new packages layout.

Revision  Changes    Path
1.3                  src/gwn/gwn_adds_removes.py

file : http://sources.gentoo.org/viewcvs.py/gentoo/src/gwn/gwn_adds_removes.py?rev=1.3&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/gwn/gwn_adds_removes.py?rev=1.3&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo/src/gwn/gwn_adds_removes.py?r1=1.2&r2=1.3

Index: gwn_adds_removes.py
===================================================================
RCS file: /var/cvsroot/gentoo/src/gwn/gwn_adds_removes.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- gwn_adds_removes.py	26 Feb 2007 01:22:39 -0000	1.2
+++ gwn_adds_removes.py	14 Nov 2007 18:45:27 -0000	1.3
@@ -3,7 +3,7 @@
 from datetime import datetime
 
 DEV_LIST = 'http://www.gentoo.org/proj/en/devrel/roll-call/userinfo.xml'
-PACKAGE_LINK = 'http://packages.gentoo.org/packages/?category=%s;name=%s'
+PACKAGE_LINK = 'http://packages.gentoo.org/package/%s/%s'
 ATTIC_LINK = 'http://sources.gentoo.org/viewcvs.py/gentoo-x86/%s/%s/?hideattic=0'
 OUTPUT_CHARSET = 'utf-8'
 



-- 
gentoo-commits@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 13+ messages in thread

* [gentoo-commits] gentoo commit in src/gwn: gwn_adds_removes.py
@ 2008-03-15 11:07 Anant Narayanan (anant)
  0 siblings, 0 replies; 13+ messages in thread
From: Anant Narayanan (anant) @ 2008-03-15 11:07 UTC (permalink / raw
  To: gentoo-commits

anant       08/03/15 11:07:15

  Modified:             gwn_adds_removes.py
  Log:
  Modify script to cope with new userinfo.xml layout

Revision  Changes    Path
1.4                  src/gwn/gwn_adds_removes.py

file : http://sources.gentoo.org/viewcvs.py/gentoo/src/gwn/gwn_adds_removes.py?rev=1.4&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/gwn/gwn_adds_removes.py?rev=1.4&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo/src/gwn/gwn_adds_removes.py?r1=1.3&r2=1.4

Index: gwn_adds_removes.py
===================================================================
RCS file: /var/cvsroot/gentoo/src/gwn/gwn_adds_removes.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- gwn_adds_removes.py	14 Nov 2007 18:45:27 -0000	1.3
+++ gwn_adds_removes.py	15 Mar 2008 11:07:13 -0000	1.4
@@ -45,8 +45,9 @@
 	devs = {}
 	
 	for i in rows[1:]:
+		ths = i.xpathEval('th/b')
 		tds = i.xpathEval('td')
-		devs[tds[0].content] = tds[1].content.decode('utf-8')
+		devs[ths[0].content] = tds[0].content.decode('utf-8')
 	
 	doc.freeDoc()
 	return devs
@@ -102,5 +103,6 @@
 	else:
 		data = parse(sys.argv[1])
 		devs = developers()
+		print devs
 		attic = len(sys.argv) == 3 and sys.argv[2] == '--attic'
 		write(data, devs, attic)



-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 13+ messages in thread

* [gentoo-commits] gentoo commit in src/gwn: gwn_adds_removes.py
@ 2008-03-15 11:09 Anant Narayanan (anant)
  0 siblings, 0 replies; 13+ messages in thread
From: Anant Narayanan (anant) @ 2008-03-15 11:09 UTC (permalink / raw
  To: gentoo-commits

anant       08/03/15 11:09:48

  Modified:             gwn_adds_removes.py
  Log:
  Suppress extra print

Revision  Changes    Path
1.5                  src/gwn/gwn_adds_removes.py

file : http://sources.gentoo.org/viewcvs.py/gentoo/src/gwn/gwn_adds_removes.py?rev=1.5&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/gwn/gwn_adds_removes.py?rev=1.5&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo/src/gwn/gwn_adds_removes.py?r1=1.4&r2=1.5

Index: gwn_adds_removes.py
===================================================================
RCS file: /var/cvsroot/gentoo/src/gwn/gwn_adds_removes.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- gwn_adds_removes.py	15 Mar 2008 11:07:13 -0000	1.4
+++ gwn_adds_removes.py	15 Mar 2008 11:09:47 -0000	1.5
@@ -103,6 +103,5 @@
 	else:
 		data = parse(sys.argv[1])
 		devs = developers()
-		print devs
 		attic = len(sys.argv) == 3 and sys.argv[2] == '--attic'
 		write(data, devs, attic)



-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 13+ messages in thread

* [gentoo-commits] gentoo commit in src/gwn: gwn_adds_removes.py
@ 2013-10-05 15:15 Markos Chandras (hwoarang)
  0 siblings, 0 replies; 13+ messages in thread
From: Markos Chandras (hwoarang) @ 2013-10-05 15:15 UTC (permalink / raw
  To: gentoo-commits

hwoarang    13/10/05 15:15:41

  Modified:             gwn_adds_removes.py
  Log:
  gwn_adds_removes.py: Update and clean up
  
  Move away from GuideXML specific code and remove noise.
  Fix a couple of prolems with parsing the list of developers and drop
  the --attic option. We will always use hyperlinks even for dead packages

Revision  Changes    Path
1.6                  src/gwn/gwn_adds_removes.py

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gwn_adds_removes.py?rev=1.6&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gwn_adds_removes.py?rev=1.6&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gwn_adds_removes.py?r1=1.5&r2=1.6

Index: gwn_adds_removes.py
===================================================================
RCS file: /var/cvsroot/gentoo/src/gwn/gwn_adds_removes.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- gwn_adds_removes.py	15 Mar 2008 11:09:47 -0000	1.5
+++ gwn_adds_removes.py	5 Oct 2013 15:15:41 -0000	1.6
@@ -8,9 +8,9 @@
 OUTPUT_CHARSET = 'utf-8'
 
 def parse(logfile):
-	
+
 	# Read the log file
-	
+
 	pkgs = {'added': [], 'removed': []}
 	log = open(logfile)
 	for i in log:
@@ -24,9 +24,9 @@
 		else:
 			cur.append(i)
 	log.close()
-	
+
 	# Parse the information
-	
+
 	for op in ('added', 'removed'):
 		for idx, pkg in enumerate(pkgs[op]):
 			pkg = pkg.split(',')
@@ -34,74 +34,46 @@
 			dev = pkg[2]
 			dt = datetime(*(time.strptime(pkg[3], '%Y-%m-%d %H:%M:%S')[0:6]))
 			pkgs[op][idx] = (cp, dev, dt)
-	
+
 	return pkgs
 
 def developers():
-	
+
 	html = urllib2.urlopen(DEV_LIST).read()
 	doc = libxml2.htmlParseDoc(html, 'utf-8')
 	rows = doc.xpathEval('//table[@class = "ntable"]/tr')
 	devs = {}
-	
+
 	for i in rows[1:]:
-		ths = i.xpathEval('th/b')
 		tds = i.xpathEval('td')
-		devs[ths[0].content] = tds[0].content.decode('utf-8')
-	
+		devs[tds[0].content] = tds[0].content.decode('utf-8')
+
 	doc.freeDoc()
 	return devs
-	
 
-def write(data, devs, attic=False):
-	
+
+def write(data, devs):
+
 	sections = {'added': 'Addition', 'removed': 'Removal'}
 	for s in sections:
-		
-		print '<section>'
-		print '<title>%s:</title>' % (sections[s] + 's')
-		print '<body>'
-		print ''
-		
-		print '<table>'
-		print ''
-		print '<tr>'
-		print '<th>Package:</th>'
-		print '<th>%s date:</th>' % sections[s]
-		print '<th>Contact:</th>'
-		print '</tr>'
-		print ''
-		
 		for pkg in data[s]:
-			print '<tr>'
 			ldata = (PACKAGE_LINK % pkg[0], '/'.join(pkg[0]))
 			if s == 'added':
-				print '<ti><uri link="%s">%s</uri></ti>' % ldata
+				what = "added"
 			else:
-				if attic:
-					ldata = (ATTIC_LINK % pkg[0], '/'.join(pkg[0]))
-					print '<ti><uri link="%s">%s</uri></ti>' % ldata
-				else:
-					print '<ti>%s</ti>' % ldata[1]
-			print '<ti>%s</ti>' % pkg[2].strftime('%d %b %Y')
-			mdata = (pkg[1], devs[pkg[1]].encode(OUTPUT_CHARSET))
-			print '<ti><mail link="%s@gentoo.org">%s</mail></ti>' % mdata
-			print '</tr>'
-			print ''
-		
-		print '</table>'
-		print ''
-		
-		print '</body>'
-		print '</section>'
-		print ''
-
+				what = "removed"
+				ldata = (ATTIC_LINK % pkg[0], '/'.join(pkg[0]))
+			#who = (devs[pkg[1]].encode(OUTPUT_CHARSET), pkg[1])
+			who = devs[pkg[1]]
+			when = pkg[2].strftime('%d %b %Y')
+			# You should copy this to the raw html code in the
+			# blog post
+			print '<a href="%s">%s</a> %s by %s on %s' % (ldata[0], ldata[1], what, who,when)
 
 if __name__ == '__main__':
-	if len(sys.argv) < 2 or len(sys.argv) > 3:
-		print 'Usage: gwn_adds_removes.py <log-file> [--attic]'
+	if len(sys.argv) != 2:
+		print 'Usage: gwn_adds_removes.py <log-file>'
 	else:
 		data = parse(sys.argv[1])
 		devs = developers()
-		attic = len(sys.argv) == 3 and sys.argv[2] == '--attic'
-		write(data, devs, attic)
+		write(data, devs)





^ permalink raw reply	[flat|nested] 13+ messages in thread

* [gentoo-commits] gentoo commit in src/gwn: gwn_adds_removes.py
@ 2013-10-16 18:01 Markos Chandras (hwoarang)
  0 siblings, 0 replies; 13+ messages in thread
From: Markos Chandras (hwoarang) @ 2013-10-16 18:01 UTC (permalink / raw
  To: gentoo-commits

hwoarang    13/10/16 18:01:28

  Modified:             gwn_adds_removes.py
  Log:
  gwn_adds_removes.py: Accept a list of log files
  
  gwn_adds_removes.py was designed to accept a single log file because it was
  only used in GWN. We will use it in GMN so we need to parse more than one
  file

Revision  Changes    Path
1.7                  src/gwn/gwn_adds_removes.py

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gwn_adds_removes.py?rev=1.7&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gwn_adds_removes.py?rev=1.7&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gwn_adds_removes.py?r1=1.6&r2=1.7

Index: gwn_adds_removes.py
===================================================================
RCS file: /var/cvsroot/gentoo/src/gwn/gwn_adds_removes.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- gwn_adds_removes.py	5 Oct 2013 15:15:41 -0000	1.6
+++ gwn_adds_removes.py	16 Oct 2013 18:01:28 -0000	1.7
@@ -10,7 +10,7 @@
 def parse(logfile):
 
 	# Read the log file
-
+	cur = []
 	pkgs = {'added': [], 'removed': []}
 	log = open(logfile)
 	for i in log:
@@ -34,7 +34,6 @@
 			dev = pkg[2]
 			dt = datetime(*(time.strptime(pkg[3], '%Y-%m-%d %H:%M:%S')[0:6]))
 			pkgs[op][idx] = (cp, dev, dt)
-
 	return pkgs
 
 def developers():
@@ -55,25 +54,28 @@
 def write(data, devs):
 
 	sections = {'added': 'Addition', 'removed': 'Removal'}
-	for s in sections:
-		for pkg in data[s]:
-			ldata = (PACKAGE_LINK % pkg[0], '/'.join(pkg[0]))
-			if s == 'added':
-				what = "added"
-			else:
-				what = "removed"
-				ldata = (ATTIC_LINK % pkg[0], '/'.join(pkg[0]))
-			#who = (devs[pkg[1]].encode(OUTPUT_CHARSET), pkg[1])
-			who = devs[pkg[1]]
-			when = pkg[2].strftime('%d %b %Y')
-			# You should copy this to the raw html code in the
-			# blog post
-			print '<a href="%s">%s</a> %s by %s on %s' % (ldata[0], ldata[1], what, who,when)
+	for datafile in data:
+		for s in sections:
+			for pkg in datafile[s]:
+				ldata = (PACKAGE_LINK % pkg[0], '/'.join(pkg[0]))
+				if s == 'added':
+					what = "added"
+				else:
+					what = "removed"
+					ldata = (ATTIC_LINK % pkg[0], '/'.join(pkg[0]))
+				#who = (devs[pkg[1]].encode(OUTPUT_CHARSET), pkg[1])
+				who = devs[pkg[1]]
+				when = pkg[2].strftime('%d %b %Y')
+				# You should copy this to the raw html code in the
+				# blog post
+				print '<a href="%s">%s</a> %s by %s on %s' % (ldata[0], ldata[1], what, who,when)
 
 if __name__ == '__main__':
-	if len(sys.argv) != 2:
-		print 'Usage: gwn_adds_removes.py <log-file>'
+	data = []
+	if len(sys.argv) < 2:
+		print 'Usage: gwn_adds_removes.py <log-files>'
 	else:
-		data = parse(sys.argv[1])
 		devs = developers()
+		for i in range(0, len(sys.argv)-1):
+			data.append(parse(sys.argv[i+1]))
 		write(data, devs)





^ permalink raw reply	[flat|nested] 13+ messages in thread

* [gentoo-commits] gentoo commit in src/gwn: gwn_adds_removes.py
@ 2013-10-16 18:10 Markos Chandras (hwoarang)
  0 siblings, 0 replies; 13+ messages in thread
From: Markos Chandras (hwoarang) @ 2013-10-16 18:10 UTC (permalink / raw
  To: gentoo-commits

hwoarang    13/10/16 18:10:16

  Modified:             gwn_adds_removes.py
  Log:
  gwn_adds_removes.py: Print output compatible for WP table entries

Revision  Changes    Path
1.8                  src/gwn/gwn_adds_removes.py

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gwn_adds_removes.py?rev=1.8&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gwn_adds_removes.py?rev=1.8&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gwn_adds_removes.py?r1=1.7&r2=1.8

Index: gwn_adds_removes.py
===================================================================
RCS file: /var/cvsroot/gentoo/src/gwn/gwn_adds_removes.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- gwn_adds_removes.py	16 Oct 2013 18:01:28 -0000	1.7
+++ gwn_adds_removes.py	16 Oct 2013 18:10:16 -0000	1.8
@@ -54,21 +54,27 @@
 def write(data, devs):
 
 	sections = {'added': 'Addition', 'removed': 'Removal'}
-	for datafile in data:
-		for s in sections:
+	for s in sections:
+		if s == 'added':
+			print "<h2>Additions</h2>"
+			print "[table]"
+			print "Package, Developer, Date"
+		else:
+			print "<h2>Removals</h2>"
+			print "[table]"
+			print "Package, Developer, Date"
+		for datafile in data:
 			for pkg in datafile[s]:
 				ldata = (PACKAGE_LINK % pkg[0], '/'.join(pkg[0]))
-				if s == 'added':
-					what = "added"
-				else:
-					what = "removed"
+				if s == 'removeld':
 					ldata = (ATTIC_LINK % pkg[0], '/'.join(pkg[0]))
 				#who = (devs[pkg[1]].encode(OUTPUT_CHARSET), pkg[1])
 				who = devs[pkg[1]]
 				when = pkg[2].strftime('%d %b %Y')
 				# You should copy this to the raw html code in the
 				# blog post
-				print '<a href="%s">%s</a> %s by %s on %s' % (ldata[0], ldata[1], what, who,when)
+				print '<a href="%s">%s</a>, %s, %s' % (ldata[0], ldata[1], who, when)
+		print "[/table]"
 
 if __name__ == '__main__':
 	data = []





^ permalink raw reply	[flat|nested] 13+ messages in thread

* [gentoo-commits] gentoo commit in src/gwn: gwn_adds_removes.py
@ 2013-10-20 12:01 Markos Chandras (hwoarang)
  0 siblings, 0 replies; 13+ messages in thread
From: Markos Chandras (hwoarang) @ 2013-10-20 12:01 UTC (permalink / raw
  To: gentoo-commits

hwoarang    13/10/20 12:01:59

  Modified:             gwn_adds_removes.py
  Log:
  gwn_adds_removes.py: Print adds/removes only for current month
  
  The start/end of the month may not align to weekly boundaries so we need to
  make sure only get results for the current month

Revision  Changes    Path
1.9                  src/gwn/gwn_adds_removes.py

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gwn_adds_removes.py?rev=1.9&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gwn_adds_removes.py?rev=1.9&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gwn_adds_removes.py?r1=1.8&r2=1.9

Index: gwn_adds_removes.py
===================================================================
RCS file: /var/cvsroot/gentoo/src/gwn/gwn_adds_removes.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- gwn_adds_removes.py	16 Oct 2013 18:10:16 -0000	1.8
+++ gwn_adds_removes.py	20 Oct 2013 12:01:59 -0000	1.9
@@ -52,7 +52,11 @@
 
 
 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':
@@ -70,10 +74,15 @@
 					ldata = (ATTIC_LINK % pkg[0], '/'.join(pkg[0]))
 				#who = (devs[pkg[1]].encode(OUTPUT_CHARSET), pkg[1])
 				who = devs[pkg[1]]
+				# clean date format so we can compare it with
+				# date_to/date_from
+				when_cmp = pkg[2].strftime('%Y%m')
+				# date format suitable for GMN posts
 				when = pkg[2].strftime('%d %b %Y')
 				# You should copy this to the raw html code in the
 				# blog post
-				print '<a href="%s">%s</a>, %s, %s' % (ldata[0], ldata[1], who, when)
+				if when_cmp >=date_from and when_cmp < date_to:
+					print '<a href="%s">%s</a>, %s, %s' % (ldata[0], ldata[1], who, when)
 		print "[/table]"
 
 if __name__ == '__main__':





^ permalink raw reply	[flat|nested] 13+ messages in thread

* [gentoo-commits] gentoo commit in src/gwn: gwn_adds_removes.py
@ 2013-10-20 14:38 Markos Chandras (hwoarang)
  0 siblings, 0 replies; 13+ messages in thread
From: Markos Chandras (hwoarang) @ 2013-10-20 14:38 UTC (permalink / raw
  To: gentoo-commits

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 <log-files>'
+		print 'Usage: gwn_adds_removes.py -p <log-files>'
 	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)





^ permalink raw reply	[flat|nested] 13+ messages in thread

* [gentoo-commits] gentoo commit in src/gwn: gwn_adds_removes.py
@ 2013-10-31 17:42 Markos Chandras (hwoarang)
  0 siblings, 0 replies; 13+ messages in thread
From: Markos Chandras (hwoarang) @ 2013-10-31 17:42 UTC (permalink / raw
  To: gentoo-commits

hwoarang    13/10/31 17:42:49

  Modified:             gwn_adds_removes.py
  Log:
  gwn_adds_removes.py: Typo

Revision  Changes    Path
1.11                 src/gwn/gwn_adds_removes.py

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gwn_adds_removes.py?rev=1.11&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gwn_adds_removes.py?rev=1.11&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gwn_adds_removes.py?r1=1.10&r2=1.11

Index: gwn_adds_removes.py
===================================================================
RCS file: /var/cvsroot/gentoo/src/gwn/gwn_adds_removes.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- gwn_adds_removes.py	20 Oct 2013 14:38:48 -0000	1.10
+++ gwn_adds_removes.py	31 Oct 2013 17:42:49 -0000	1.11
@@ -65,7 +65,7 @@
 		for datafile in data:
 			for pkg in datafile[s]:
 				ldata = (PACKAGE_LINK % pkg[0], '/'.join(pkg[0]))
-				if s == 'removeld':
+				if s == 'removed':
 					ldata = (ATTIC_LINK % pkg[0], '/'.join(pkg[0]))
 				#who = (devs[pkg[1]].encode(OUTPUT_CHARSET), pkg[1])
 				who = devs[pkg[1]]





^ permalink raw reply	[flat|nested] 13+ messages in thread

* [gentoo-commits] gentoo commit in src/gwn: gwn_adds_removes.py
@ 2013-11-26 18:52 Markos Chandras (hwoarang)
  0 siblings, 0 replies; 13+ messages in thread
From: Markos Chandras (hwoarang) @ 2013-11-26 18:52 UTC (permalink / raw
  To: gentoo-commits

hwoarang    13/11/26 18:52:49

  Modified:             gwn_adds_removes.py
  Log:
  gwn_adds_removes: print main header as well

Revision  Changes    Path
1.12                 src/gwn/gwn_adds_removes.py

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gwn_adds_removes.py?rev=1.12&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gwn_adds_removes.py?rev=1.12&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gwn_adds_removes.py?r1=1.11&r2=1.12

Index: gwn_adds_removes.py
===================================================================
RCS file: /var/cvsroot/gentoo/src/gwn/gwn_adds_removes.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- gwn_adds_removes.py	31 Oct 2013 17:42:49 -0000	1.11
+++ gwn_adds_removes.py	26 Nov 2013 18:52:49 -0000	1.12
@@ -53,6 +53,7 @@
 
 def write(data, devs):
 	sections = {'added': 'Addition', 'removed': 'Removal'}
+	print "<h1>Package Removals/Additions</h1>"
 	for s in sections:
 		if s == 'added':
 			print "<h2>Additions</h2>"





^ permalink raw reply	[flat|nested] 13+ messages in thread

* [gentoo-commits] gentoo commit in src/gwn: gwn_adds_removes.py
@ 2014-04-05 17:45 David Abbott (dabbott)
  0 siblings, 0 replies; 13+ messages in thread
From: David Abbott (dabbott) @ 2014-04-05 17:45 UTC (permalink / raw
  To: gentoo-commits

dabbott     14/04/05 17:45:36

  Modified:             gwn_adds_removes.py
  Log:
  remove profiles from log as this creates an exception and script dies

Revision  Changes    Path
1.13                 src/gwn/gwn_adds_removes.py

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gwn_adds_removes.py?rev=1.13&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gwn_adds_removes.py?rev=1.13&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gwn_adds_removes.py?r1=1.12&r2=1.13

Index: gwn_adds_removes.py
===================================================================
RCS file: /var/cvsroot/gentoo/src/gwn/gwn_adds_removes.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- gwn_adds_removes.py	26 Nov 2013 18:52:49 -0000	1.12
+++ gwn_adds_removes.py	5 Apr 2014 17:45:36 -0000	1.13
@@ -7,8 +7,18 @@
 ATTIC_LINK = 'http://sources.gentoo.org/viewcvs.py/gentoo-x86/%s/%s/?hideattic=0'
 OUTPUT_CHARSET = 'utf-8'
 
-def parse(logfile):
+def remove_profile_line(logfile):
+	outfile = open(logfile, "r")
+	data = []
+	for line in outfile:
+		if not line.lstrip().startswith("profile"):
+			data.append(line)
+	outfile.close()
+	f = open(logfile, "w")
+	f.writelines(data)
+	f.close
 
+def parse(logfile):
 	# Read the log file
 	cur = []
 	pkgs = {'added': [], 'removed': []}
@@ -82,6 +92,8 @@
 		print "[/table]"
 
 if __name__ == '__main__':
+	for i in range(0, len(sys.argv)-1):
+		remove_profile_line(sys.argv[i+1])
 	data = []
 	if len(sys.argv) < 2:
 		print 'Usage: gwn_adds_removes.py -p <log-files>'





^ permalink raw reply	[flat|nested] 13+ messages in thread

* [gentoo-commits] gentoo commit in src/gwn: gwn_adds_removes.py
@ 2014-08-03 21:14 David Abbott (dabbott)
  0 siblings, 0 replies; 13+ messages in thread
From: David Abbott (dabbott) @ 2014-08-03 21:14 UTC (permalink / raw
  To: gentoo-commits

dabbott     14/08/03 21:14:38

  Modified:             gwn_adds_removes.py
  Log:
  removed the -p option and the cmp dates, we don't need for monthly

Revision  Changes    Path
1.14                 src/gwn/gwn_adds_removes.py

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gwn_adds_removes.py?rev=1.14&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gwn_adds_removes.py?rev=1.14&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gwn_adds_removes.py?r1=1.13&r2=1.14

Index: gwn_adds_removes.py
===================================================================
RCS file: /var/cvsroot/gentoo/src/gwn/gwn_adds_removes.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- gwn_adds_removes.py	5 Apr 2014 17:45:36 -0000	1.13
+++ gwn_adds_removes.py	3 Aug 2014 21:14:38 -0000	1.14
@@ -80,15 +80,11 @@
 					ldata = (ATTIC_LINK % pkg[0], '/'.join(pkg[0]))
 				#who = (devs[pkg[1]].encode(OUTPUT_CHARSET), pkg[1])
 				who = devs[pkg[1]]
-				# clean date format so we can compare it with
-				# date_to/date_from
-				when_cmp = pkg[2].strftime('%Y%m')
 				# date format suitable for GMN posts
 				when = pkg[2].strftime('%d %b %Y')
 				# You should copy this to the raw html code in the
 				# blog post
-				if when_cmp >=date_from and when_cmp < date_to:
-					print '<a href="%s">%s</a>, %s, %s' % (ldata[0], ldata[1], who, when)
+				print '<a href="%s">%s</a>, %s, %s' % (ldata[0], ldata[1], who, when)
 		print "[/table]"
 
 if __name__ == '__main__':
@@ -96,25 +92,9 @@
 		remove_profile_line(sys.argv[i+1])
 	data = []
 	if len(sys.argv) < 2:
-		print 'Usage: gwn_adds_removes.py -p <log-files>'
+		print 'Usage: gwn_adds_removes.py <log-files>'
 	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(argrange, len(sys.argv)-1):
+	        devs = developers()
+		for i in range(0, len(sys.argv)-1):
 			data.append(parse(sys.argv[i+1]))
 		write(data, devs)





^ permalink raw reply	[flat|nested] 13+ messages in thread

* [gentoo-commits] gentoo commit in src/gwn: gwn_adds_removes.py
@ 2014-09-06 10:58 Markos Chandras (hwoarang)
  0 siblings, 0 replies; 13+ messages in thread
From: Markos Chandras (hwoarang) @ 2014-09-06 10:58 UTC (permalink / raw
  To: gentoo-commits

hwoarang    14/09/06 10:58:59

  Modified:             gwn_adds_removes.py
  Log:
  gwn_adds_removes.py: Handle the 'Done.' string at the end of the log file

Revision  Changes    Path
1.15                 src/gwn/gwn_adds_removes.py

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gwn_adds_removes.py?rev=1.15&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gwn_adds_removes.py?rev=1.15&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gwn_adds_removes.py?r1=1.14&r2=1.15

Index: gwn_adds_removes.py
===================================================================
RCS file: /var/cvsroot/gentoo/src/gwn/gwn_adds_removes.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- gwn_adds_removes.py	3 Aug 2014 21:14:38 -0000	1.14
+++ gwn_adds_removes.py	6 Sep 2014 10:58:59 -0000	1.15
@@ -29,6 +29,8 @@
 			cur = pkgs['added']
 		elif i.startswith('Removed'):
 			cur = pkgs['removed']
+		elif i.startswith('Done.'):
+			break
 		elif not i:
 			break
 		else:





^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2014-09-06 10:59 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-05 15:15 [gentoo-commits] gentoo commit in src/gwn: gwn_adds_removes.py Markos Chandras (hwoarang)
  -- strict thread matches above, loose matches on Subject: below --
2014-09-06 10:58 Markos Chandras (hwoarang)
2014-08-03 21:14 David Abbott (dabbott)
2014-04-05 17:45 David Abbott (dabbott)
2013-11-26 18:52 Markos Chandras (hwoarang)
2013-10-31 17:42 Markos Chandras (hwoarang)
2013-10-20 14:38 Markos Chandras (hwoarang)
2013-10-20 12:01 Markos Chandras (hwoarang)
2013-10-16 18:10 Markos Chandras (hwoarang)
2013-10-16 18:01 Markos Chandras (hwoarang)
2008-03-15 11:09 Anant Narayanan (anant)
2008-03-15 11:07 Anant Narayanan (anant)
2007-11-14 18:45 Chris Gianelloni (wolf31o2)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox