ó n[Qc@s)ddlZddlZddlmZddlmZddlmZddlmZmZm Z m Z m Z m Z ddlm Z ddlmZddlmZdd lmZdd lmZdd lmZd „Zeejjejd ƒddeƒZeeƒejddddddddeddƒejddddddeddƒejddddedd dgdd!ƒejd"dddedd dgdd#ƒejd$dddedd dgdd%ƒeed&d'ƒeeeƒxseee e e e fD]YZejd(ejƒdd)d)ed*efdd+d,d-d.d/dgdd0jeƒƒqWejd1dd2dddd3ƒej!ƒ\Z"Z#e"j$r»ee"_%ne"j&dksße'e"j&ƒd krùe"j% rùej(d4ƒn=e"j&dk r6e'e"j&ƒd kr6e"j%r6ej(d5ƒne'e"j)ƒd kr^e"j)j*eƒnyde e"j+e"j)e"j,d2e"j-ƒZ.e"j%r¨e.j/e"j$ƒj0ƒGHne.j1e"j&d6e"jƒWnYek rîZ2ej3d7IJe4d8ƒn0e5k rZ2ej3d9Ie2IJe4d:ƒnXe4ƒdS(;iÿÿÿÿN(tKILL_CONNECTION(t KILL_QUERY(t PRINT_PROCESS(tUSERtHOSTtDBtCOMMANDtINFOtSTATE(t ProcessGrep(tEmptyResultError(t add_regexp(tsetup_common_options(t add_verbosity(tadd_format_optioncCs]||f}y t|j|jƒj|ƒWn*tk rXt|j|j|gƒnXdS(N(tgetattrtvaluestdesttappendtAttributeErrortsetattr(toptiontopttvaluetparsertfieldtentry((s%..\utilities\scripts\mysqlprocgrep.pyt add_pattern#s    is*mysqlprocgrep - search process informations3%prog --server=user:pass@host:port:socket [options]s-Qs --print-sqls--sqlRt print_sqltactiont store_truetdefaultthelps¡print the statement instead of sending it to the server. If a kill option is submitted, a procedure will be generated containing the code for executing the kill.s --sql-bodytsql_bodys%only print the body of the procedure.s--kill-connectiont append_consttconsttactionsskill all matching connections.s --kill-querys&kill query for all matching processes.s--printsprint all matching processes.sIdisplay the output in either grid (default), tab, csv, or vertical formattgrids--match-tcallbackt callback_argstmatchesttypetstringtmetavartPATTERNs/match the '{0}' column of the PROCESSLIST tables--agetagesNshow only processes that have been in the current state more than a given timesAYou need at least one server if you're not using the --sql optionsLYou should not include servers in the call if you are using the --sql optiontformats No matchesisERROR:i(6tos.pathtostsystmysql.utilities.command.procRRRRRRRRRR tmysql.utilities.exceptionR tmysql.utilities.common.optionsR R R RRtpathtbasenametargvtTrueRt add_optiontFalsetcoltlowerR.tNonet parse_argstoptionstargsR!RtservertlenterrorR$RR(t use_regexpR-tcommandtsqltstriptexecutetdetailststderrtexitt Exception(((s%..\utilities\scripts\mysqlprocgrep.pyts–  .               .-