remove leading 0s

This commit is contained in:
j 2015-03-09 14:29:20 +05:30
parent 8cea7302c6
commit 06188c7fa0
1 changed files with 2 additions and 0 deletions

View File

@ -4,6 +4,8 @@
def get_classification(id):
name = '%s' % id
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:
name = '%s %s' % (name, DEWEY[base].decode('utf-8'))
return name