Anonymous avatar Anonymous committed 59ff6be

Fix small problems found by PyChecker. (Steve Leblanc)

Comments (0)

Files changed (22)

+#! /bin/sh
+
+# This script runs pychecker on the SCons source and creates a file called
+# checks.txt with the results. It must be run in the src/engine directory.
+
+base=`basename $PWD`
+if [ "$base" != "engine" ]; then
+   echo "You must run this script from the engine directory."
+   exit
+fi
+
+DEVDIR=../../doc/developer
+SRCFILE=../../bin/files
+CHKFILE=checks.txt
+
+rm -f $CHKFILE
+for f in `cat $SRCFILE` ; do
+   echo >> $CHKFILE
+   echo " --- $f ---" >> $CHKFILE
+   env PYTHONPATH=. pychecker -T -z -Z --deprecated $f >> $CHKFILE
+done
+
+if [ -e $CHKFILE ]; then
+   sed -e "s|$PWD/||" $CHKFILE > /tmp/tmpchk
+   mv -f /tmp/tmpchk $CHKFILE
+fi
+./SCons/Action.py
+./SCons/Builder.py
+./SCons/Defaults.py
+./SCons/Environment.py
+./SCons/Errors.py
+./SCons/Job.py
+./SCons/Node/Alias.py
+./SCons/Node/FS.py
+./SCons/Node/__init__.py
+./SCons/Options.py
+./SCons/Platform/__init__.py
+./SCons/Platform/cygwin.py
+./SCons/Platform/os2.py
+./SCons/Platform/posix.py
+./SCons/Platform/win32.py
+./SCons/Scanner/C.py
+./SCons/Scanner/Fortran.py
+./SCons/Scanner/Prog.py
+./SCons/Scanner/__init__.py
+./SCons/Script/SConscript.py
+./SCons/Script/__init__.py
+./SCons/Sig/MD5.py
+./SCons/Sig/TimeStamp.py
+./SCons/Sig/__init__.py
+./SCons/Taskmaster.py
+./SCons/Tool/__init__.py
+./SCons/Tool/ar.py
+./SCons/Tool/default.py
+./SCons/Tool/dvipdf.py
+./SCons/Tool/dvips.py
+./SCons/Tool/g++.py
+./SCons/Tool/g77.py
+./SCons/Tool/gas.py
+./SCons/Tool/gcc.py
+./SCons/Tool/gnulink.py
+./SCons/Tool/icc.py
+./SCons/Tool/ifl.py
+./SCons/Tool/ilink.py
+./SCons/Tool/latex.py
+./SCons/Tool/lex.py
+./SCons/Tool/masm.py
+./SCons/Tool/mingw.py
+./SCons/Tool/mslib.py
+./SCons/Tool/mslink.py
+./SCons/Tool/msvc.py
+./SCons/Tool/nasm.py
+./SCons/Tool/pdflatex.py
+./SCons/Tool/pdftex.py
+./SCons/Tool/tar.py
+./SCons/Tool/tex.py
+./SCons/Tool/yacc.py
+./SCons/Util.py
+./SCons/Warnings.py
+./SCons/__init__.py
+./SCons/exitfuncs.py
+#! /bin/sh
+
+# This script uses HappyDoc to create the HTML class documentation for
+# SCons. It must be run from the src/engine directory.
+
+base=`basename $PWD`
+if [ "$base" != "engine" ]; then
+   echo "You must run this script from the engine directory."
+   exit
+fi
+
+DEVDIR=../../doc/developer
+if [ ! -d $DEVDIR ]; then
+   mkdir $DEVDIR
+fi
+
+SRCFILE=../../bin/files
+happydoc -d $DEVDIR `cat $SRCFILE`
   - Add a Clean() method to support removing user-specified targets
     when using the -c option.
 
+  - Add a development script for running SCons through PyChecker.
+
+  - Clean up things found by PyChecker (mostly unnecessary imports).
+
+  - Add a script to use HappyDoc to create HTML class documentation.
+
   From Lachlan O'Dea:
 
   - Make the Environment.get() method return None by default.

src/engine/SCons/Action.py

 
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
-import copy
 import os
 import os.path
 import re
 import string
-import sys
-import UserDict
 
 import SCons.Errors
 import SCons.Util

src/engine/SCons/Builder.py

 
 
 import os.path
-import string
-import copy
 from SCons.Errors import UserError
 
 import SCons.Action

src/engine/SCons/Defaults.py

 
 
 import os
-import stat
 import string
-import sys
 import os.path
 
 import SCons.Action

src/engine/SCons/Environment.py

 import os
 import os.path
 import re
-import shutil
-import string
-import sys
-import types
 from UserDict import UserDict
 
 import SCons.Action

src/engine/SCons/Node/FS.py

 import os
 import os.path
 import string
-import sys
-import types
 from UserDict import UserDict
 
 import SCons.Action

src/engine/SCons/Node/__init__.py

 
 
 import copy
-import types
 
 import SCons.Sig
 import SCons.Util
     def get_state(self):
         return self.state
 
-    def current(self):
+    def current(self, calc=None):
         return None
 
     def rfile(self):

src/engine/SCons/Platform/cygwin.py

 
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
-import SCons.Util
 import posix
 
 def generate(env):

src/engine/SCons/Platform/os2.py

 
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
-import SCons.Util
-
 def generate(env):
     if not env.has_key('ENV'):
         env['ENV']        = {}

src/engine/SCons/Scanner/C.py

 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
 
-import copy
-import os.path
 import re
 
 import SCons.Node

src/engine/SCons/Scanner/Fortran.py

 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
 
-import copy
-import os.path
 import re
 
 import SCons.Node

src/engine/SCons/Scanner/Prog.py

 
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
-import copy
 import string
 
 import SCons.Node

src/engine/SCons/Script/__init__.py

 import string
 import sys
 import traceback
-import copy
 
 # Strip the script directory from sys.path() so on case-insensitive
 # (WIN32) systems Python doesn't think that the "scons" script is the

src/engine/SCons/Sig/__init__.py

 
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
+import cPickle
 import os
 import os.path
-import string
+import time
+
 import SCons.Node
-import time
 import SCons.Warnings
-import cPickle
 
 try:
     import MD5

src/engine/SCons/Taskmaster.py

 
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
-import copy
 import string
 import sys
 

src/engine/SCons/Tool/__init__.py

 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
 import imp
-import os
 import sys
 
 import SCons.Errors

src/engine/SCons/Tool/icc.py

 
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
-import os.path
-import string
-
 import SCons.Action
 import SCons.Tool
 import SCons.Errors

src/engine/SCons/Util.py

                 if remove: os.rmdir(path)
                 display("Removed directory " + path)
     except OSError, e:
-        print "scons: Could not remove '%s':" % str(t), e.strerror
+        print "scons: Could not remove '%s':" % str(path), e.strerror
 
 display = DisplayEngine()

src/engine/SCons/Warnings.py

 
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
-import sys
-import copy
-import traceback
-
 import SCons.Errors
 
 class Warning(SCons.Errors.UserError):
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.