403Webshell
Server IP : 93.86.61.54  /  Your IP : 216.73.216.60
Web Server : Apache/2.4.62 (Ubuntu)
System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64
User : www-data ( 33)
PHP Version : 8.4.22
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/UpdateManager/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/UpdateManager/__pycache__/ChangelogViewer.cpython-310.pyc
o

{��f�0�@s�ddlmZddlZe�dd�ddlmZddlmZddlmZddlmZdd	l	m	Z
dd
lmZGdd�dej
�Zed
krie��Ze�Ze��Zejdejjd�e�d�e�e�e��e��dSdS)�)�absolute_importN�Gtkz3.0)r)�Gdk)�GObject)�Pango)�gettext)�open_urlc@sVeZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�ZdS)�ChangelogViewerNcCs�tj�|�d|_d|_|�dd�|�d�|�d�|�d�|�d�|�	d�t
��|_|�
|j�|�d|j�|�d|j�|�d|j�|j�d|j�|d	ur_|j�|�d	Sd	S)
z>Init the ChangelogViewer as an Inheritance of the Gtk.TextViewFT�editable�zbutton-press-eventzmotion-notify-eventzvisibility-notify-eventzinsert-textN)r�__init__�hovering�first�set_property�set_cursor_visible�set_right_margin�set_left_margin�set_pixels_above_lines�set_vexpandr�
TextBuffer�buffer�
set_buffer�connect�button_press_event�motion_notify_event�visibility_notify_event�
connect_after�on_insert_text�set_text)�self�	changelog�r!�?/usr/lib/python3/dist-packages/UpdateManager/ChangelogViewer.pyr,s$





�zChangelogViewer.__init__cCs�t��|_t��}|�|�|�d|jd|�t��}t��}|�td��|�d|jd|�t��}|�td��|�d|jd|�|j�|�|j�|�|j�|�|j�|�|j�	�dS)zOCreate the context menu to be displayed when links are right
           clicked�activate�openzOpen Link in BrowserzCopy Link to Clipboard�copyN)
r�Menu�menu�MenuItem�	set_labelr�handle_context_menu�_�add�show_all)r�url�item_grey_link�item_seperator�item_open_link�item_copy_linkr!r!r"�create_context_menuGs,

���z#ChangelogViewer.create_context_menucCsZ|dkrt|�|dkr+tj��}tj�dd�}tj�||�}|�	|d�|�
�dSdS)z1Handle activate event for the links' context menur$r%�	CLIPBOARDF���N)rr�Display�get_default�Atom�internr�	Clipboard�get_for_displayr�store)r�menuitem�actionr.�display�	selection�cbr!r!r"r*bs
�z#ChangelogViewer.handle_context_menucCs\|��}|D]}t|dd�}|dkrdSq|jjddtjjd�}||_|j�|||�dS)z@Apply the tag that marks links to the specified buffer selectionr.N��blue)�
foreground�	underline)	�get_tags�getattrr�
create_tagr�	Underline�SINGLEr.�	apply_tag)r�start�endr.�tags�tagr!r!r"�tag_linkqs�
�zChangelogViewer.tag_linkcGs
d}d}d}gd�}gd�}	gd�}
dg|
}dg}d	||	|
|d	fd
||	||fd||	||fd||	||fd
||	||fd||	||fd||	||fd||	||fd||	||fd||	||fd||	||fd||	||fd||	||fd||	||fd||	||fd||	||fg}
|
D]b\}}}|�|��t|��}	|�|tjj|�}|s�nE|\}}|��}|��}	|��r�|�	|�}||vr�n|��|�	|�}||vr�n|�
�nn|��}q�||�	|�}|�|||�|}q�q�dS)zOSearch for http URLs in newly inserted text
           and tag them accordinglyzhttps://launchpad.net/bugs/zhttp://bugs.debian.org/z2http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-)� �	�
)�)�]�>)�,�!�:�.z.
zhttp://zLP#zlp#zLP: #zlp: #zLP:#zlp:#z	Malone: #zMalone:#z	Ubuntu: #zUbuntu:#z	Closes: #zCloses:#zcloses:#z	closes: #zCVE-TN)�get_iter_at_offset�
get_offset�len�forward_searchr�TextSearchFlags�VISIBLE_ONLYr%�forward_char�get_text�
backward_charrP)rr�iter_end�content�args�MALONE�DEBIAN�CVE�ws�brak�punct�dot�dot_cr�search_items�	start_str�end_list�
url_prefix�iter�ret�match_start�	match_end�match_suffix�	match_tmp�textr.r!r!r"r}st
�
��


���zChangelogViewer.on_insert_textc	Cs |jdkr|jdkrdSz	|j��\}}Wn	tyYnw|��|��kr)dS|�tjjt	|j
�t	|j��\}}z|�||�}|�
�}Wnty[|�||�\}	}|�
�}Ynw|D]/}
t|
d�r�|jdkrrt|
j�dS|jdkr�|�|
j�|j�dddd|j|j�dSq^dS)zcallback for mouse click events��Fr.NT)�buttonr�get_selection_bounds�
ValueErrorr\�window_to_buffer_coordsr�TextWindowType�WIDGET�int�x�y�get_iter_at_locationrF�AttributeError�hasattrrr.r3r'�popup�time)r�	text_view�eventrLrMr�r�rsrN�	over_textrOr!r!r"r�s@�
��



���z"ChangelogViewer.button_press_eventcCsD|�tjjt|j�t|j��\}}|�||�|�tjj	��
�dS)z{callback for the mouse movement event, that calls the
           check_hovering method with the mouse postition coordiantesF)rrr�r�r�r�r��check_hovering�
get_window�TEXT�get_pointer)rr�r�r�r�r!r!r"r�s
�z#ChangelogViewer.motion_notify_eventc
CsD|�tjj�}|��\}}}}|�tjj||�\}}	|�||	�dS)z�callback if the widgets gets visible (e.g. moves to the foreground)
           that calls the check_hovering method with the mouse position
           coordinatesF)r�rr�r�r�rr�r�)
rr�r��window�screen�wx�wy�mod�bx�byr!r!r"r�s
�z'ChangelogViewer.visibility_notify_eventcCs�d}z|�||�}|��}Wnty#|�||�\}}|��}Ynw|D]}t|d�r1d}nq&||jks:|jrgd|_||_|jrU|�tjj	��
tj�
tjj��dS|�tjj	��
tj�
tjj��dSdS)zRCheck if the mouse is above a tagged link and if yes show
           a hand cursorFr.TN)r�rFr�r�r
rr�rr�r��
set_cursorr�Cursor�new�
CursorType�HAND2�LEFT_PTR)rr�r��	_hoveringrsrNr�rOr!r!r"r�s0�
����zChangelogViewer.check_hovering)N)�__name__�
__module__�__qualname__rr3r*rPrrrrr�r!r!r!r"r	+s
M&	r	�__main__�
versiontag)�weightz�

Version 6-14-0ubuntu1.9.04:

  * New upstream version. LP: #382918.
    Release notes at http://java.sun.com/javase/6/webnotes/ReleaseNotes.html.

)�
__future__r�gi�require_version�
gi.repositoryrrrrrr+�DistUpgrade.ReleaseNotesViewerr�TextViewr	r��Window�w�cv�
get_buffer�changesrH�Weight�BOLDrr,r-�mainr!r!r!r"�<module>s*z

	�

Youez - 2016 - github.com/yon3zu
LinuXploit