clean up some IrcAdmin output, which i was using to test reloading
This commit is contained in:
		
							parent
							
								
									e0565a9bb1
								
							
						
					
					
						commit
						467c72847a
					
				| @ -86,7 +86,7 @@ class IrcAdmin(Module): | |||||||
|         channel = whats[1] |         channel = whats[1] | ||||||
|         if irclib.is_channel(channel): |         if irclib.is_channel(channel): | ||||||
|             connection.join(channel) |             connection.join(channel) | ||||||
|             replystr = 'joined ' + channel |             replystr = 'Joined ' + channel + '.' | ||||||
|             return self.reply(connection, replypath, replystr) |             return self.reply(connection, replypath, replystr) | ||||||
| 
 | 
 | ||||||
|     def sub_part_channel(self, connection, event, nick, userhost, replypath, what, admin_unlocked): |     def sub_part_channel(self, connection, event, nick, userhost, replypath, what, admin_unlocked): | ||||||
| @ -95,14 +95,14 @@ class IrcAdmin(Module): | |||||||
|         channel = whats[1] |         channel = whats[1] | ||||||
|         if irclib.is_channel(channel): |         if irclib.is_channel(channel): | ||||||
|             connection.part(channel, ' '.join(whats[2:])) |             connection.part(channel, ' '.join(whats[2:])) | ||||||
|             replystr = 'parted ' + channel |             replystr = 'Parted ' + channel + '.' | ||||||
|             return self.reply(connection, replypath, replystr) |             return self.reply(connection, replypath, replystr) | ||||||
| 
 | 
 | ||||||
|     def sub_quit_irc(self, connection, event, nick, userhost, replypath, what, admin_unlocked): |     def sub_quit_irc(self, connection, event, nick, userhost, replypath, what, admin_unlocked): | ||||||
|         whats = what.split(' ') |         whats = what.split(' ') | ||||||
| 
 | 
 | ||||||
|         if replypath is not None: |         if replypath is not None: | ||||||
|             connection.privmsg(replypath, 'quitting') |             connection.privmsg(replypath, 'Quitting...') | ||||||
|         connection.quit(' '.join(whats[1:])) |         connection.quit(' '.join(whats[1:])) | ||||||
|         self.save_config() |         self.save_config() | ||||||
|         sys.exit() |         sys.exit() | ||||||
| @ -118,7 +118,7 @@ class IrcAdmin(Module): | |||||||
|                     channelset = set(self.config.get(self.__class__.__name__, 'autojoin').split(',')) |                     channelset = set(self.config.get(self.__class__.__name__, 'autojoin').split(',')) | ||||||
|                     channelset.add(channel) |                     channelset.add(channel) | ||||||
|                     self.config.set(self.__class__.__name__, 'autojoin', ','.join(channelset)) |                     self.config.set(self.__class__.__name__, 'autojoin', ','.join(channelset)) | ||||||
|                     replystr = 'added ' + channel + ' to autojoin' |                     replystr = 'Added ' + channel + ' to autojoin.' | ||||||
|                     return self.reply(connection, replypath, replystr) |                     return self.reply(connection, replypath, replystr) | ||||||
|             except NoOptionError: pass |             except NoOptionError: pass | ||||||
|         elif whats[1] == 'remove': |         elif whats[1] == 'remove': | ||||||
| @ -129,14 +129,14 @@ class IrcAdmin(Module): | |||||||
|                     channelset = set(self.config.get(self.__class__.__name__, 'autojoin').split(',')) |                     channelset = set(self.config.get(self.__class__.__name__, 'autojoin').split(',')) | ||||||
|                     channelset.discard(channel) |                     channelset.discard(channel) | ||||||
|                     self.config.set(self.__class__.__name__, 'autojoin', ','.join(channelset)) |                     self.config.set(self.__class__.__name__, 'autojoin', ','.join(channelset)) | ||||||
|                     replystr = 'removed ' + channel + ' from autojoin' |                     replystr = 'Removed ' + channel + ' from autojoin.' | ||||||
|                     return self.reply(connection, replypath, replystr) |                     return self.reply(connection, replypath, replystr) | ||||||
|             except NoOptionError: pass |             except NoOptionError: pass | ||||||
| 
 | 
 | ||||||
|     def sub_save_config(self, connection, event, nick, userhost, replypath, what, admin_unlocked): |     def sub_save_config(self, connection, event, nick, userhost, replypath, what, admin_unlocked): | ||||||
|         with open('dr.botzo.cfg', 'w') as cfg: |         with open('dr.botzo.cfg', 'w') as cfg: | ||||||
|             self.config.write(cfg) |             self.config.write(cfg) | ||||||
|         replystr = 'saved config file' |         replystr = 'Saved config file.' | ||||||
|         return self.reply(connection, replypath, replystr) |         return self.reply(connection, replypath, replystr) | ||||||
| 
 | 
 | ||||||
|     def sub_change_nick(self, connection, event, nick, userhost, replypath, what, admin_unlocked): |     def sub_change_nick(self, connection, event, nick, userhost, replypath, what, admin_unlocked): | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user