~ubuntu-branches/debian/experimental/pyflakes/experimental

« back to all changes in this revision

Viewing changes to debian/patches/add_main_function.diff

  • Committer: Bazaar Package Importer
  • Author(s): Sandro Tosi, Tristan Seligmann, Sandro Tosi, Hervé Cauwelier
  • Date: 2008-09-21 00:17:47 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080921001747-xal540q30vt2kzk6
Tags: 0.2.1+svn16699-1
[ Tristan Seligmann ]
* Remove redundant/broken python_unicode patch.
* Remove unneeded dependency on python-dev.

[ Sandro Tosi ]
* debian/control
  - changed my email address
  - bump Standards-Version to 3.8.0
    + added debian/README.source
* debian/rules
  - added get-orig-source
* debian/copyright
  - updated copyright information

[ Hervé Cauwelier ]
* Update to a recent SVN checkout; Closes: #499123
* Strip whitespace in debian/rules
* Refresh patches
* Fixed installation with debian/patches/install_scripts_package.diff

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
===================================================================
3
3
--- a/bin/pyflakes
4
4
+++ b/bin/pyflakes
5
 
@@ -32,18 +32,21 @@
6
 
     if os.path.exists(filename):
7
 
         return check(file(filename, 'U').read(), filename)
8
 
 
9
 
-warnings = 0
10
 
-args = sys.argv[1:]
11
 
-if args:
12
 
-    for arg in args:
13
 
-        if os.path.isdir(arg):
14
 
-            for dirpath, dirnames, filenames in os.walk(arg):
15
 
-                for filename in filenames:
16
 
-                    if filename.endswith('.py'):
17
 
-                        warnings += checkPath(os.path.join(dirpath, filename))
18
 
-        else:
19
 
-            warnings += checkPath(arg)
20
 
-else:
21
 
-    warnings += check(sys.stdin.read(), '<stdin>')
 
5
@@ -1,4 +1,5 @@
 
6
 #!/usr/bin/python
 
7
 
 
8
+import sys
 
9
 from pyflakes.scripts.pyflakes import main
 
10
-main()
 
11
+main(sys.argv[1:])
 
12
--- a/pyflakes/scripts/pyflakes.py
 
13
+++ b/pyflakes/scripts/pyflakes.py
 
14
@@ -37,9 +37,8 @@
 
15
         return check(file(filename, 'U').read() + '\n', filename)
 
16
 
 
17
 
 
18
-def main():
22
19
+def main(args):
23
 
+    warnings = 0
24
 
+    if args:
25
 
+        for arg in args:
26
 
+            if os.path.isdir(arg):
27
 
+                for dirpath, dirnames, filenames in os.walk(arg):
28
 
+                    for filename in filenames:
29
 
+                        if filename.endswith('.py'):
30
 
+                            warnings += checkPath(os.path.join(dirpath, filename))
31
 
+            else:
32
 
+                warnings += checkPath(arg)
33
 
+    else:
34
 
+        warnings += check(sys.stdin.read(), '<stdin>')
35
 
+    
36
 
+    raise SystemExit(warnings > 0)
37
 
 
38
 
-raise SystemExit(warnings > 0)
39
 
+if __name__ == '__main__':
40
 
+    main(sys.argv[1:])
 
20
     warnings = 0
 
21
-    args = sys.argv[1:]
 
22
     if args:
 
23
         for arg in args:
 
24
             if os.path.isdir(arg):