@@ -37,17 +37,19 @@ def extract_name(l):
3737 terminator )
3838
3939 def who (self , data ):
40+ """Displays who is on currently connected to this server."""
4041 who = [w .colored_name (self .config .colors ) for w in self .player_manager .who ()]
4142 self .protocol .send_chat_message ("Players online: %s" % " " .join (who ))
4243 return False
4344
4445 def planet (self , data ):
45- """Displays who is on your current planet"""
46+ """Displays who is on your current planet. """
4647 who = [w .colored_name (self .config .colors ) for w in self .player_manager .who () if w .planet == self .protocol .player .planet and not w .on_ship ]
4748 self .protocol .send_chat_message ("Players on your current planet: %s" % " " .join (who ))
4849
4950 @permissions (UserLevels .ADMIN )
5051 def whois (self , data ):
52+ """Displays information on a given user.\n Usage: /whois username"""
5153 name = " " .join (data )
5254 info = self .player_manager .whois (name )
5355 if info :
@@ -61,7 +63,10 @@ def whois(self, data):
6163
6264 @permissions (UserLevels .MODERATOR )
6365 def promote (self , data ):
64- usage = "Usage: /promote playername rank (where rank is in one of registered, moderator, admin[, guest])"
66+ """Promotes a player to a given UserLevel.
67+ Usage: /promote playername rank (where rank is in one of registered, moderator, admin[, guest])
68+ """
69+ usage = self .promote .__doc__
6570 if len (data ) > 0 :
6671 name = " " .join (data [:- 1 ])
6772 rank = data [- 1 ].lower ()
@@ -77,7 +82,7 @@ def promote(self, data):
7782 elif rank == "guest" :
7883 self .make_guest (player )
7984 else :
80- self .protocol .send_chat_message ("No such rank!\n " + usage )
85+ self .protocol .send_chat_message ("No such rank!\n " + self . promote . __doc__ )
8186 return
8287
8388 self .protocol .send_chat_message ("%s: %s -> %s" % (
@@ -86,10 +91,10 @@ def promote(self, data):
8691 self .protocol .factory .protocols [player .protocol ].send_chat_message ("%s has promoted you to %s" % (
8792 player .colored_name (self .config .colors ), rank .upper ()))
8893 else :
89- self .protocol .send_chat_message ("Player not found!\n " + usage )
94+ self .protocol .send_chat_message ("Player not found!\n " + self . promote . __doc__ )
9095 return
9196 else :
92- self .protocol .send_chat_message (usage )
97+ self .protocol .send_chat_message (self . promote . __doc__ )
9398
9499 @permissions (UserLevels .OWNER )
95100 def make_guest (self , player ):
@@ -115,7 +120,7 @@ def make_admin(self, player):
115120
116121 @permissions (UserLevels .MODERATOR )
117122 def kick (self , data ):
118- """Kicks a user from the server. Syntax : /kick [username] [reason]"""
123+ """Kicks a user from the server. Usage : /kick [username] [reason]"""
119124 name , reason = self .extract_name (data )
120125 if reason is None :
121126 reason = "no reason given"
0 commit comments