[Zope3-checkins] CVS: Zope3/utilities - i18nextract.py:1.6

Eckart Hertzler eckart at hertzler.de
Wed Apr 21 06:02:16 EDT 2004


Update of /cvs-repository/Zope3/utilities
In directory cvs.zope.org:/tmp/cvs-serv5997/utilities

Modified Files:
	i18nextract.py 
Log Message:

If called from a directory with no 'src' directory on the path, such as a symlinked directory inside the Zope3/src directory the script went into an infinite loop.

- added test for root directory in method app_dir
- added a Note to the doc string explaining about the symlinks 



=== Zope3/utilities/i18nextract.py 1.5 => 1.6 ===
--- Zope3/utilities/i18nextract.py:1.5	Thu Apr 15 09:54:30 2004
+++ Zope3/utilities/i18nextract.py	Wed Apr 21 06:02:14 2004
@@ -24,6 +24,10 @@
       registration, so that all message strings are returned for
       Python code.
 
+Note: The script expects to be executed either from inside the Zope 3 source tree
+      or with the Zope 3 source tree on the Python path.
+      Execution from a symlinked directory inside the Zope 3 source tree will not work.
+
 Usage: i18nextract.py [options]
 Options:
     -h / --help
@@ -58,7 +62,11 @@
         # Get the path of the src
         path = os.path.abspath(os.getcwd())
         while not path.endswith('src'):
-            path = os.path.dirname(path)
+            parentdir = os.path.dirname(path)
+            if path == parentdir:
+                # root directory reached
+                break
+            path = parentdir
         sys.path.insert(0, path)
 
         try:




More information about the Zope3-Checkins mailing list