projects
/
irker.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0a23831
)
irkerd: Add Target.__str__ for pretty-printing targets in log messages
author
W. Trevor King
<wking@tremily.us>
Fri, 7 Mar 2014 04:21:07 +0000
(20:21 -0800)
committer
Eric S. Raymond
<esr@thyrsus.com>
Tue, 11 Mar 2014 04:43:46 +0000
(
00:43
-0400)
Prefer the servername, falling back to the URL, falling back to
Target.__repr__().
irkerd
patch
|
blob
|
history
diff --git
a/irkerd
b/irkerd
index c5fc1aee6d4b31b2d08c36f578d1013b6624dc4b..bad14f96ba863774b0235eefb0361faee21ead70 100755
(executable)
--- a/
irkerd
+++ b/
irkerd
@@
-640,6
+640,11
@@
class Target():
if parsed.query:
self.key = re.sub("^key=", "", parsed.query)
self.port = int(ircport)
+
+ def __str__(self):
+ "Represent this instance as a string"
+ return self.servername or self.url or repr(self)
+
def validate(self):
"Raise InvalidRequest if the URL is missing a critical component"
if not self.servername: