more print to function conversions
Hanno Böck

Hanno Böck commited on 2010-11-28 23:57:08
Zeige 1 geänderte Dateien mit 18 Einfügungen und 18 Löschungen.

... ...
@@ -44,34 +44,34 @@ def vulnprint(appname, version, safeversion, vuln, vfilename, subdir, style = No
44 44
         print ("%(appname)s %(version)s (%(safeversion)s) %(vuln)s %(appdir)s" \
45 45
               % vars())
46 46
     elif style=='fancy':
47
-        print _("Directory: %(appdir)s") % vars()
47
+        print (_("Directory: %(appdir)s") % vars())
48 48
         if safeversion!="ok":
49 49
             if safeversion!="":
50
-                print _("Vulnerable %(appname)s %(version)s found, please update to " \
51
-                        "%(safeversion)s or above.") % vars()
50
+                print (_("Vulnerable %(appname)s %(version)s found, please update to " \
51
+                        "%(safeversion)s or above.") % vars())
52 52
             else:
53
-                print _("Vulnerable %(appname)s %(version)s found, no fixed version available." \
54
-                        ) % vars()
53
+                print (_("Vulnerable %(appname)s %(version)s found, no fixed version available." \
54
+                        ) % vars())
55 55
             if vuln[:3] == "CVE":
56
-                print _("http://cve.mitre.org/cgi-bin/cvename.cgi?name=%(vuln)s") \
57
-                        % vars()
56
+                print (_("http://cve.mitre.org/cgi-bin/cvename.cgi?name=%(vuln)s") \
57
+                        % vars())
58 58
             else:
59 59
                 print (vuln)
60 60
         else:
61
-            print _("%(appname)s %(version)s found." ) % vars()
61
+            print (_("%(appname)s %(version)s found." ) % vars())
62 62
         print
63 63
     elif style=='xml':
64 64
         state = 'vulnerable'
65 65
         if safeversion == 'ok':
66 66
             state = 'ok'
67
-        print '  <app state="%s">' % state
68
-        print '    <appname>%s</appname>' % escape(appname)
69
-        print '    <version>%s</version>' % escape(version)
70
-        print '    <directory>%s</directory>' % escape(appdir)
67
+        print ('  <app state="%s">' % state)
68
+        print ('    <appname>%s</appname>' % escape(appname))
69
+        print ('    <version>%s</version>' % escape(version))
70
+        print ('    <directory>%s</directory>' % escape(appdir))
71 71
         if state == 'vulnerable':
72
-            print '    <safeversion>%s</safeversion>' % escape(safeversion)
73
-            print '    <vulninfo>%s</vulninfo>' % escape(vuln)
74
-        print '  </app>'
72
+            print ('    <safeversion>%s</safeversion>' % escape(safeversion))
73
+            print ('    <vulninfo>%s</vulninfo>' % escape(vuln))
74
+        print ('  </app>')
75 75
 
76 76
 
77 77
 pp = pprint.PrettyPrinter(indent=4)
... ...
@@ -131,8 +131,8 @@ if opts.DEBUG:
131 131
     pp.pprint(vdb)
132 132
 
133 133
 if opts.OUTPUT == 'xml':
134
-  print '<?xml version="1.0" ?>'
135
-  print '<freewvs>'
134
+  print ('<?xml version="1.0" ?>')
135
+  print ('<freewvs>')
136 136
 
137 137
 # start the search
138 138
 
... ...
@@ -202,4 +202,4 @@ for fdir in args:
202 202
                                   item['name'] + " on " + mfile)
203 203
 
204 204
 if opts.OUTPUT == 'xml':
205
-  print '</freewvs>'
205
+  print ('</freewvs>')
206 206