[Checkins] SVN: z3c.recipe.i18n/trunk/src/z3c/recipe/i18n/i18nextract.py - (hopefully) fixed path splitting by simplifying the code

Yvo Schubbe y.2009 at wcm-solutions.de
Fri Jul 17 03:57:23 EDT 2009


Log message for revision 101955:
  - (hopefully) fixed path splitting by simplifying the code
    relying on the position of 'src' can cause trouble

Changed:
  U   z3c.recipe.i18n/trunk/src/z3c/recipe/i18n/i18nextract.py

-=-
Modified: z3c.recipe.i18n/trunk/src/z3c/recipe/i18n/i18nextract.py
===================================================================
--- z3c.recipe.i18n/trunk/src/z3c/recipe/i18n/i18nextract.py	2009-07-16 21:54:25 UTC (rev 101954)
+++ z3c.recipe.i18n/trunk/src/z3c/recipe/i18n/i18nextract.py	2009-07-17 07:57:22 UTC (rev 101955)
@@ -163,20 +163,13 @@
 
     # add maker for each given path
     for pkgName, path in eggPaths:
-        srcIdx = path.rfind('src')
-        if srcIdx == -1:
-            # this is an egg package, strip down base path
-            basePath = path
-            moduleNames = pkgName.split('.')
-            moduleNames.reverse()
-            for mName in moduleNames:
-                mIdx = path.rfind(mName)
-                basePath = basePath[:mIdx]
-            pkgPath = path[len(basePath):]
-        else:
-            # this is a package linked in as externals
-            basePath = path[:srcIdx]
-            pkgPath = path[len(basePath):]
+        basePath = path
+        moduleNames = pkgName.split('.')
+        moduleNames.reverse()
+        for mName in moduleNames:
+            mIdx = path.rfind(mName)
+            basePath = basePath[:mIdx]
+        pkgPath = path[len(basePath):]
 
         print "package: %r\n" \
               "base:    %r\n" \



More information about the Checkins mailing list