rpms/pychecker/devel pychecker-0.8.17-spe.patch, NONE, 1.1 pychecker.spec, 1.22, 1.23

Vitezslav Crhonek (vcrhonek) fedora-extras-commits at redhat.com
Tue Apr 29 10:22:06 UTC 2008


Author: vcrhonek

Update of /cvs/extras/rpms/pychecker/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv6193

Modified Files:
	pychecker.spec 
Added Files:
	pychecker-0.8.17-spe.patch 
Log Message:
Add minor improvements to pychecker2/main.py

pychecker-0.8.17-spe.patch:

--- NEW FILE pychecker-0.8.17-spe.patch ---
diff -up pychecker-0.8.17/pychecker2/main.py_old pychecker-0.8.17/pychecker2/main.py
--- pychecker-0.8.17/pychecker2/main.py_old	2002-09-02 00:36:21.000000000 +0200
+++ pychecker-0.8.17/pychecker2/main.py	2008-04-29 11:41:35.000000000 +0200
@@ -1,5 +1,29 @@
 import sys
 from os.path import dirname, realpath
+
+#---Patched by Stani http://pythonide.stani.be (begin)
+import os
+def userPath(dirname=''):
+    """'safer' function to find user path."""
+    # 'safer' function to find user path: look for one of these directories
+    try:
+        path = os.path.expanduser("~")
+        if os.path.isdir(path):
+            return os.path.join(path, dirname)
+    except:
+        pass
+    for evar in ('HOME', 'USERPROFILE', 'TMP'):
+        try:
+            path = os.environ[evar]
+            if os.path.isdir(path):
+                return os.path.join(path, dirname)
+        except:
+            pass
+    #if no match found, use module directory
+    return os.path.join(os.path.dirname(os.path.abspath(__file__)), dirname)
+
+CACHE_FILE = userPath(".pychecker_cache")
+#Patched by Stani http://pythonide.stani.be (end)
 sys.path.append(dirname(dirname(realpath(sys.argv[0]))))
 
 from pychecker2.Check import CheckList
@@ -16,7 +40,6 @@ from pychecker2 import ReturnChecks
 from pychecker2 import ConditionalChecks
 from pychecker2 import FormatStringChecks
 
-CACHE_FILE = '/tmp/t'
 
 def print_warnings(f, out):
     if not f.warnings:
@@ -69,7 +92,8 @@ def main():
     options = Options.Options()
     try:
         checker = cPickle.load(open(CACHE_FILE, 'rb'))
-    except (EOFError, IOError):
+    #---Patched by Stani http://pythonide.stani.be (added ImportError)
+    except (EOFError, IOError, ImportError):
         checker = create_checklist(options)
 
     try:
@@ -79,10 +103,18 @@ def main():
         options.usage(sys.argv[0], sys.stderr)
         return 1
 
+    #---Patched by Stani http://pythonide.stani.be (begin)
+    sys_path    = sys.path[:]
     for f in files:
+        f_dir   = dirname(f.name)
+        sys.path= sys_path[:]
+        if f_dir not in sys.path:
+            sys.path.insert(0,f_dir)
         checker.check_file(f)
         if options.incremental and not options.profile:
             print_warnings(f, sys.stdout)
+    sys.path    = sys_path
+    #Patched by Stani http://pythonide.stani.be (end)
 
     result = 0
     if not options.incremental and not options.profile:


Index: pychecker.spec
===================================================================
RCS file: /cvs/extras/rpms/pychecker/devel/pychecker.spec,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- pychecker.spec	10 Apr 2008 09:13:46 -0000	1.22
+++ pychecker.spec	29 Apr 2008 10:21:27 -0000	1.23
@@ -1,10 +1,11 @@
 Summary:  A python source code checking tool.
 Name: pychecker
 Version: 0.8.17
-Release: 3
+Release: 4
 URL: http://pychecker.sourceforge.net
 Source0: http://dl.sourceforge.net/pychecker/pychecker-%{version}.tar.gz
 Patch0: pychecker-0.8.17-root.patch
+Patch1: pychecker-0.8.17-spe.patch
 License: BSD
 Group: Development/Tools
 Requires: python
@@ -20,6 +21,7 @@
 %prep
 %setup -q
 %patch0 -p1 -b .root
+%patch1 -p1 -b .spe
 
 %build
 CFLAGS="$RPM_OPT_FLAGS" python setup.py build
@@ -46,6 +48,11 @@
 %exclude /usr/lib/python*/site-packages/pychecker/VERSION
 
 %changelog
+* Tue Apr 29 2008 Vitezslav Crhonek <vcrhonek at redhat.com> - 0.8.17-4
+- Add minor improvements to pychecker2/main.py (patch by Stani's Python
+  Editor folks)
+  Resolves: #443416
+
 * Thu Apr 10 2008 Vitezslav Crhonek <vcrhonek at redhat.com> - 0.8.17-3
 - Spec file cleanup (fix Buildroot, fix License, fix %%files)
 




More information about the fedora-extras-commits mailing list