Commits

Cyril R committed 6855d35

Patched intl.py to maintain directory structure

  • Participants
  • Parent commits d63743c

Comments (0)

Files changed (1)

File sphinx/builders/intl.py

     :license: BSD, see LICENSE for details.
 """
 
+import os
 from os import path
 from codecs import open
 from datetime import datetime
         return
 
     def write_doc(self, docname, doctree):
-        catalog = self.catalogs[docname.split(SEP, 1)[0]]
+        catalog = self.catalogs[docname]
 
         self.handle_versioning(docname, doctree, nodes.TextElement)
 
                 self.catalogs.iteritems(), "writing message catalogs... ",
                 lambda (section, _):darkgreen(section), len(self.catalogs)):
 
+            
+            parent_dir = path.join(self.outdir, path.split(section)[0])
+            try:
+                os.makedirs(parent_dir)
+            except:
+                self.warn("Directory creation failed: %s" % parent_dir)
             pofn = path.join(self.outdir, section + '.pot')
             pofile = open(pofn, 'w', encoding='utf-8')
             try: