From 10e55d71bd5914fc7c9082adadf7bde2bec14ae3 Mon Sep 17 00:00:00 2001 From: fuzzyray Date: Wed, 20 May 2009 21:44:13 +0000 Subject: Some python tweaks to speed glsa-check svn path=/trunk/gentoolkit/; revision=646 --- pym/gentoolkit/glsa/__init__.py | 37 ++++++++++++------------------------- 1 file changed, 12 insertions(+), 25 deletions(-) (limited to 'pym') diff --git a/pym/gentoolkit/glsa/__init__.py b/pym/gentoolkit/glsa/__init__.py index b325bd5..cc80517 100644 --- a/pym/gentoolkit/glsa/__init__.py +++ b/pym/gentoolkit/glsa/__init__.py @@ -18,6 +18,7 @@ import sys import urllib import codecs import re +import operator import xml.dom.minidom from StringIO import StringIO @@ -153,7 +154,7 @@ def get_glsa_list(repository, myconfig): for f in dirlist: try: - if f[:len(prefix)] == prefix: + if f[:len(prefix)] == prefix and f[-1*len(suffix):] == suffix: rValue.append(f[len(prefix):-1*len(suffix)]) except IndexError: pass @@ -168,13 +169,11 @@ def getListElements(listnode): @rtype: List of Strings @return: a list that contains the value of the
  • elements """ - rValue = [] if not listnode.nodeName in ["ul", "ol"]: raise GlsaFormatException("Invalid function call: listnode is not