Uname:Linux server17213-10344.hostycare.online 5.14.0-687.38.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Aug 12 17:19:12 EDT 2026 x86_64

403WebShell
403Webshell
Server IP : 103.243.232.44  /  Your IP : 216.73.216.237
Web Server : LiteSpeed
System : Linux server17213-10344.hostycare.online 5.14.0-687.38.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Aug 12 17:19:12 EDT 2026 x86_64
User : iamakash ( 1400)
PHP Version : 8.1.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib64/gedit/plugins/externaltools/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib64/gedit/plugins/externaltools/__pycache__/linkparsing.cpython-39.pyc
a

A�T`��@sdddlZGdd�d�ZGdd�d�ZGdd�de�ZGdd	�d	e�Zd
ZdZdZd
Z	dZ
dZdZdS)�Nc@s eZdZdZdd�Zdd�ZdS)�Linka
    This class represents a file link from within a string given by the
    output of some software tool. A link contains a reference to a file, the
    line number within the file and the boundaries within the given output
    string that should be marked as a link.
    cCs*||_t|�|_t|�|_||_||_dS)a6
        path -- the path of the file (that could be extracted)
        line_nr -- the line nr of the specified file
        col_nr -- the col nr of the specific file
        start -- the index within the string that the link starts at
        end -- the index within the string where the link ends at
        N)�path�int�line_nr�col_nr�start�end)�selfrrrrr�r
�5/usr/lib64/gedit/plugins/externaltools/linkparsing.py�__init__s


z
Link.__init__cCsd|j|j|j|j|jfS)Nz%s[%s][%s](%s:%s))rrrrr�r	r
r
r�__repr__,s�z
Link.__repr__N)�__name__�
__module__�__qualname__�__doc__rrr
r
r
rrsrc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�
LinkParseraL
    Parses a text using different parsing providers with the goal of finding one
    or more file links within the text. A typical example could be the output
    from a compiler that specifies an error in a specific file. The path of the
    file, the line nr and some more info is then returned so that it can be used
    to be able to navigate from the error output in to the specific file.

    The actual work of parsing the text is done by instances of classes that
    inherits from AbstractLinkParser or by regular expressions. To add a new
    parser just create a class that inherits from AbstractLinkParser and then
    register in this class cunstructor using the method add_parser. If you want
    to add a regular expression then just call add_regexp in this class
    constructor and provide your regexp string as argument.
    cCsPg|_|�t�|�t�|�t�|�t�|�t�|�t�|�t�dS�N)	�
_providers�
add_regexp�REGEXP_STANDARD�
REGEXP_PYTHON�REGEXP_VALAC�REGEXP_BASH�REGEXP_RUBY�REGEXP_PERL�
REGEXP_MCSr
r
r
rrAs





zLinkParser.__init__cCs|j�|�dSr)r�append)r	�parserr
r
r�
add_parserKszLinkParser.add_parsercCs|�t|��dS)a�
        Adds a regular expression string that should match a link using
        re.MULTILINE and re.VERBOSE regexp. The area marked as a link should
        be captured by a group named lnk. The path of the link should be
        captured by a group named pth. The line number should be captured by
        a group named ln. To read more about this look at the documentation
        for the RegexpLinkParser constructor.
        N)r �RegexpLinkParser)r	Zregexpr
r
rrNs	zLinkParser.add_regexpcCs4|durtd��g}|jD]}|�|�|��q|S)a[
        Parses the given text and returns a list of links that are parsed from
        the text. This method delegates to parser providers that can parse
        output from different kinds of formats. If no links are found then an
        empty list is returned.

        text -- the text to scan for file links. 'text' can not be None.
        Nztext can not be None)�
ValueErrorr�extend�parse)r	�text�linksZproviderr
r
rr$Ys	
zLinkParser.parseN)rrrrrr rr$r
r
r
rr1s

rc@seZdZdZdd�ZdS)�AbstractLinkParserz)The "abstract" base class for link parsescCstd��dS)a�
        This method should be implemented by subclasses. It takes a text as
        argument (never None) and then returns a list of Link objects. If no
        links are found then an empty list is expected. The Link class is
        defined in this module. If you do not override this method then a
        NotImplementedError will be thrown.

        text -- the text to parse. This argument is never None.
        z need to implement a parse methodN)�NotImplementedError)r	r%r
r
rr$ps
zAbstractLinkParser.parseN)rrrrr$r
r
r
rr'msr'c@s eZdZdZdd�Zdd�ZdS)r!z�
    A class that represents parsers that only use one single regular expression.
    It can be used by subclasses or by itself. See the constructor documentation
    for details about the rules surrouning the regexp.
    cCst�|tjtjB�|_dS)a�
        Creates a new RegexpLinkParser based on the given regular expression.
        The regular expression is multiline and verbose (se python docs on
        compilation flags). The regular expression should contain three named
        capturing groups 'lnk', 'pth' and 'ln'. 'lnk' represents the area wich
        should be marked as a link in the text. 'pth' is the path that should
        be looked for and 'ln' is the line number in that file.
        N)�re�compile�	MULTILINE�VERBOSE)r	Zregexr
r
rr�s	zRegexpLinkParser.__init__cCs�g}t�|j|�D]v}|��}|�d�}|�d�}|�d�}|�d�}t|�dkrj|ddkrj|�d�}	nd}	t|||	||�}
|�|
�q|S)NZpthZlnZlnk��colr)	r)�finditer�groups�grouprr�lenrr)r	r%r&�mr0rrrrr�linkr
r
rr$�s



zRegexpLinkParser.parseN)rrrrrr$r
r
r
rr!}sr!zv
^
(?:\[(?:error|warn)\]\ )?
(?P<lnk>
    (?P<pth> [^ \:\n]* )
    \:
    (?P<ln> \d+)
    \:?
    (?P<col> \d+)?
)
\:zV
^\s\sFile\s
(?P<lnk>
    \"
    (?P<pth> [^\"]+ )
    \",\sline\s
    (?P<ln> \d+ )
)zA
^(?P<lnk>
    (?P<pth> .* )
    \:\sline\s
    (?P<ln> \d+ )
)\:zj
^(?P<lnk>
    (?P<pth>
        .*vala
    )
    \:
    (?P<ln>
        \d+
    )
    \.\d+-\d+\.\d+
 )\: zZ
^\s+from\s
(?P<lnk>
    (?P<pth>
        .*
    )
    \:
    (?P<ln>
        \d+
    )
 )zC
\sat\s
(?P<lnk>
    (?P<pth> .* )
    \sline\s
    (?P<ln> \d+ )
)zK
^
(?P<lnk>
    (?P<pth> \S+ )
    \(
    (?P<ln> \d+ )
    ,\d+\)
)
\:?\s
)
r)rr�objectr'r!rrrrrrrr
r
r
r�<module>s<.




Youez - 2016 - github.com/yon3zu
LinuXploit