All pastes #296528 Raw Edit

Unnamed

public python v1 · immutable
#296528 ·published 2006-12-30 08:19 UTC
rendered paste body
 if cmd[1].lower() == 'username':      if self.accessOf(userC) >= 50:        blkM = re.search('(.*)',string.join(cmd[2:],' '))        if blkM:          usr = blkM.group(1)          self.sync_msg(CHANNEL,'ACK! Will \002block\002 [[User talk:%s]] for username".' % (usr))          try:            admin.blockUser(site,usr,'indefinite','Please read our our [[WP:USERNAME|username policy]] and choose another name {{usernameblocked}}',EnableAutoblock=0)          except admin.BlockError:            admin.blockUser(site,usr,'indefinite','Please read our our [[WP:USERNAME|username policy]] and choose another name {{usernameblocked}}',EnableAutoblock=0)          pg_ = wikipedia.Page(site,'User:%s' % (usr))          wikipedia.setAction('Blocked user')          talk = pg_.switchTalkPage()          content = talk.get() + "\n"          content += '{{Username}} ~~~~'           talk.put(content,minorEdit=False)          else:          self.sync_msg(channel,'%s: the syntax is: Username Username' % user0)