fnp
/
librarian.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix for empty editors
[librarian.git]
/
librarian
/
dcparser.py
diff --git
a/librarian/dcparser.py
b/librarian/dcparser.py
index
07a90d7
..
e2f91a0
100644
(file)
--- a/
librarian/dcparser.py
+++ b/
librarian/dcparser.py
@@
-38,9
+38,17
@@
class Person(object):
names = [ name for name in parts[1].split() if len(name) ] # all non-whitespace tokens
return cls(surname, *names)
names = [ name for name in parts[1].split() if len(name) ] # all non-whitespace tokens
return cls(surname, *names)
+ def readable(self):
+ return u" ".join(self.first_names + (self.last_name,))
+
def __eq__(self, right):
return self.last_name == right.last_name and self.first_names == right.first_names
def __eq__(self, right):
return self.last_name == right.last_name and self.first_names == right.first_names
+ def __cmp__(self, other):
+ return cmp((self.last_name, self.first_names), (other.last_name, other.first_names))
+
+ def __hash__(self):
+ return hash((self.last_name, self.first_names))
def __unicode__(self):
if len(self.first_names) > 0:
def __unicode__(self):
if len(self.first_names) > 0: