View Single Post
Old 12-19-2024, 02:31 PM   #70
maxthegold
Member
maxthegold began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Mar 2011
Location: Weston-super-Mare, U.K.
Device: Kobo Libra 2
Slight problem with the code on the previous post, here is the corrected version.

Code:
        # Do it again for capitalised words    
        m, o = regex.subn(rgx.format(key.capitalize()), new_name.capitalize(), m)
        if do_count and o:
            if n == 0:
                data['counters'][key] = 0
            data['total'] += o
            data['counters'][key] = data['counters'].get(key) + o
Rookie error, not used to Python.
maxthegold is offline   Reply With Quote