Skip to content

Update to Python3; fix decimal handling #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion python/README → README
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Create an LC callnumber object, print out some properties:
>>> lccn.denormalized
'HE 8700.7 p6 t44 1983'
>>> lccn.normalized
'HE 870070P600T440 000 1983'
'HE 8700700P600T440 000 1983'
>>> lccn.components()
['HE', '8700.7', '.P6', 'T44', '1983']
>>> lccn.components(include_blanks=True)
Expand Down
10 changes: 5 additions & 5 deletions python/callnumber/__init__.py → callnumber/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def normalize(lc, bottom=False):
(alpha, num, dec, c1alpha, c1num,
c2alpha, c2num, c3alpha, c3num, extra) = origs

if (len(dec) > 2):
if (len(dec) > 3):
return None

if alpha and not (num or dec or c1alpha or c1num or c2alpha \
Expand All @@ -79,7 +79,7 @@ def normalize(lc, bottom=False):
topnorm = [
alpha + topspace * (3 - len(alpha)),
num + topdigit * (4 - len(num)),
dec + topdigit * (2 - len(dec)),
dec + topdigit * (3 - len(dec)),
c1alpha if c1alpha else topspace,
c1num + topdigit * (3 - len(c1num)),
c2alpha if c2alpha else topspace,
Expand All @@ -92,7 +92,7 @@ def normalize(lc, bottom=False):
bottomnorm = [
alpha + bottomspace * (3 - len(alpha)),
num + bottomdigit * (4 - len(num)),
dec + bottomdigit * (2 - len(dec)),
dec + bottomdigit * (3 - len(dec)),
c1alpha if c1alpha else bottomspace,
c1num + bottomdigit * (3 - len(c1num)),
c2alpha if c2alpha else bottomspace,
Expand All @@ -109,7 +109,7 @@ def normalize(lc, bottom=False):
bottomnorm.pop()

inds = range(1, 9)
inds.reverse()
inds = list(reversed(inds))
for i in inds:
end = topnorm.pop()
if origs[i]:
Expand All @@ -124,7 +124,7 @@ def __init__(self, callno):
try:
self.denormalized = callno.upper()
except AttributeError:
print "*** ERROR: '%s' not a string?" % (callno)
print("*** ERROR: '%s' not a string?" % (callno))
self.normalized = normalize(callno)

def __unicode__(self):
Expand Down
10 changes: 0 additions & 10 deletions perl/Library-CallNumber-LC/.cvsignore

This file was deleted.

21 changes: 0 additions & 21 deletions perl/Library-CallNumber-LC/Build.PL

This file was deleted.

36 changes: 0 additions & 36 deletions perl/Library-CallNumber-LC/Changes

This file was deleted.

11 changes: 0 additions & 11 deletions perl/Library-CallNumber-LC/MANIFEST

This file was deleted.

25 changes: 0 additions & 25 deletions perl/Library-CallNumber-LC/META.yml

This file was deleted.

15 changes: 0 additions & 15 deletions perl/Library-CallNumber-LC/Makefile.PL

This file was deleted.

52 changes: 0 additions & 52 deletions perl/Library-CallNumber-LC/README

This file was deleted.

Loading