[Zope3-checkins] SVN: Zope3/trunk/ #313 : importchecker.py ignores assignment to module attributes (no test case though)

Julien Anguenot ja at nuxeo.com
Fri May 20 10:22:19 EDT 2005


Log message for revision 30462:
  #313 : importchecker.py ignores assignment to module attributes (no test case though)

Changed:
  U   Zope3/trunk/doc/CHANGES.txt
  U   Zope3/trunk/doc/TODO.txt
  U   Zope3/trunk/utilities/importchecker.py

-=-
Modified: Zope3/trunk/doc/CHANGES.txt
===================================================================
--- Zope3/trunk/doc/CHANGES.txt	2005-05-20 13:43:28 UTC (rev 30461)
+++ Zope3/trunk/doc/CHANGES.txt	2005-05-20 14:22:18 UTC (rev 30462)
@@ -590,6 +590,8 @@
         logout.) See zope/app/security/browser/loginlogout.txt for details.
 
     Bug Fixes
+
+      - Fix #313 : importchecker.py ignores assignment to module attributes
     
       - Fix #327 : File type change clears object content
 

Modified: Zope3/trunk/doc/TODO.txt
===================================================================
--- Zope3/trunk/doc/TODO.txt	2005-05-20 13:43:28 UTC (rev 30461)
+++ Zope3/trunk/doc/TODO.txt	2005-05-20 14:22:18 UTC (rev 30462)
@@ -48,8 +48,6 @@
 
   * 307: browser:addMenuItem and broken view references
 
-  * 313: importchecker.py ignores assignment to module attributes
-
   * 316: Zope3X test.py truncates path with dir=
 
   * 332: Death to IContentContainer

Modified: Zope3/trunk/utilities/importchecker.py
===================================================================
--- Zope3/trunk/utilities/importchecker.py	2005-05-20 13:43:28 UTC (rev 30461)
+++ Zope3/trunk/utilities/importchecker.py	2005-05-20 14:22:18 UTC (rev 30462)
@@ -24,7 +24,6 @@
 import os, os.path
 import sys
 
-
 def _findDottedNamesHelper(node, result):
     more_node = node
     name = node.__class__.__name__
@@ -45,6 +44,12 @@
         result.append(node.name)
         return
     elif name == 'AssAttr':
+        # Can be on an import as well.
+        # for instance
+        # from x import y
+        # y.k = v
+        expr = node.expr
+        result.append(expr.__dict__.get('name', ''))
         return
     for child in more_node.getChildNodes():
         _findDottedNamesHelper(child, result)



More information about the Zope3-Checkins mailing list