Commits

Tarek Ziadé committed c2f8c03

removed some prints

Comments (0)

Files changed (2)

flake8/messages.py

         return '%s:%s: %s' % (self.filename, self.lineno,
                               self.message % self.message_args)
 
+    def __lt__(self, other):
+        if self.filename != other.filename:
+            return self.filename < other.filename
+        return self.lineno < other.lineno
+
+    def __cmp__(self, other):
+        if self.filename != other.filename:
+            return cmp(self.filename, other.filename)
+        return cmp(self.lineno, other.lineno)
+
 
 class UnusedImport(Message):
     message = '%r imported but unused'

flake8/pyflakes.py

 
 import os.path
 import _ast
+import sys
 
 from flake8 import messages
 from flake8.util import skip_warning
         return check(open(filename, 'U').read() + '\n', filename)
     except IOError:
         msg = sys.exc_info()[1]
-        print >> sys.stderr, "%s: %s" % (filename, msg.args[1])
+        sys.stderr.write("%s: %s\n" % (filename, msg.args[1]))
         return 1
 
 
             # Avoid using msg, since for the only known case, it contains a
             # bogus message that claims the encoding the file declared was
             # unknown.
-            print >> sys.stderr, "%s: problem decoding source" % (filename, )
+            sys.stderr.write("%s: problem decoding source\n" % (filename))
         else:
             line = text.splitlines()[-1]
 
             if offset is not None:
                 offset = offset - (len(text) - len(line))
 
-            print >> sys.stderr, '%s:%d: %s' % (filename, lineno, msg)
-            print >> sys.stderr, line
+
+            sys.stderr.write('%s:%d: %s\n' % (filename, lineno, msg))
+            sys.stderr.write(line + '\n')
 
             if offset is not None:
-                print >> sys.stderr, " " * offset, "^"
+                sys.stderr.write(" " * offset + "^\n")
 
         return 1
     else:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.