Server IP : 180.180.241.3 / Your IP : 216.73.216.252 Web Server : Microsoft-IIS/7.5 System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586 User : IUSR ( 0) PHP Version : 5.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Program Files (x86)/MySQL/MySQL Workbench 6.1 CE/modules/ |
Upload File : |
,2Sc @ s d Z d d l Z d d l m Z m Z d d l m Z m Z m Z d d l m Z m Z m Z d d l m Z d e f d YZ d e f d YZ d e f d YZ d e f d YZ d e f d YZ d e f d YZ d e f d YZ d S( s .. module:: wb_log_reader :synopsis: Reads and parses a log source to retrieve sets of records from it. This module defines several classes to handle MySQL server logs. It supports logs stored in the database as well as logs stored in files. All of the defined classes adhere to a common interface defining and implementing these public attributes and methods: Attributes: column_specs (tuple): Specifies each field in the log entries. The elements of this tuple are also tuples having the form (column_name, column_widh, [column_table_name]) where: column_name (str): A human readable name for the column. Frontend code should use this name wherever a column title is needed. column_width (int): The recommended with of the column column_table_name (str): (Optional) the name of the field referred by this column in the log table for DB logs partial_support: False if the log source is fully supported or a string explaining the limitations regarding the implemented log source reader class otherwise. Methods: has_previous(): Returns True if there are older entries that can be retrieved and False otherwise. has_next(): Returns True if there are newer entries that can be retrieved and False otherwise. first(): Returns a list of the first (oldest) records in the log. Each element in this list represents a single log entry and is also a list whose elements are the values for the columns defined in `column_specs`. last(): The same as `first()` but the records returned are the newest ones. previous(): Returns the records that precede the last retrieved records. Before calling it you should verify that `has_previous()` returns True. next(): Returns the records that follow the last retrieved records. Before calling it you should verify that `has_next()` returns True. current(): Returns the last retrieved records. range_text(): Returns a string that gives an indication of the position of the current records in the existent log set (if available). E.g. 'Records 1..50 of 145' refresh(): After calling this function the log reader should be able to manage new log entries that were added since the last call to this function or since the creation of the log reader object. This function doesn't return anything. If it is not possible to read the log entries, the class should raise an exception with a descriptive message to let the user know the reasons of the failure. Current limitations: ---------------------- * No remote server support for logs stored in files. * Cannot read files that aren't readable by the user running Workbench. iN( t log_infot log_error( t SudoTailInputFilet LocalInputFilet SFTPInputFile( t LogFileAccessErrort ServerIOErrort InvalidPasswordError( t server_os_patht BaseQueryLogReaderc B sz e Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z RS( so The base class for logs stored in a database. **This is not intended for direct instantiation.** c C s | | _ d | _ | | _ | | _ | | _ t | _ d | _ | j d | _ t | j | j d | _ g | D] } | d ^ qu | _ d S( s Constructor :param ctrl_be: Control backend instance to make queries :param log_table: The name of the table where the log entries are stored :type log_table: str :param column_specs: Column definitions as explained in the module docstring :type column_specs: tuple :param ordering_column: The index for the column in `column_specs` that stores the timestamp of the log entries :type ordering_column: int i i2 i N( t log_tablet Nonet log_filet ctrl_bet column_specst ordering_columnt Falset partial_supportt total_countt refresht show_countt maxt show_startt colnames( t selfR R R R t colspec( ( sL C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_log_reader.pyt __init__n s c C s | j d k S( Ni ( R ( R ( ( sL C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_log_reader.pyt has_previous s c C s | j | j d k S( Ni ( R R ( R ( ( sL C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_log_reader.pyt has_next s c C s | j S( N( t _query_records( R ( ( sL C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_log_reader.pyt current s c C s&