summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2003-01-12 19:11:26 (GMT)
committerSteven Knight <knight@baldmt.com>2003-01-12 19:11:26 (GMT)
commit563ae5e86b7eaaf060559872c58c699e5b34d79b (patch)
tree9333c641aeb7d0a0b22d73cd0a80797924f3fa18
parent5d3b3d8891c805fe334be3cd71a2670b5c76d65a (diff)
downloadSCons-563ae5e86b7eaaf060559872c58c699e5b34d79b.zip
SCons-563ae5e86b7eaaf060559872c58c699e5b34d79b.tar.gz
SCons-563ae5e86b7eaaf060559872c58c699e5b34d79b.tar.bz2
Fix small problems found by PyChecker. (Steve Leblanc)
-rw-r--r--bin/check26
-rw-r--r--bin/files55
-rw-r--r--bin/makedocs18
-rw-r--r--src/CHANGES.txt6
-rw-r--r--src/engine/SCons/Action.py3
-rw-r--r--src/engine/SCons/Builder.py2
-rw-r--r--src/engine/SCons/Defaults.py2
-rw-r--r--src/engine/SCons/Environment.py4
-rw-r--r--src/engine/SCons/Node/FS.py2
-rw-r--r--src/engine/SCons/Node/__init__.py3
-rw-r--r--src/engine/SCons/Platform/cygwin.py1
-rw-r--r--src/engine/SCons/Platform/os2.py2
-rw-r--r--src/engine/SCons/Scanner/C.py2
-rw-r--r--src/engine/SCons/Scanner/Fortran.py2
-rw-r--r--src/engine/SCons/Scanner/Prog.py1
-rw-r--r--src/engine/SCons/Script/__init__.py1
-rw-r--r--src/engine/SCons/Sig/__init__.py6
-rw-r--r--src/engine/SCons/Taskmaster.py1
-rw-r--r--src/engine/SCons/Tool/__init__.py1
-rw-r--r--src/engine/SCons/Tool/icc.py3
-rw-r--r--src/engine/SCons/Util.py2
-rw-r--r--src/engine/SCons/Warnings.py4
22 files changed, 110 insertions, 37 deletions
diff --git a/bin/check b/bin/check
new file mode 100644
index 0000000..f32494e
--- /dev/null
+++ b/bin/check
@@ -0,0 +1,26 @@
+#! /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
diff --git a/bin/files b/bin/files
new file mode 100644
index 0000000..d4ec77a
--- /dev/null
+++ b/bin/files
@@ -0,0 +1,55 @@
+./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
diff --git a/bin/makedocs b/bin/makedocs
new file mode 100644
index 0000000..2278a97
--- /dev/null
+++ b/bin/makedocs
@@ -0,0 +1,18 @@
+#! /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`
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index bc885f7..f74cb92 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -56,6 +56,12 @@ RELEASE 0.10 - XXX
- 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.
diff --git a/src/engine/SCons/Action.py b/src/engine/SCons/Action.py
index d8a08be..61a799c 100644
--- a/src/engine/SCons/Action.py
+++ b/src/engine/SCons/Action.py
@@ -29,13 +29,10 @@ XXX
__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
diff --git a/src/engine/SCons/Builder.py b/src/engine/SCons/Builder.py
index 9c91c01..122ee49 100644
--- a/src/engine/SCons/Builder.py
+++ b/src/engine/SCons/Builder.py
@@ -46,8 +46,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os.path
-import string
-import copy
from SCons.Errors import UserError
import SCons.Action
diff --git a/src/engine/SCons/Defaults.py b/src/engine/SCons/Defaults.py
index 2016694..bfda9fe 100644
--- a/src/engine/SCons/Defaults.py
+++ b/src/engine/SCons/Defaults.py
@@ -37,9 +37,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os
-import stat
import string
-import sys
import os.path
import SCons.Action
diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py
index 5ebf64c..d731eb3 100644
--- a/src/engine/SCons/Environment.py
+++ b/src/engine/SCons/Environment.py
@@ -34,10 +34,6 @@ import copy
import os
import os.path
import re
-import shutil
-import string
-import sys
-import types
from UserDict import UserDict
import SCons.Action
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py
index 1b627fd..eb23cd8 100644
--- a/src/engine/SCons/Node/FS.py
+++ b/src/engine/SCons/Node/FS.py
@@ -39,8 +39,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os
import os.path
import string
-import sys
-import types
from UserDict import UserDict
import SCons.Action
diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py
index bac547c..14f99ed 100644
--- a/src/engine/SCons/Node/__init__.py
+++ b/src/engine/SCons/Node/__init__.py
@@ -47,7 +47,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import copy
-import types
import SCons.Sig
import SCons.Util
@@ -457,7 +456,7 @@ class Node:
def get_state(self):
return self.state
- def current(self):
+ def current(self, calc=None):
return None
def rfile(self):
diff --git a/src/engine/SCons/Platform/cygwin.py b/src/engine/SCons/Platform/cygwin.py
index fe5a818..bda1c90 100644
--- a/src/engine/SCons/Platform/cygwin.py
+++ b/src/engine/SCons/Platform/cygwin.py
@@ -32,7 +32,6 @@ selection method.
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-import SCons.Util
import posix
def generate(env):
diff --git a/src/engine/SCons/Platform/os2.py b/src/engine/SCons/Platform/os2.py
index c389521..631952a 100644
--- a/src/engine/SCons/Platform/os2.py
+++ b/src/engine/SCons/Platform/os2.py
@@ -32,8 +32,6 @@ selection method.
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-import SCons.Util
-
def generate(env):
if not env.has_key('ENV'):
env['ENV'] = {}
diff --git a/src/engine/SCons/Scanner/C.py b/src/engine/SCons/Scanner/C.py
index b9f2d8f..5a58d12 100644
--- a/src/engine/SCons/Scanner/C.py
+++ b/src/engine/SCons/Scanner/C.py
@@ -30,8 +30,6 @@ This module implements the depenency scanner for C/C++ code.
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-import copy
-import os.path
import re
import SCons.Node
diff --git a/src/engine/SCons/Scanner/Fortran.py b/src/engine/SCons/Scanner/Fortran.py
index 034d5ac..a47e02f 100644
--- a/src/engine/SCons/Scanner/Fortran.py
+++ b/src/engine/SCons/Scanner/Fortran.py
@@ -30,8 +30,6 @@ This module implements the dependency scanner for Fortran code.
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-import copy
-import os.path
import re
import SCons.Node
diff --git a/src/engine/SCons/Scanner/Prog.py b/src/engine/SCons/Scanner/Prog.py
index 081fd5c..b2eb121 100644
--- a/src/engine/SCons/Scanner/Prog.py
+++ b/src/engine/SCons/Scanner/Prog.py
@@ -23,7 +23,6 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-import copy
import string
import SCons.Node
diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py
index ca6536f..a33e373 100644
--- a/src/engine/SCons/Script/__init__.py
+++ b/src/engine/SCons/Script/__init__.py
@@ -44,7 +44,6 @@ import os.path
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
diff --git a/src/engine/SCons/Sig/__init__.py b/src/engine/SCons/Sig/__init__.py
index 4fe9423..1fd88a4 100644
--- a/src/engine/SCons/Sig/__init__.py
+++ b/src/engine/SCons/Sig/__init__.py
@@ -29,13 +29,13 @@ The Signature package for the scons software construction utility.
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+import cPickle
import os
import os.path
-import string
-import SCons.Node
import time
+
+import SCons.Node
import SCons.Warnings
-import cPickle
try:
import MD5
diff --git a/src/engine/SCons/Taskmaster.py b/src/engine/SCons/Taskmaster.py
index 74703f2..dea0739 100644
--- a/src/engine/SCons/Taskmaster.py
+++ b/src/engine/SCons/Taskmaster.py
@@ -29,7 +29,6 @@ Generic Taskmaster.
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-import copy
import string
import sys
diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py
index f5cea7e..fbb09af 100644
--- a/src/engine/SCons/Tool/__init__.py
+++ b/src/engine/SCons/Tool/__init__.py
@@ -39,7 +39,6 @@ tool definition.
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import imp
-import os
import sys
import SCons.Errors
diff --git a/src/engine/SCons/Tool/icc.py b/src/engine/SCons/Tool/icc.py
index b21069a..1d64dcb 100644
--- a/src/engine/SCons/Tool/icc.py
+++ b/src/engine/SCons/Tool/icc.py
@@ -33,9 +33,6 @@ selection method.
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-import os.path
-import string
-
import SCons.Action
import SCons.Tool
import SCons.Errors
diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py
index 5a1c078..c89e8e6 100644
--- a/src/engine/SCons/Util.py
+++ b/src/engine/SCons/Util.py
@@ -764,6 +764,6 @@ def fs_delete(path, remove=1):
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()
diff --git a/src/engine/SCons/Warnings.py b/src/engine/SCons/Warnings.py
index bf18ba5..070db26 100644
--- a/src/engine/SCons/Warnings.py
+++ b/src/engine/SCons/Warnings.py
@@ -29,10 +29,6 @@ This file implements the warnings framework for SCons.
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-import sys
-import copy
-import traceback
-
import SCons.Errors
class Warning(SCons.Errors.UserError):