Changeset 4451

Show
Ignore:
Timestamp:
04/05/09 20:22:55 (4 years ago)
Author:
gpolo
Message:

Fixed ticket #261: Added a new option in potmanager pot compilation to create all intermediary directories needed, so setup.py can use it to create the needed LC_MESSAGE path.

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/setup.py

    r4386 r4451  
    211211    def build_mo_files(self): 
    212212        """Build mo files from po and put it into LC_MESSAGES.""" 
    213         potman.compile(LOCALE_DIR, use_fuzzy=False, distutils_log=self.announce) 
     213        potman.compile(LOCALE_DIR, create_dirs=True, 
     214                use_fuzzy=False, distutils_log=self.announce) 
    214215 
    215216    def build_html_doc(self): 
  • trunk/utils/i18n/potmanager.py

    r4355 r4451  
    9191    def compile(self, locale_dir, use_fuzzy=True, verbose=False, 
    9292            do_checks=True, statistics=False, appname='umit', 
    93             mo_dir='LC_MESSAGES', distutils_log=None): 
     93            mo_dir='LC_MESSAGES', distutils_log=None, create_dirs=False): 
    9494        """Traverse locale_dir looking for .po files only inside 
    9595        subdirectories and compile them to .mo files.""" 
     
    107107            potdir = os.path.dirname(pot) 
    108108            mo_path = os.path.join(potdir, mo_dir, "%s.mo" % appname) 
     109            if not os.path.exists(os.path.dirname(mo_path)) and create_dirs: 
     110                os.makedirs(os.path.dirname(mo_path)) 
    109111            # compile pot 
    110112            if verbose: