
Tc           @   sD  d  Z  d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z e j	 d d f k r d d l
 Z n  d d d f Z d Z d e f d	     YZ d
 f  d     YZ e j d  Z d f  d     YZ d e f d     YZ d e f d     YZ e j d  Z d e f d     YZ d e f d     YZ d e f d     YZ d f  d     YZ d f  d     YZ d Z d Z d  Z i d! d" 6d# d$ 6d% d& 6e e 6Z e j e d'  Z  d(   Z! d) Z" e j# e j$ e" Z% e j& e j' d* e j( d+  Z) d,   Z* d-   Z+ d.   Z, d/   Z- d0   Z. d1   Z/ d2   Z0 d3   Z1 d4   Z2 d5   Z3 d6   Z4 d7 d8  Z5 d9   Z6 i d: d; 6d< d= 6d> d? 6d@ dA 6dB dC 6dD dE 6dF dG 6dH dI 6dJ dK 6dL dM 6dN dO 6dP dQ 6dR dS 6dT dU 6dV dW 6dX dY 6dZ d[ 6d\ d] 6d^ d_ 6d` da 6db dc 6dd de 6df dg 6dh di 6dj dk 6dl dm 6dn do 6dp dq 6dr ds 6dt du 6dv dw 6dx dy 6dz d{ 6d| d} 6d~ d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d6dd6dd6dd6dd	6d
d6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6d d!6d"d#6d$d%6d&d'6d(d)6d*d+6d,d-6d.d/6d0d16d2d36d4d56d6d76d8d96d:d;6d<d=6d>d?6d@dA6dBdC6dDdE6dFdG6dHdI6dJdK6dLdM6dNdO6dPdQ6dRdS6dTdU6dVdW6dXdY6dZd[6d\d]6d^d_6d`da6dbdc6ddde6dfdg6dhdi6djdk6dldm6dndo6dpdq6drds6dtdu6Z7 dvdwdxdydzd{g Z8 d|d}d~ddddddddddg Z9 e8 e9 e7 j:   Z; d S(  s!  irclib -- Internet Relay Chat (IRC) protocol client library.

This library is intended to encapsulate the IRC protocol at a quite
low level.  It provides an event-driven IRC client framework.  It has
a fairly thorough support for the basic IRC protocol, CTCP, DCC chat,
but DCC file transfers is not yet supported.

In order to understand how to make an IRC client, I'm afraid you more
or less must understand the IRC specifications.  They are available
here: [IRC specifications].

The main features of the IRC client framework are:

  * Abstraction of the IRC protocol.
  * Handles multiple simultaneous IRC server connections.
  * Handles server PONGing transparently.
  * Messages to the IRC server are done by calling methods on an IRC
    connection object.
  * Messages from an IRC server triggers events, which can be caught
    by event handlers.
  * Reading from and writing to IRC server sockets are normally done
    by an internal select() loop, but the select()ing may be done by
    an external main loop.
  * Functions can be registered to execute at specified times by the
    event-loop.
  * Decodes CTCP tagging correctly (hopefully); I haven't seen any
    other IRC client implementation that handles the CTCP
    specification subtilties.
  * A kind of simple, single-server, object-oriented IRC client class
    that dispatches events to instance methods is included.

Current limitations:

  * The IRC protocol shines through the abstraction a bit too much.
  * Data is not written asynchronously to the server, i.e. the write()
    may block if the TCP buffers are stuffed.
  * There are no support for DCC file transfers.
  * The author haven't even read RFC 2810, 2811, 2812 and 2813.
  * Like most projects, documentation is lacking...

.. [IRC specifications] http://www.irchelp.org/irchelp/rfc/
iNi   i   i    i   i   t   IRCErrorc           B   s   e  Z d  Z RS(   s   Represents an IRC exception.(   t   __name__t
   __module__t   __doc__(    (    (    s!   /home/thedrx/pywhatauto/irclib.pyR    ]   s   t   IRCc           B   s   e  Z d  Z d d d d  Z d   Z d   Z d   Z d d  Z d d  Z	 d	 d
  Z
 d d  Z d   Z d d  Z d d  Z d d  Z d   Z d   Z RS(   s6  Class that handles one or several IRC server connections.

    When an IRC object has been instantiated, it can be used to create
    Connection objects that represent the IRC connections.  The
    responsibility of the IRC object is to provide an event-driven
    framework for the connections and to keep the connections alive.
    It runs a select loop to poll each connection's TCP socket and
    hands over the sockets with incoming data for processing by the
    corresponding connection.

    The methods of most interest for an IRC client writer are server,
    add_global_handler, remove_global_handler, execute_at,
    execute_delayed, process_once and process_forever.

    Here is an example:

        irc = irclib.IRC()
        server = irc.server()
        server.connect("irc.some.where", 6667, "my_nickname")
        server.privmsg("a_nickname", "Hi there!")
        irc.process_forever()

    This will connect to the IRC server irc.some.where on port 6667
    using the nickname my_nickname and send the message "Hi there!"
    to the nickname a_nickname.
    c         C   sn   | r! | r! | |  _  | |  _ n d |  _  d |  _ | |  _ g  |  _ i  |  _ g  |  _ |  j d t d  d S(   sE  Constructor for IRC objects.

        Optional arguments are fn_to_add_socket, fn_to_remove_socket
        and fn_to_add_timeout.  The first two specify functions that
        will be called with a socket object as argument when the IRC
        object wants to be notified (or stop being notified) of data
        coming on a new socket.  When new data arrives, the method
        process_data should be called.  Similarly, fn_to_add_timeout
        is called with a number of seconds (a floating point number)
        as first argument when the IRC object wants to receive a
        notification (by calling the process_timeout method).  So, if
        e.g. the argument is 42.17, the object wants the
        process_timeout method to be called after 42 seconds and 170
        milliseconds.

        The three arguments mainly exist to be able to use an external
        main loop (for example Tkinter's or PyGTK's main app loop)
        instead of calling the process_forever method.

        An alternative is to just call ServerConnection.process_once()
        once in a while.
        t   pingiN(	   t   fn_to_add_sockett   fn_to_remove_sockett   Nonet   fn_to_add_timeoutt   connectionst   handlerst   delayed_commandst   add_global_handlert   _ping_ponger(   t   selfR   R   R	   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   __init__~   s    							c         C   s    t  |   } |  j j |  | S(   s.   Creates and returns a ServerConnection object.(   t   ServerConnectionR
   t   append(   R   t   c(    (    s!   /home/thedrx/pywhatauto/irclib.pyt   server   s    c         C   sH   xA | D]9 } x0 |  j  D]% } | | j   k r | j   q q Wq Wd S(   s   Called when there is more data to read on connection sockets.

        Arguments:

            sockets -- A list of socket objects.

        See documentation for IRC.__init__.
        N(   R
   t   _get_sockett   process_data(   R   t   socketst   sR   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR      s    	c         C   se   t  j    } xR |  j r` | |  j d d k r\ |  j d d |  j d d   |  j d =q Pq Wd S(   s`   Called when a timeout notification is due.

        See documentation for IRC.__init__.
        i    i   i   N(   t   timeR   (   R   t   t(    (    s!   /home/thedrx/pywhatauto/irclib.pyt   process_timeout   s     i    c         C   st   t  d   |  j  } t d   |  } | rY t j | g  g  |  d } |  j |  n t j |  |  j   d S(   sc  Process data from connections once.

        Arguments:

            timeout -- How long the select() call should wait if no
                       data is available.

        This method should be called periodically to check and process
        incoming data, if there are any.  If that seems boring, look
        at the process_forever method.
        c         S   s
   |  j    S(   N(   R   (   t   x(    (    s!   /home/thedrx/pywhatauto/irclib.pyt   <lambda>   s    c         S   s
   |  d  k S(   N(   R   (   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR      s    i    N(   t   mapR
   t   filtert   selectR   R   t   sleepR   (   R   t   timeoutR   t   i(    (    s!   /home/thedrx/pywhatauto/irclib.pyt   process_once   s    g?c         C   s   x |  j  |  q d S(   s   Run an infinite loop, processing data from connections.

        This method repeatedly calls process_once.

        Arguments:

            timeout -- Parameter to pass to process_once.
        N(   R$   (   R   R"   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   process_forever   s    	t    c         C   s%   x |  j  D] } | j |  q
 Wd S(   s   Disconnects all connections.N(   R
   t
   disconnect(   R   t   messageR   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   disconnect_all   s    c         C   s@   | |  j  k r g  |  j  | <n  t j |  j  | | | f  d S(   s  Adds a global handler function for a specific event type.

        Arguments:

            event -- Event type (a string).  Check the values of the
            numeric_events dictionary in irclib.py for possible event
            types.

            handler -- Callback function.

            priority -- A number (the lower number, the higher priority).

        The handler function is called whenever the specified event is
        triggered in any of the connections.  See documentation for
        the Event class.

        The handler functions are called in priority order (lowest
        number is highest priority).  If a handler function returns
        "NO MORE", no more handlers will be called.
        N(   R   t   bisectt   insort(   R   t   eventt   handlert   priority(    (    s!   /home/thedrx/pywhatauto/irclib.pyR      s    c         C   sV   | |  j  k r d Sx< |  j  | D]- } | | d k r! |  j  | j |  q! q! Wd S(   s   Removes a global handler function.

        Arguments:

            event -- Event type (a string).

            handler -- Callback function.

        Returns 1 on success, otherwise 0.
        i    i   (   R   t   remove(   R   R,   R-   t   h(    (    s!   /home/thedrx/pywhatauto/irclib.pyt   remove_global_handler  s    c         C   s!   |  j  | t j   | |  d S(   s   Execute a function at a specified time.

        Arguments:

            at -- Execute at this time (standard "time_t" time).

            function -- Function to call.

            arguments -- Arguments to give the function.
        N(   t   execute_delayedR   (   R   t   att   functiont	   arguments(    (    s!   /home/thedrx/pywhatauto/irclib.pyt
   execute_at  s    c         C   sC   t  j |  j | t j   | | f  |  j r? |  j |  n  d S(   s   Execute a function after a specified time.

        Arguments:

            delay -- How many seconds to wait.

            function -- Function to call.

            arguments -- Arguments to give the function.
        N(   R*   R+   R   R   R	   (   R   t   delayR4   R5   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR2   &  s    &	t   chatc         C   s#   t  |  |  } |  j j |  | S(   s]  Creates and returns a DCCConnection object.

        Arguments:

            dcctype -- "chat" for DCC CHAT connections or "raw" for
                       DCC SEND (or other DCC types). If "chat",
                       incoming data will be split in newline-separated
                       chunks. If "raw", incoming data is not touched.
        (   t   DCCConnectionR
   R   (   R   t   dcctypeR   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   dcc5  s    
c         C   s]   |  j  } xM | j d g   | j | j   g   D]# } | d | |  d k r2 d Sq2 Wd S(   s
   [Internal]t
   all_eventsi   s   NO MOREN(   R   t   gett	   eventtype(   R   t
   connectionR,   R0   R-   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   _handle_eventC  s    	/c         C   s3   |  j  j |  |  j r/ |  j | j    n  d S(   s
   [Internal]N(   R
   R/   R   R   (   R   R?   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   _remove_connectionJ  s    	N(    (    (   R   R   R   R   R   R   R   R   R$   R%   R)   R   R1   R6   R2   R;   R@   RA   (    (    (    s!   /home/thedrx/pywhatauto/irclib.pyR   b   s"   &					s@   ^(:(?P<prefix>[^ ]+) +)?(?P<command>[^ ]+)( *(?P<argument> .+))?t
   Connectionc           B   s8   e  Z d  Z d   Z d   Z d d  Z d d  Z RS(   s=   Base class for IRC connections.

    Must be overridden.
    c         C   s   | |  _  d  S(   N(   t	   irclibobj(   R   RC   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR   W  s    c         C   s   t  d  d  S(   Ns   Not overridden(   R    (   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR   Z  s    c         C   s   |  j  j | | |  d  S(   N(   RC   R6   (   R   R3   R4   R5   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR6   `  s    c         C   s   |  j  j | | |  d  S(   N(   RC   R2   (   R   R7   R4   R5   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR2   c  s    (    (    (   R   R   R   R   R   R6   R2   (    (    (    s!   /home/thedrx/pywhatauto/irclib.pyRB   R  s
   		t   ServerConnectionErrorc           B   s   e  Z RS(    (   R   R   (    (    (    s!   /home/thedrx/pywhatauto/irclib.pyRD   g  s   t   ServerNotConnectedErrorc           B   s   e  Z RS(    (   R   R   (    (    (    s!   /home/thedrx/pywhatauto/irclib.pyRE   j  s   s   ?
R   c           B   sK  e  Z d  Z d   Z d7 d7 d7 d d e e d  Z d   Z d   Z d   Z	 d   Z
 d	   Z d
   Z d   Z d   Z d   Z d   Z d d  Z d d  Z d   Z d d  Z d   Z d d  Z d   Z d   Z d d  Z d d  Z d d d  Z d7 d d  Z d d  Z d   Z d d  Z d7 d  Z  d   Z! d    Z" d!   Z# d d"  Z$ d#   Z% d d$  Z& d d%  Z' d&   Z( d'   Z) d d(  Z* d)   Z+ d d*  Z, d d+  Z- d d,  Z. d7 d-  Z/ d d.  Z0 d/   Z1 d0   Z2 d d1  Z3 d d2  Z4 d3   Z5 d d d4  Z6 d5   Z7 d d d6  Z8 RS(8   s   This class represents an IRC server connection.

    ServerConnection objects are instantiated by calling the server
    method on an IRC object.
    c         C   s/   t  j |  |  d |  _ d  |  _ d  |  _ d  S(   Ni    (   RB   R   t	   connectedR   t   sockett   ssl(   R   RC   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR   y  s    		R&   i    c         C   s  |  j  r |  j d  n  d |  _ i  |  _ d |  _ | |  _ | |  _ | |  _ | |  _ | pa | |  _	 | pp | |  _
 | |  _ | |  _ | |  _ t j   |  _ |
 r t j t j t j  |  _ n t j t j t j  |  _ y |  j j |  j |  j f  |  j j |  j |  j f  |	 r_t j d k rGt j |  j  |  _ q_t j |  j  |  _ n  Wn9 t j k
 r} |  j j   d |  _ t d |  n Xd |  _  |  j j  r|  j j  |  j  n  |  j r|  j! |  j  n  |  j" |  j  |  j# |  j	 |  j
  |  S(	   s  Connect/reconnect to a server.

        Arguments:

            server -- Server name.

            port -- Port number.

            nickname -- The nickname.

            password -- Password (if any).

            username -- The username.

            ircname -- The IRC name ("realname").

            localaddress -- Bind the connection to a specific local IP address.

            localport -- Bind the connection to a specific local port.

            ssl -- Enable support for ssl.

            ipv6 -- Enable support for ipv6.

        This function can be called to reconnect a closed connection.

        Returns the ServerConnection object.
        s   Changing serversR&   i   i   s   Couldn't connect to socket: %si   (   i   i   N($   RF   R'   t   previous_bufferR   t   real_server_namet   real_nicknameR   t   portt   nicknamet   usernamet   ircnamet   passwordt   localaddresst	   localportRG   t   gethostnamet	   localhostt   AF_INET6t   SOCK_STREAMt   AF_INETt   bindt   connectt   syst   version_infot   SSLt   wrap_socketRH   t   errort   closeR   RD   RC   R   t   pass_t   nickt   user(   R   R   RL   RM   RP   RN   RO   RQ   RR   RH   t   ipv6R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyRY     sJ    														c         C   s!   |  j  d  |  j j |   d S(   s   Close the connection.

        This method closes the connection permanently; after it has
        been called, the object is unusable.
        s   Closing objectN(   R'   RC   RA   (   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR_     s    c         C   s   |  j  S(   s
   [Internal](   RG   (   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR     s    c         C   s   |  j  r |  j  Sd Sd S(   s   Get the (real) server name.

        This method returns the (real) server name, or, more
        specifically, what the server calls itself.
        R&   N(   RJ   (   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   get_server_name  s    	c         C   s   |  j  S(   s   Get the (real) nick name.

        This method returns the (real) nickname.  The library keeps
        track of nick changes, so it might not be the nick name that
        was passed to the connect() method.  (   RK   (   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   get_nickname  s    c      
   C   s\  y4 |  j  r! |  j  j d  } n |  j j d  } Wn" t j k
 rX |  j d  d SX| sp |  j d  d St j |  j |  } | j	   |  _ x| D]} t
 r d G| GHn  | s q n  d } d } d } |  j t d |  j   d | g   t j |  } | j d  r<| j d  } |  j s<| |  _ q<n  | j d  rc| j d  j   } n  | j d	  r| j d	  j d
 d  } | d j   } t |  d k r| j | d  qn  | t k rt | } n  | d k rt |  |  j k r/| d |  _ q/n | d k r/| d |  _ n  | d k r| d | d }	 }
 t |
  } | d k rt |	  rd } qn t |	  rd } n d } x| D] } t |  t j k r`| d  k rd } n d } t |  } t
 rd | | |	 | f GHn  |  j t | | |	 |   | d k r| d d k r|  j t d | |	 | d   qqt
 rd | | |	 | g f GHn  |  j t | | |	 | g   qWq d }	 | d k r| d g } n- | d k r| d }	 n | d }	 | d } | d k rt |	  sd } qn  t
 r8d | | |	 | f GHn  |  j t | | |	 |   q Wd S(!   s
   [Internal]i   i   s   Connection reset by peerNs   FROM SERVER:t   all_raw_messagest   prefixt   commandt   arguments    :i   i    Ra   t   welcomet   privmsgt   noticet   pubmsgt	   pubnoticet
   privnoticet   ctcpt	   ctcpreplys2   command: %s, source: %s, target: %s, arguments: %st   ACTIONt   actiont   quitR   t   modet   umodei @  i @  (   s   privmsgs   notice(   s   privmsgs   pubmsg(   RH   t   readRG   t   recvR^   R'   t   _linesep_regexpt   splitRI   t   popt   DEBUGR   R@   t   EventRd   t   _rfc_1459_command_regexpt   matcht   groupRJ   t   lowert   lenR   t   numeric_eventst   nm_to_nRK   t   _ctcp_dequotet
   is_channelt   typet   typest	   TupleTypet   list(   R   t   new_datat   linest   lineRg   Rh   R5   t   mt   at   targetR(   t   messages(    (    s!   /home/thedrx/pywhatauto/irclib.pyR     s    					&&

c         C   sZ   |  j  j |  |  | j   |  j k rV x+ |  j | j   D] } | |  |  q< Wn  d S(   s
   [Internal]N(   RC   R@   R>   R   (   R   R,   t   fn(    (    s!   /home/thedrx/pywhatauto/irclib.pyR@   _  s    c         C   s   |  j  S(   sW   Return connection status.

        Returns true if connected, otherwise false.
        (   RF   (   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   is_connectedf  s    c         G   s   |  j  j |   d S(   sS   Add global handler.

        See documentation for IRC.add_global_handler.
        N(   RC   R   (   R   t   args(    (    s!   /home/thedrx/pywhatauto/irclib.pyR   m  s    c         G   s   |  j  j |   d S(   sY   Remove global handler.

        See documentation for IRC.remove_global_handler.
        N(   RC   R1   (   R   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR1   t  s    c         C   s   |  j  d | |  d S(   s   Send a CTCP ACTION command.Rr   N(   Rp   (   R   R   Rs   (    (    s!   /home/thedrx/pywhatauto/irclib.pyRs   {  s    c         C   s&   |  j  d j d | g  j    d S(   s   Send an ADMIN command.t    t   ADMINN(   t   send_rawt   joint   strip(   R   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   admin  s    c         C   s:   | j    } |  j | d | | r+ d | p. d f  d S(   s   Send a CTCP command.s   %s%sR   R&   N(   t   upperRk   (   R   t   ctcptypeR   t	   parameter(    (    s!   /home/thedrx/pywhatauto/irclib.pyRp     s    c         C   s   |  j  | d |  d S(   s   Send a CTCP REPLY command.s   %sN(   Rl   (   R   R   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt
   ctcp_reply  s    c         C   sz   |  j  s d Sd |  _  |  j |  y |  j j   Wn t j k
 rJ n Xd |  _ |  j t d |  j d | g   d S(   sZ   Hang up the connection.

        Arguments:

            message -- Quit message.
        Ni    R'   R&   (	   RF   Rt   RG   R_   R^   R   R@   R}   R   (   R   R(   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR'     s    			c         C   s   |  j  d |  d S(   s   Send a GLOBOPS command.s	   GLOBOPS :N(   R   (   R   t   text(    (    s!   /home/thedrx/pywhatauto/irclib.pyt   globops  s    c         C   s&   |  j  d j d | g  j    d S(   s   Send an INFO command.R   t   INFON(   R   R   R   (   R   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   info  s    c         C   s)   |  j  d j d | | g  j    d S(   s   Send an INVITE command.R   t   INVITEN(   R   R   R   (   R   Ra   t   channel(    (    s!   /home/thedrx/pywhatauto/irclib.pyt   invite  s    c         C   s   |  j  d d j |   d S(   sW   Send an ISON command.

        Arguments:

            nicks -- List of nicks.
        s   ISON R   N(   R   R   (   R   t   nicks(    (    s!   /home/thedrx/pywhatauto/irclib.pyt   ison  s    c         C   s%   |  j  d | | o d | f  d S(   s   Send a JOIN command.s	   JOIN %s%sR   N(   R   (   R   R   t   key(    (    s!   /home/thedrx/pywhatauto/irclib.pyR     s    c         C   s(   |  j  d | | | o d | f  d S(   s   Send a KICK command.s   KICK %s %s%ss    :N(   R   (   R   R   Ra   t   comment(    (    s!   /home/thedrx/pywhatauto/irclib.pyt   kick  s    c         C   sE   d } | r | d | } n  | r4 | d | } n  |  j  |  d S(   s   Send a LINKS command.t   LINKSR   N(   R   (   R   t   remote_servert   server_maskRh   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   links  s    c         C   sN   d } | r& | d d j  |  } n  | r= | d | } n  |  j |  d S(   s   Send a LIST command.t   LISTR   t   ,N(   R   R   (   R   t   channelsR   Rh   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR     s    c         C   s   |  j  d | o d |  d S(   s   Send a LUSERS command.t   LUSERSR   N(   R   (   R   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   lusers  s    c         C   s   |  j  d | | f  d S(   s   Send a MODE command.s
   MODE %s %sN(   R   (   R   R   Rh   (    (    s!   /home/thedrx/pywhatauto/irclib.pyRu     s    c         C   s   |  j  d | o d |  d S(   s   Send an MOTD command.t   MOTDR   N(   R   (   R   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   motd  s    c         C   s.   |  j  d | r" d d j |  p% d  d S(   s   Send a NAMES command.t   NAMESR   R   R&   N(   R   R   (   R   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   names  s    c         C   s   |  j  d |  d S(   s   Send a NICK command.s   NICK N(   R   (   R   t   newnick(    (    s!   /home/thedrx/pywhatauto/irclib.pyRa     s    c         C   s   |  j  d | | f  d S(   s   Send a NOTICE command.s   NOTICE %s :%sN(   R   (   R   R   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyRl     s    c         C   s   |  j  d | | f  d S(   s   Send an OPER command.s
   OPER %s %sN(   R   (   R   Ra   RP   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   oper  s    c         C   sc   t  |  t j k r7 |  j d | | o/ d |  n( |  j d d j |  | oZ d |  d S(   s   Send a PART command.s   PART R   R   N(   R   R   t
   StringTypeR   R   (   R   R   R(   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   part  s    "c         C   s   |  j  d |  d S(   s   Send a PASS command.s   PASS N(   R   (   R   RP   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR`     s    c         C   s%   |  j  d | | o d | f  d S(   s   Send a PING command.s	   PING %s%sR   N(   R   (   R   R   t   target2(    (    s!   /home/thedrx/pywhatauto/irclib.pyR     s    c         C   s%   |  j  d | | o d | f  d S(   s   Send a PONG command.s	   PONG %s%sR   N(   R   (   R   R   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   pong  s    c         C   s   |  j  d | | f  d S(   s   Send a PRIVMSG command.s   PRIVMSG %s :%sN(   R   (   R   R   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyRk      s    c         C   s$   |  j  d d j |  | f  d S(   s+   Send a PRIVMSG command to multiple targets.s   PRIVMSG %s :%sR   N(   R   R   (   R   t   targetsR   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   privmsg_many  s    c         C   s   |  j  d | o d |  d S(   s   Send a QUIT command.t   QUITs    :N(   R   (   R   R(   (    (    s!   /home/thedrx/pywhatauto/irclib.pyRt   
  s    c         C   s   |  j  d k r t d  n  yJ |  j r> |  j j | d  n |  j  j | d  t rd d G| GHn  Wn! t  j k
 r |  j d  n Xd S(   sb   Send raw string to the server.

        The string will be padded with appropriate CR LF.
        s   Not connected.s   
s
   TO SERVER:s   Connection reset by peer.N(	   RG   R   RE   RH   t   writet   sendR|   R^   R'   (   R   t   string(    (    s!   /home/thedrx/pywhatauto/irclib.pyR     s    	c         C   s%   |  j  d | | o d | f  d S(   s   Send an SQUIT command.s
   SQUIT %s%ss    :N(   R   (   R   R   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   squit"  s    c         C   s%   |  j  d | | o d | f  d S(   s   Send a STATS command.s
   STATS %s%sR   N(   R   (   R   t	   statstypeR   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   stats&  s    c         C   s   |  j  d | o d |  d S(   s   Send a TIME command.t   TIMER   N(   R   (   R   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR   *  s    c         C   s;   | d k r  |  j d |  n |  j d | | f  d S(   s   Send a TOPIC command.s   TOPIC s   TOPIC %s :%sN(   R   R   (   R   R   t	   new_topic(    (    s!   /home/thedrx/pywhatauto/irclib.pyt   topic.  s    c         C   s   |  j  d | o d |  d S(   s   Send a TRACE command.t   TRACER   N(   R   (   R   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   trace5  s    c         C   s   |  j  d | | f  d S(   s   Send a USER command.s   USER %s 0 * :%sN(   R   (   R   RN   t   realname(    (    s!   /home/thedrx/pywhatauto/irclib.pyRb   9  s    c         C   s   |  j  d d j |   d S(   s   Send a USERHOST command.s	   USERHOST R   N(   R   R   (   R   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   userhost=  s    c         C   s   |  j  d | o d |  d S(   s   Send a USERS command.t   USERSR   N(   R   (   R   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   usersA  s    c         C   s   |  j  d | o d |  d S(   s   Send a VERSION command.t   VERSIONR   N(   R   (   R   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   versionE  s    c         C   s   |  j  d |  d S(   s   Send a WALLOPS command.s	   WALLOPS :N(   R   (   R   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   wallopsI  s    c         C   s+   |  j  d | o d | | o d f  d S(   s   Send a WHO command.s   WHO%s%sR   s    oN(   R   (   R   R   t   op(    (    s!   /home/thedrx/pywhatauto/irclib.pyt   whoM  s    c         C   s   |  j  d d j |   d S(   s   Send a WHOIS command.s   WHOIS R   N(   R   R   (   R   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   whoisQ  s    c         C   s2   |  j  d | | o d | | o& d | f  d S(   s   Send a WHOWAS command.s   WHOWAS %s%s%sR   N(   R   (   R   Ra   t   maxR   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   whowasU  s    N(9   R   R   R   R   R   t   FalseRY   R_   R   Rd   Re   R   R@   R   R   R1   Rs   R   Rp   R   R'   R   R   R   R   R   R   R   R   R   Ru   R   R   Ra   Rl   R   R   R`   R   R   Rk   R   Rt   R   R   R   R   R   R   Rb   R   R   R   R   R   R   R   (    (    (    s!   /home/thedrx/pywhatauto/irclib.pyR   r  sl   	H	
					t																								t   DCCConnectionErrorc           B   s   e  Z RS(    (   R   R   (    (    (    s!   /home/thedrx/pywhatauto/irclib.pyR   [  s   R9   c           B   sP   e  Z d  Z d   Z d   Z d   Z d d  Z d   Z d   Z d   Z	 RS(	   s   This class represents a DCC connection.

    DCCConnection objects are instantiated by calling the dcc
    method on an IRC object.
    c         C   sA   t  j |  |  d |  _ d |  _ | |  _ d  |  _ d  |  _ d  S(   Ni    (   RB   R   RF   t   passiveR:   R   t   peeraddresst   peerport(   R   RC   R:   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR   e  s    				c         C   s   t  j |  |  _ | |  _ d |  _  d |  _ i  |  _ t  j  t  j t  j  |  _  d |  _	 y  |  j  j
 |  j |  j f  Wn# t  j k
 r } t d |  n Xd |  _ |  j j r |  j j |  j   n  |  S(   s   Connect/reconnect to a DCC peer.

        Arguments:
            address -- Host/IP address of the peer.

            port -- The port number to connect to.

        Returns the DCCConnection object.
        R&   i    s   Couldn't connect to socket: %si   N(   RG   t   gethostbynameR   R   R   RI   R   RW   RV   R   RY   R^   R   RF   RC   R   (   R   t   addressRL   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyRY   m  s    
					 	c         C   s   d |  _  i  |  _ t j t j t j  |  _ d |  _ yT |  j j t j t j    d f  |  j j	   \ |  _
 |  _ |  j j d  Wn# t j k
 r } t d |  n X|  S(   sK  Wait for a connection/reconnection from a DCC peer.

        Returns the DCCConnection object.

        The local IP address and port are available as
        self.localaddress and self.localport.  After connection from a
        peer, the peer address and port are available as
        self.peeraddress and self.peerport.
        R&   i   i    i
   s   Couldn't bind socket: %s(   RI   R   RG   RW   RV   R   RX   R   RS   t   getsocknameRQ   RR   t   listenR^   R   (   R   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR     s    
			%R&   c         C   s   |  j  s d Sd |  _  y |  j j   Wn t j k
 r= n Xd |  _ |  j j |  t d |  j d | g   |  j j	 |   d S(   so   Hang up the connection and close the object.

        Arguments:

            message -- Quit message.
        Ni    t   dcc_disconnectR&   (
   RF   RG   R_   R^   R   RC   R@   R}   R   RA   (   R   R(   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR'     s    				c   	   	   C   s  |  j  r |  j r |  j j   \ } \ |  _ |  _ |  j j   | |  _ d |  _ t rq d |  j |  j f GHn  |  j j	 |  t
 d |  j d d   d Sy |  j j d  } Wn" t j k
 r |  j d  d SX| s |  j d  d S|  j d k rNt j |  j |  } | d	 |  _ t |  j  d k rA|  j   d S| d	  } n	 | g } d
 } |  j } d } xi | D]a } t rd G| GHn  | g } t rd | | | | f GHn  |  j j	 |  t
 | | | |   qsWd S(   s
   [Internal]i   s   DCC connection from %s:%dt   dcc_connectNi   i   s   Connection reset by peerR8   it   dccmsgs
   FROM PEER:s2   command: %s, source: %s, target: %s, arguments: %si @  i @  (   R   RF   RG   t   acceptR   R   R_   R|   RC   R@   R}   R   Rx   R^   R'   R:   Ry   Rz   RI   R   (	   R   t   connR   t   chunksRh   Rg   R   t   chunkR5   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR     sR    !			
				c         C   s   |  j  S(   s
   [Internal](   RG   (   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR     s    c         C   sp   yH |  j  j |  |  j d k r5 |  j  j d  n  t rG d | GHn  Wn! t  j k
 rk |  j d  n Xd S(   sz   Send data to DCC peer.

        The string will be padded with appropriate LF if it's a DCC
        CHAT session.
        R8   s   
s   TO PEER: %s
s   Connection reset by peer.N(   RG   R   R:   R|   R^   R'   (   R   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyRk     s    (
   R   R   R   R   RY   R   R'   R   R   Rk   (    (    (    s!   /home/thedrx/pywhatauto/irclib.pyR9   _  s   				8	t   SimpleIRCClientc           B   sh   e  Z d  Z d   Z d   Z d   Z d d d d d e e d  Z d d  Z	 d d	  Z
 d
   Z RS(   s  A simple single-server IRC client class.

    This is an example of an object-oriented wrapper of the IRC
    framework.  A real IRC client can be made by subclassing this
    class and adding appropriate methods.

    The method on_join will be called when a "join" event is created
    (which is done when the server sends a JOIN messsage/command),
    on_privmsg will be called for "privmsg" events, and so on.  The
    handler methods get two arguments: the connection object (same as
    self.connection) and the event object.

    Instance attributes that can be used by sub classes:

        ircobj -- The IRC instance.

        connection -- The ServerConnection instance.

        dcc_connections -- A list of DCCConnection instances.
    c         C   s]   t    |  _ |  j j   |  _ g  |  _ |  j j d |  j d  |  j j d |  j d  d  S(   NR<   iR   (   R   t   ircobjR   R?   t   dcc_connectionsR   t   _dispatchert   _dcc_disconnect(   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR     s
    	c         C   s<   d | j    } t |  |  r8 t |  |  | |  n  d S(   s
   [Internal]t   on_N(   R>   t   hasattrt   getattr(   R   R   t   eR   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR     s    c         C   s   |  j  j |  d  S(   N(   R   R/   (   R   R   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR      s    R&   i    c         C   s/   |  j  j | | | | | | | | |	 |
 
 d S(   s[  Connect/reconnect to a server.

        Arguments:

            server -- Server name.

            port -- Port number.

            nickname -- The nickname.

            password -- Password (if any).

            username -- The username.

            ircname -- The IRC name.

            localaddress -- Bind the connection to a specific local IP address.

            localport -- Bind the connection to a specific local port.

            ssl -- Enable support for ssl.

            ipv6 -- Enable support for ipv6.

        This function can be called to reconnect a closed connection.
        N(   R?   RY   (   R   R   RL   RM   RP   RN   RO   RQ   RR   RH   Rc   (    (    s!   /home/thedrx/pywhatauto/irclib.pyRY   #  s    	R8   c         C   s6   |  j  j |  } |  j j |  | j | |  | S(   s   Connect to a DCC peer.

        Arguments:

            address -- IP address of the peer.

            port -- Port to connect to.

        Returns a DCCConnection instance.
        (   R   R;   R   R   RY   (   R   R   RL   R:   R;   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR   C  s    c         C   s0   |  j  j |  } |  j j |  | j   | S(   s[   Listen for connections from a DCC peer.

        Returns a DCCConnection instance.
        (   R   R;   R   R   R   (   R   R:   R;   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt
   dcc_listenS  s    
c         C   s   |  j  j   d S(   s   Start the IRC client.N(   R   R%   (   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   start]  s    N(   R   R   R   R   R   R   R   R   RY   R   R   R   (    (    (    s!   /home/thedrx/pywhatauto/irclib.pyR     s   			
R}   c           B   s>   e  Z d  Z d d  Z d   Z d   Z d   Z d   Z RS(   s    Class representing an IRC event.c         C   s:   | |  _  | |  _ | |  _ | r- | |  _ n	 g  |  _ d S(   s?  Constructor of Event objects.

        Arguments:

            eventtype -- A string describing the event.

            source -- The originator of the event (a nick mask or a server).

            target -- The target of the event (a nick or a channel).

            arguments -- Any event specific arguments.
        N(   t
   _eventtypet   _sourcet   _targett
   _arguments(   R   R>   t   sourceR   R5   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR   d  s    			c         C   s   |  j  S(   s   Get the event type.(   R   (   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR>   y  s    c         C   s   |  j  S(   s   Get the event source.(   R   (   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR   }  s    c         C   s   |  j  S(   s   Get the event target.(   R   (   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR     s    c         C   s   |  j  S(   s   Get the event arguments.(   R   (   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR5     s    N(	   R   R   R   R   R   R>   R   R   R5   (    (    (    s!   /home/thedrx/pywhatauto/irclib.pyR}   b  s   			s   s   \s   t    t   0s   
t   ns   t   rs   (.)c         C   s   t  |   }  t  |  } | j d d  } x$ d D] } | j | d |  } q1 W| j d d  } | j d d  } t j | t j  } | j |   S(   s\   Check if a nick matches a mask.

    Returns true if the nick matches, otherwise false.
    s   \s   \\s
   .$|[](){}+t   ?t   .t   *s   .*(   t	   irc_lowert   replacet   ret   compilet
   IGNORECASER   (   Ra   t   maskt   chR   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   mask_matches  s    s   -[]\`^{}s   []\^s   {}|~c         C   s   |  j  t  S(   st   Returns a lowercased string.

    The definition of lowercased comes from the IRC specification (RFC
    1459).
    (   t	   translatet   _ircstring_translation(   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR     s    c         C   s  d   } t  |  k r* t j | |   }  n  t |  k r= |  g S|  j t  } g  } d } x | t |  d k  r t | |  d k r | j | |  n  | t |  d k  r | j t | | d j d d    n  | d } q[ Wt |  d d k r| j t | d  n  | Sd S(   s  [Internal] Dequote a message according to CTCP specifications.

    The function returns a list where each element can be either a
    string (normal message) or a tuple of one or two strings (tagged
    messages).  If a tuple has only one element (ie is a singleton),
    that element is the tag; otherwise the tuple has two elements: the
    tag and the data.

    Arguments:

        message -- The message to be decoded.
    c         S   s   |  j  d  } t j | |  S(   Ni   (   R   t   _low_level_mappingR=   (   t	   match_objR  (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   _low_level_replace  s    i    i   i   R   iN(   t   _LOW_LEVEL_QUOTEt   _low_level_regexpt   subt   _CTCP_DELIMITERRz   R   R   t   tuple(   R(   R  R   R   R#   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR     s"    	*c         C   s   |  o |  d d k S(   so   Check if a string is a channel name.

    Returns true if the argument is a channel name, otherwise false.
    i    s   #&+!(    (   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR     s    c      	   C   sY   t  |   } t t t t | d ?d @| d ?d @| d ?d @| d @g   } d j |  S(   s   Convert an IP number as an integer given in ASCII
    representation (e.g. '3232235521') to an IP address string
    (e.g. '192.168.0.1').i   i   i   i   R   (   t   longR   t   strt   intR   (   t   numR   t   p(    (    s!   /home/thedrx/pywhatauto/irclib.pyt   ip_numstr_to_quad  s    "c         C   sm   t  t |  j d   } t | d d >| d d >B| d d >B| d B } | d	 d
 k ri | d	  } n  | S(   s   Convert an IP address string (e.g. '192.168.0.1') to an IP
    number as an integer given in ASCII representation
    (e.g. '3232235521').R   i    i   i   i   i   i   i   it   L(   R   R  Rz   R  (   t   quadR  R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   ip_quad_to_numstr  s
    4c         C   s   |  j  d  d S(   sR   Get the nick part of a nickmask.

    (The source of an Event is a nickmask.)
    t   !i    (   Rz   (   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR     s    c         C   s   |  j  d  d S(   sV   Get the userhost part of a nickmask.

    (The source of an Event is a nickmask.)
    R  i   (   Rz   (   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   nm_to_uh	  s    c         C   s   |  j  d  d S(   sR   Get the host part of a nickmask.

    (The source of an Event is a nickmask.)
    t   @i   (   Rz   (   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   nm_to_h  s    c         C   s$   |  j  d  d }  |  j  d  d S(   sR   Get the user part of a nickmask.

    (The source of an Event is a nickmask.)
    R  i   R  i    (   Rz   (   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   nm_to_u  s    c         C   s   t  |  d  S(   s'  Parse a nick mode string.

    The function returns a list of lists with three members: sign,
    mode and argument.  The sign is "+" or "-".  The argument is
    always None.

    Example:

    >>> irclib.parse_nick_modes("+ab-c")
    [['+', 'a', None], ['+', 'b', None], ['-', 'c', None]]
    R&   (   t   _parse_modes(   t   mode_string(    (    s!   /home/thedrx/pywhatauto/irclib.pyt   parse_nick_modes  s    c         C   s   t  |  d  S(   sZ  Parse a channel mode string.

    The function returns a list of lists with three members: sign,
    mode and argument.  The sign is "+" or "-".  The argument is
    None if mode isn't one of "b", "k", "l", "v" or "o".

    Example:

    >>> irclib.parse_channel_modes("+ab-c foo")
    [['+', 'a', None], ['+', 'b', 'foo'], ['-', 'c', None]]
    t   bklvo(   R  (   R   (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   parse_channel_modes.  s    R&   c   	      C   s  g  } d } d } |  j    } t |  d k r4 g  S| d | d } } | d d k r] g  Sx | D] } | d k r | } qd | d k r qd | | k r t |  | d k r | j | | | | g  | d } q| j | | d g  qd | j | | d g  qd W| S(   s
   [Internal]i    R&   i   s   +-R   N(   Rz   R   R   R   (	   R   t   unary_modest   modest	   arg_countt   signR   t	   mode_partR   R  (    (    s!   /home/thedrx/pywhatauto/irclib.pyR  =  s*    	c         C   s   |  j  | j    d S(   s
   [Internal]N(   R   R   (   R?   R,   (    (    s!   /home/thedrx/pywhatauto/irclib.pyR   ]  s    Rj   t   001t   yourhostt   002t   createdt   003t   myinfot   004t   featurelistt   005t	   tracelinkt   200t   traceconnectingt   201t   tracehandshaket   202t   traceunknownt   203t   traceoperatort   204t	   traceusert   205t   traceservert   206t   traceservicet   207t   tracenewtypet   208t
   traceclasst   209t   tracereconnectt   210t   statslinkinfot   211t   statscommandst   212t
   statsclinet   213t
   statsnlinet   214t
   statsilinet   215t
   statsklinet   216t
   statsqlinet   217t
   statsylinet   218t
   endofstatst   219t   umodeist   221t   serviceinfot   231t   endofservicest   232t   servicet   233t   servlistt   234t   servlistendt   235t
   statsllinet   241t   statsuptimet   242t
   statsolinet   243t
   statshlinet   244t
   luserconnst   250t   luserclientt   251t   luseropt   252t   luserunknownt   253t   luserchannelst   254t   lusermet   255t   adminmet   256t	   adminloc1t   257t	   adminloc2t   258t
   adminemailt   259t   tracelogt   261t
   endoftracet   262t   tryagaint   263t   n_localt   265t   n_globalt   266t   nonet   300t   awayt   301R   t   302R   t   303t   unawayt   305t   nowawayt   306t	   whoisusert   311t   whoisservert   312t   whoisoperatort   313t
   whowasusert   314t   endofwhot   315t   whoischanopt   316t	   whoisidlet   317t
   endofwhoist   318t   whoischannelst   319t	   liststartt   321R   t   322t   listendt   323t   channelmodeist   324t   channelcreatet   329t   notopict   331t   currenttopict   332t	   topicinfot   333t   invitingt   341t	   summoningt   342t
   invitelistt   346t   endofinvitelistt   347t
   exceptlistt   348t   endofexceptlistt   349R   t   351t   whoreplyt   352t   namreplyt   353t   killdonet   361t   closingt   362t   closeendt   363R   t   364t
   endoflinkst   365t
   endofnamest   366t   banlistt   367t   endofbanlistt   368t   endofwhowast   369R   t   371R   t   372t	   infostartt   373t	   endofinfot   374t	   motdstartt   375t	   endofmotdt   376t   motd2t   377t	   youreopert   381t	   rehashingt   382t   myportist   384R   t   391t
   usersstartt   392R   t   393t
   endofuserst   394t   nouserst   395t
   nosuchnickt   401t   nosuchservert   402t   nosuchchannelt   403t   cannotsendtochant   404t   toomanychannelst   405t   wasnosuchnickt   406t   toomanytargetst   407t   noorigint   409t   norecipientt   411t   notexttosendt   412t
   notoplevelt   413t   wildtoplevelt   414t   unknowncommandt   421t   nomotdt   422t   noadmininfot   423t	   fileerrort   424t   nonicknamegivent   431t   erroneusnicknamet   432t   nicknameinuset   433t   nickcollisiont   436t   unavailresourcet   437t   usernotinchannelt   441t   notonchannelt   442t   useronchannelt   443t   nologint   444t   summondisabledt   445t   usersdisabledt   446t   notregisteredt   451t   needmoreparamst   461t   alreadyregisteredt   462t   nopermforhostt   463t   passwdmismatcht   464t   yourebannedcreept   465t   youwillbebannedt   466t   keysett   467t   channelisfullt   471t   unknownmodet   472t   inviteonlychant   473t   bannedfromchant   474t   badchannelkeyt   475t   badchanmaskt   476t   nochanmodest   477t   banlistfullt   478t   noprivilegest   481t   chanoprivsneededt   482t   cantkillservert   483t
   restrictedt   484t   uniqopprivsneededt   485t
   nooperhostt   491t   noservicehostt   492t   umodeunknownflagt   501t   usersdontmatcht   502R   R   R   R'   Rp   Rq   R^   R   R   Ru   R   R   Rk   Ro   Rm   Rn   Rt   R   R   (<   R   R*   R  R    RG   R   RZ   R   R   R[   RH   R\   R   R|   t	   ExceptionR    R   R  R~   RB   RD   RE   Ry   R   R   R9   R   R}   R  t   _CTCP_LEVEL_QUOTER  R	  R  R  t   _specialt   ascii_letterst   digitst   nick_characterst	   maketranst   ascii_uppercaset   ascii_lowercaseR  R   R   R   R  R  R   R  R  R  R!  R#  R  R   R   t   generated_eventst   protocol_eventst   valuesR<   (    (    (    s!   /home/thedrx/pywhatauto/irclib.pyt   <module>>   s   d'
			6				
						 	
		