Ticket #3840: remove-irc-constant-dups-1.patch

File remove-irc-constant-dups-1.patch, 7.5 KB (added by Jonathan Jacobs, 10 years ago)
  • irc.py

     
    22902290RPL_CREATED = '003'
    22912291RPL_MYINFO = '004'
    22922292RPL_BOUNCE = '005'
     2293RPL_TRACELINK = '200'
     2294RPL_TRACECONNECTING = '201'
     2295RPL_TRACEHANDSHAKE = '202'
     2296RPL_TRACEUNKNOWN = '203'
     2297RPL_TRACEOPERATOR = '204'
     2298RPL_TRACEUSER = '205'
     2299RPL_TRACESERVER = '206'
     2300RPL_TRACESERVICE = '207'
     2301RPL_TRACENEWTYPE = '208'
     2302RPL_TRACECLASS = '209'
     2303RPL_TRACERECONNECT = '210'
     2304RPL_STATSLINKINFO = '211'
     2305RPL_STATSCOMMANDS = '212'
     2306RPL_ENDOFSTATS = '219'
     2307RPL_UMODEIS = '221'
     2308RPL_SERVLIST = '234'
     2309RPL_SERVLISTEND = '235'
     2310RPL_STATSUPTIME = '242'
     2311RPL_STATSOLINE = '243'
     2312RPL_LUSERCLIENT = '251'
     2313RPL_LUSEROP = '252'
     2314RPL_LUSERUNKNOWN = '253'
     2315RPL_LUSERCHANNELS = '254'
     2316RPL_LUSERME = '255'
     2317RPL_ADMINME = '256'
     2318RPL_ADMINLOC = '257'
     2319RPL_ADMINLOC = '258'
     2320RPL_ADMINEMAIL = '259'
     2321RPL_TRACELOG = '261'
     2322RPL_TRACEEND = '262'
     2323RPL_TRYAGAIN = '263'
     2324RPL_AWAY = '301'
    22932325RPL_USERHOST = '302'
    22942326RPL_ISON = '303'
    2295 RPL_AWAY = '301'
    22962327RPL_UNAWAY = '305'
    22972328RPL_NOWAWAY = '306'
    22982329RPL_WHOISUSER = '311'
    22992330RPL_WHOISSERVER = '312'
    23002331RPL_WHOISOPERATOR = '313'
     2332RPL_WHOWASUSER = '314'
     2333RPL_ENDOFWHO = '315'
    23012334RPL_WHOISIDLE = '317'
    23022335RPL_ENDOFWHOIS = '318'
    23032336RPL_WHOISCHANNELS = '319'
    2304 RPL_WHOWASUSER = '314'
    2305 RPL_ENDOFWHOWAS = '369'
    23062337RPL_LISTSTART = '321'
    23072338RPL_LIST = '322'
    23082339RPL_LISTEND = '323'
    2309 RPL_UNIQOPIS = '325'
    23102340RPL_CHANNELMODEIS = '324'
     2341RPL_UNIQOPIS = '325'
    23112342RPL_NOTOPIC = '331'
    23122343RPL_TOPIC = '332'
    23132344RPL_INVITING = '341'
     
    23182349RPL_ENDOFEXCEPTLIST = '349'
    23192350RPL_VERSION = '351'
    23202351RPL_WHOREPLY = '352'
    2321 RPL_ENDOFWHO = '315'
    23222352RPL_NAMREPLY = '353'
    2323 RPL_ENDOFNAMES = '366'
    23242353RPL_LINKS = '364'
    23252354RPL_ENDOFLINKS = '365'
     2355RPL_ENDOFNAMES = '366'
    23262356RPL_BANLIST = '367'
    23272357RPL_ENDOFBANLIST = '368'
     2358RPL_ENDOFWHOWAS = '369'
    23282359RPL_INFO = '371'
     2360RPL_MOTD = '372'
    23292361RPL_ENDOFINFO = '374'
    23302362RPL_MOTDSTART = '375'
    2331 RPL_MOTD = '372'
    23322363RPL_ENDOFMOTD = '376'
    23332364RPL_YOUREOPER = '381'
    23342365RPL_REHASHING = '382'
     
    23382369RPL_USERS = '393'
    23392370RPL_ENDOFUSERS = '394'
    23402371RPL_NOUSERS = '395'
    2341 RPL_TRACELINK = '200'
    2342 RPL_TRACECONNECTING = '201'
    2343 RPL_TRACEHANDSHAKE = '202'
    2344 RPL_TRACEUNKNOWN = '203'
    2345 RPL_TRACEOPERATOR = '204'
    2346 RPL_TRACEUSER = '205'
    2347 RPL_TRACESERVER = '206'
    2348 RPL_TRACESERVICE = '207'
    2349 RPL_TRACENEWTYPE = '208'
    2350 RPL_TRACECLASS = '209'
    2351 RPL_TRACERECONNECT = '210'
    2352 RPL_TRACELOG = '261'
    2353 RPL_TRACEEND = '262'
    2354 RPL_STATSLINKINFO = '211'
    2355 RPL_STATSCOMMANDS = '212'
    2356 RPL_ENDOFSTATS = '219'
    2357 RPL_STATSUPTIME = '242'
    2358 RPL_STATSOLINE = '243'
    2359 RPL_UMODEIS = '221'
    2360 RPL_SERVLIST = '234'
    2361 RPL_SERVLISTEND = '235'
    2362 RPL_LUSERCLIENT = '251'
    2363 RPL_LUSEROP = '252'
    2364 RPL_LUSERUNKNOWN = '253'
    2365 RPL_LUSERCHANNELS = '254'
    2366 RPL_LUSERME = '255'
    2367 RPL_ADMINME = '256'
    2368 RPL_ADMINLOC = '257'
    2369 RPL_ADMINLOC = '258'
    2370 RPL_ADMINEMAIL = '259'
    2371 RPL_TRYAGAIN = '263'
    23722372ERR_NOSUCHNICK = '401'
    23732373ERR_NOSUCHSERVER = '402'
    23742374ERR_NOSUCHCHANNEL = '403'
     
    24242424ERR_UMODEUNKNOWNFLAG = '501'
    24252425ERR_USERSDONTMATCH = '502'
    24262426
    2427 # And hey, as long as the strings are already intern'd...
    2428 symbolic_to_numeric = {
    2429     "RPL_WELCOME": '001',
    2430     "RPL_YOURHOST": '002',
    2431     "RPL_CREATED": '003',
    2432     "RPL_MYINFO": '004',
    2433     "RPL_BOUNCE": '005',
    2434     "RPL_USERHOST": '302',
    2435     "RPL_ISON": '303',
    2436     "RPL_AWAY": '301',
    2437     "RPL_UNAWAY": '305',
    2438     "RPL_NOWAWAY": '306',
    2439     "RPL_WHOISUSER": '311',
    2440     "RPL_WHOISSERVER": '312',
    2441     "RPL_WHOISOPERATOR": '313',
    2442     "RPL_WHOISIDLE": '317',
    2443     "RPL_ENDOFWHOIS": '318',
    2444     "RPL_WHOISCHANNELS": '319',
    2445     "RPL_WHOWASUSER": '314',
    2446     "RPL_ENDOFWHOWAS": '369',
    2447     "RPL_LISTSTART": '321',
    2448     "RPL_LIST": '322',
    2449     "RPL_LISTEND": '323',
    2450     "RPL_UNIQOPIS": '325',
    2451     "RPL_CHANNELMODEIS": '324',
    2452     "RPL_NOTOPIC": '331',
    2453     "RPL_TOPIC": '332',
    2454     "RPL_INVITING": '341',
    2455     "RPL_SUMMONING": '342',
    2456     "RPL_INVITELIST": '346',
    2457     "RPL_ENDOFINVITELIST": '347',
    2458     "RPL_EXCEPTLIST": '348',
    2459     "RPL_ENDOFEXCEPTLIST": '349',
    2460     "RPL_VERSION": '351',
    2461     "RPL_WHOREPLY": '352',
    2462     "RPL_ENDOFWHO": '315',
    2463     "RPL_NAMREPLY": '353',
    2464     "RPL_ENDOFNAMES": '366',
    2465     "RPL_LINKS": '364',
    2466     "RPL_ENDOFLINKS": '365',
    2467     "RPL_BANLIST": '367',
    2468     "RPL_ENDOFBANLIST": '368',
    2469     "RPL_INFO": '371',
    2470     "RPL_ENDOFINFO": '374',
    2471     "RPL_MOTDSTART": '375',
    2472     "RPL_MOTD": '372',
    2473     "RPL_ENDOFMOTD": '376',
    2474     "RPL_YOUREOPER": '381',
    2475     "RPL_REHASHING": '382',
    2476     "RPL_YOURESERVICE": '383',
    2477     "RPL_TIME": '391',
    2478     "RPL_USERSSTART": '392',
    2479     "RPL_USERS": '393',
    2480     "RPL_ENDOFUSERS": '394',
    2481     "RPL_NOUSERS": '395',
    2482     "RPL_TRACELINK": '200',
    2483     "RPL_TRACECONNECTING": '201',
    2484     "RPL_TRACEHANDSHAKE": '202',
    2485     "RPL_TRACEUNKNOWN": '203',
    2486     "RPL_TRACEOPERATOR": '204',
    2487     "RPL_TRACEUSER": '205',
    2488     "RPL_TRACESERVER": '206',
    2489     "RPL_TRACESERVICE": '207',
    2490     "RPL_TRACENEWTYPE": '208',
    2491     "RPL_TRACECLASS": '209',
    2492     "RPL_TRACERECONNECT": '210',
    2493     "RPL_TRACELOG": '261',
    2494     "RPL_TRACEEND": '262',
    2495     "RPL_STATSLINKINFO": '211',
    2496     "RPL_STATSCOMMANDS": '212',
    2497     "RPL_ENDOFSTATS": '219',
    2498     "RPL_STATSUPTIME": '242',
    2499     "RPL_STATSOLINE": '243',
    2500     "RPL_UMODEIS": '221',
    2501     "RPL_SERVLIST": '234',
    2502     "RPL_SERVLISTEND": '235',
    2503     "RPL_LUSERCLIENT": '251',
    2504     "RPL_LUSEROP": '252',
    2505     "RPL_LUSERUNKNOWN": '253',
    2506     "RPL_LUSERCHANNELS": '254',
    2507     "RPL_LUSERME": '255',
    2508     "RPL_ADMINME": '256',
    2509     "RPL_ADMINLOC": '257',
    2510     "RPL_ADMINLOC": '258',
    2511     "RPL_ADMINEMAIL": '259',
    2512     "RPL_TRYAGAIN": '263',
    2513     "ERR_NOSUCHNICK": '401',
    2514     "ERR_NOSUCHSERVER": '402',
    2515     "ERR_NOSUCHCHANNEL": '403',
    2516     "ERR_CANNOTSENDTOCHAN": '404',
    2517     "ERR_TOOMANYCHANNELS": '405',
    2518     "ERR_WASNOSUCHNICK": '406',
    2519     "ERR_TOOMANYTARGETS": '407',
    2520     "ERR_NOSUCHSERVICE": '408',
    2521     "ERR_NOORIGIN": '409',
    2522     "ERR_NORECIPIENT": '411',
    2523     "ERR_NOTEXTTOSEND": '412',
    2524     "ERR_NOTOPLEVEL": '413',
    2525     "ERR_WILDTOPLEVEL": '414',
    2526     "ERR_BADMASK": '415',
    2527     "ERR_UNKNOWNCOMMAND": '421',
    2528     "ERR_NOMOTD": '422',
    2529     "ERR_NOADMININFO": '423',
    2530     "ERR_FILEERROR": '424',
    2531     "ERR_NONICKNAMEGIVEN": '431',
    2532     "ERR_ERRONEUSNICKNAME": '432',
    2533     "ERR_NICKNAMEINUSE": '433',
    2534     "ERR_NICKCOLLISION": '436',
    2535     "ERR_UNAVAILRESOURCE": '437',
    2536     "ERR_USERNOTINCHANNEL": '441',
    2537     "ERR_NOTONCHANNEL": '442',
    2538     "ERR_USERONCHANNEL": '443',
    2539     "ERR_NOLOGIN": '444',
    2540     "ERR_SUMMONDISABLED": '445',
    2541     "ERR_USERSDISABLED": '446',
    2542     "ERR_NOTREGISTERED": '451',
    2543     "ERR_NEEDMOREPARAMS": '461',
    2544     "ERR_ALREADYREGISTRED": '462',
    2545     "ERR_NOPERMFORHOST": '463',
    2546     "ERR_PASSWDMISMATCH": '464',
    2547     "ERR_YOUREBANNEDCREEP": '465',
    2548     "ERR_YOUWILLBEBANNED": '466',
    2549     "ERR_KEYSET": '467',
    2550     "ERR_CHANNELISFULL": '471',
    2551     "ERR_UNKNOWNMODE": '472',
    2552     "ERR_INVITEONLYCHAN": '473',
    2553     "ERR_BANNEDFROMCHAN": '474',
    2554     "ERR_BADCHANNELKEY": '475',
    2555     "ERR_BADCHANMASK": '476',
    2556     "ERR_NOCHANMODES": '477',
    2557     "ERR_BANLISTFULL": '478',
    2558     "ERR_NOPRIVILEGES": '481',
    2559     "ERR_CHANOPRIVSNEEDED": '482',
    2560     "ERR_CANTKILLSERVER": '483',
    2561     "ERR_RESTRICTED": '484',
    2562     "ERR_UNIQOPPRIVSNEEDED": '485',
    2563     "ERR_NOOPERHOST": '491',
    2564     "ERR_NOSERVICEHOST": '492',
    2565     "ERR_UMODEUNKNOWNFLAG": '501',
    2566     "ERR_USERSDONTMATCH": '502',
    2567 }
    25682427
    2569 numeric_to_symbolic = {}
    2570 for k, v in symbolic_to_numeric.items():
    2571     numeric_to_symbolic[v] = k
     2428symbolic_to_numeric = dict((key, value) for
     2429                           key, value in globals().iteritems()
     2430                           if key.startswith('RPL_') or key.startswith('ERR_'))
     2431numeric_to_symbolic = dict((value, key) for
     2432                           key, value in symbolic_to_numeric.iteritems())