Changeset 47a2c66 in osmose-frontend


Ignore:
Timestamp:
Mar 21, 2014 11:13:26 PM (6 years ago)
Author:
Frédéric Rodrigo <fred.rodrigo@…>
Branches:
master
Children:
6f5c3a9
Parents:
8d10bf0
git-author:
Frédéric Rodrigo <fred.rodrigo@…> (21/03/2014 18:37:54)
git-committer:
Frédéric Rodrigo <fred.rodrigo@…> (21/03/2014 23:13:26)
Message:

Fix parsewiki

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/parsewiki.py

    r68f5c5e r47a2c66  
    9292                line = line.strip() 
    9393            if line.startswith("* " + classs[lang] + " "): 
    94                 dclass = line[len("* " + classs[lang] + " "):].split(":", 1) 
    95                 nclass = int(dclass[0].strip()) 
    96                 accu[key]['class'][nclass] = dclass[1].strip() 
     94                dclass = line[len("* " + classs[lang] + " "):].split(" : ", 1) 
     95                nclass = int(dclass[0].split(' ')[0].strip()) 
     96                accu[key]['class'][nclass] = dclass[1].strip() if len(dclass)> 1 else "" 
    9797            elif key: 
    9898                accu[key]['text'] += line + "\n" 
     
    116116            if not errors[categ][item].get('label'): 
    117117                errors[categ][item]['label'] = {'text': None, 'class': {}} 
    118             errors[categ][item]['label']['text'] = ref[categ]['item'][item]['menu'].encode('utf-8') 
     118            errors[categ][item]['label']['text'] = ref[categ]['item'][item]['menu'].encode('utf-8') if ref[categ]['item'][item]['menu'] else "" 
    119119            val = errors[categ][item] 
    120120            for k in ('item', 'label', 'only_for', 'detail', 'fix', 'trap', 'image'): 
     121                if k != 'image' and not val.has_key(k): 
     122                    val[k] = {'text': '', 'class': {}} 
    121123                if val.has_key(k): 
    122124                    print ("| %s=%s" % (k, val[k]['text'])).strip() 
Note: See TracChangeset for help on using the changeset viewer.