remove leading 0s

This commit is contained in:
j 2015-03-09 14:29:20 +05:30
parent 8cea7302c6
commit 06188c7fa0

View file

@ -4,6 +4,8 @@
def get_classification(id): def get_classification(id):
name = '%s' % id name = '%s' % id
base = ''.join([s for s in id.split('/')[0].split('.')[0] if s.isdigit()]) base = ''.join([s for s in id.split('/')[0].split('.')[0] if s.isdigit()])
if base != '0':
base = base.lstrip('0')
if base in DEWEY: if base in DEWEY:
name = '%s %s' % (name, DEWEY[base].decode('utf-8')) name = '%s %s' % (name, DEWEY[base].decode('utf-8'))
return name return name