1.1 --- a/referencing.py Sat Feb 04 18:10:20 2017 +0100
1.2 +++ b/referencing.py Sat Feb 04 22:26:23 2017 +0100
1.3 @@ -3,7 +3,7 @@
1.4 """
1.5 Reference abstractions.
1.6
1.7 -Copyright (C) 2016 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2016, 2017 Paul Boddie <paul@boddie.org.uk>
1.9
1.10 This program is free software; you can redistribute it and/or modify it under
1.11 the terms of the GNU General Public License as published by the Free Software
1.12 @@ -187,6 +187,15 @@
1.13
1.14 return self.get_name().rsplit(".", 1)[0]
1.15
1.16 + def leaf(self):
1.17 +
1.18 + "Return the leafname of the reference's origin."
1.19 +
1.20 + if not self.get_origin():
1.21 + return None
1.22 +
1.23 + return self.get_origin().rsplit(".", 1)[-1]
1.24 +
1.25 def ancestors(self):
1.26
1.27 """