actions, move parse_decimal

This commit is contained in:
j 2010-12-22 20:47:38 +05:30
commit 07dcc77950
7 changed files with 44 additions and 33 deletions

View file

@ -3,6 +3,7 @@
# vi:si:et:sw=4:sts=4:ts=4
#
import errno
from decimal import Decimal
import os
import sys
import re
@ -14,6 +15,13 @@ import ox.iso
from ox.normalize import normalizeName, normalizeTitle, canonicalTitle
def parse_decimal(string):
string = string.replace(':', '/')
if '/' not in string:
string = '%s/1' % string
d = string.split('/')
return Decimal(d[0]) / Decimal(d[1])
def plural_key(term):
return {
'country': 'countries',