except ImportError:
from output import *
-from getopt import getopt,GetoptError
+from getopt import getopt, GetoptError
__program__ = "glsa-check"
__author__ = "Marius Mauch <genone@gentoo.org>"
fd1.write(")")
if list_cve:
fd1.write(" "+(",".join([r[:13] for r in myglsa.references if r[:4] in ["CAN-", "CVE-"]])))
- fd1.write("\n")
+ fd1.write("\n")
return 0
if mode == "list":
# color doesn't make any sense for mail
nocolor()
- if glsaconfig.has_key("PORTAGE_ELOG_MAILURI"):
+ if "PORTAGE_ELOG_MAILURI" in glsaconfig:
myrecipient = glsaconfig["PORTAGE_ELOG_MAILURI"].split()[0]
else:
myrecipient = "root@localhost"
- if glsaconfig.has_key("PORTAGE_ELOG_MAILFROM"):
+ if "PORTAGE_ELOG_MAILFROM" in glsaconfig:
myfrom = glsaconfig["PORTAGE_ELOG_MAILFROM"]
else:
myfrom = "glsa-check"
import re
import xml.dom.minidom
-if sys.version_info[0:2] < (2,3):
+if sys.version_info[0:2] < (2, 3):
raise NotImplementedError("Python versions below 2.3 have broken XML code " \
+"and are not supported")
import portage
# Note: the space for rgt and rlt is important !!
-opMapping = {"le": "<=", "lt": "<", "eq": "=", "gt": ">", "ge": ">=",
- "rge": ">=~", "rle": "<=~", "rgt": " >~", "rlt": " <~"}
+opMapping = {"le": "<=", "lt": "<", "eq": "=", "gt": ">", "ge": ">=",
+ "rge": ">=~", "rle": "<=~", "rgt": " >~", "rlt": " <~"}
NEWLINE_ESCAPE = "!;\\n" # some random string to mark newlines that should be preserved
SPACE_ESCAPE = "!;_" # some random string to mark spaces that should be preserved
self.packages = {}
for p in self.affected.getElementsByTagName("package"):
name = p.getAttribute("name")
- if not self.packages.has_key(name):
+ if not name in self.packages:
self.packages[name] = []
tmp = {}
tmp["arch"] = p.getAttribute("arch")
if i < len(self.bugs)-1:
outstream.write(", ")
else:
- outstream.write("\n")
+ outstream.write("\n")
if self.background:
outstream.write("\n"+wrap(self.background, width, caption="Background: "))
outstream.write("\n"+wrap(self.description, width, caption="Description: "))