~openerp-chinese-team/openerp-china/openerp-china

« back to all changes in this revision

Viewing changes to oecn_base_fonts/oecn_base_fonts_config.py

  • Committer: Tony Gu
  • Date: 2012-01-20 04:30:10 UTC
  • Revision ID: tony@openerp.cn-20120120043010-ob03puqyzwhkxnxd
Loop on a list that is changed in the looping code block is a bad behavior

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
        folders = [ s % env for s in FontFolders]
44
44
        # get all folders under fonts directory
45
45
        ff = FontFinder( useCache = False )
 
46
        fontdirs = folders[:]
46
47
        for ele in folders:
47
48
            for root, dirs, files in os.walk(ele):
48
49
                for name in dirs:
49
 
                    folders.append(os.path.join(root, name))
 
50
                    fontdirs.append(os.path.join(root, name))
50
51
        
51
 
        ff.addDirectories( set ( folders ))
 
52
        ff.addDirectories(set(fontdirs))
52
53
 
53
54
        # get fonts name and file path
54
55
        # ff.search() may resulting error if any AFMFont resided in