remove leading 0s
This commit is contained in:
parent
8cea7302c6
commit
06188c7fa0
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue