/
usr
/
lib
/
python3
/
dist-packages
/
DistUpgrade
/
/usr/lib/python3/dist-packages/DistUpgrade
mkdir
upload
Name
Size
Mode
Actions
__pycache__/
-
0755
rm
apt_btrfs_snapshot.py
9873
0644
edit
dl
rm
apt_clone.py
33593
0644
edit
dl
rm
dist-upgrade.py
129
0644
edit
dl
rm
distro.py
23705
0644
edit
dl
rm
DistUpgradeApport.py
5064
0644
edit
dl
rm
DistUpgradeAptCdrom.py
12690
0644
edit
dl
rm
DistUpgradeCache.py
54413
0644
edit
dl
rm
DistUpgradeConfigParser.py
3837
0644
edit
dl
rm
DistUpgradeController.py
103835
0644
edit
dl
rm
DistUpgradeFetcher.py
6009
0644
edit
dl
rm
DistUpgradeFetcherCore.py
11472
0644
edit
dl
rm
DistUpgradeFetcherKDE.py
9950
0644
edit
dl
rm
DistUpgradeFetcherSelf.py
2064
0644
edit
dl
rm
DistUpgradeGettext.py
3043
0644
edit
dl
rm
DistUpgradeMain.py
9317
0644
edit
dl
rm
DistUpgradePatcher.py
4018
0644
edit
dl
rm
DistUpgradeQuirks.py
46761
0644
edit
dl
rm
DistUpgradeVersion.py
21
0644
edit
dl
rm
DistUpgradeView.py
16823
0644
edit
dl
rm
DistUpgradeViewGtk3.py
34667
0644
edit
dl
rm
DistUpgradeViewKDE.py
43122
0644
edit
dl
rm
DistUpgradeViewNonInteractive.py
13862
0644
edit
dl
rm
DistUpgradeViewText.py
12829
0644
edit
dl
rm
GtkProgress.py
4020
0644
edit
dl
rm
MetaRelease.py
17468
0644
edit
dl
rm
QUrlOpener.py
3321
0644
edit
dl
rm
ReleaseNotesViewer.py
7658
0644
edit
dl
rm
ReleaseNotesViewerWebkit.py
2983
0644
edit
dl
rm
SimpleGtk3builderApp.py
2056
0644
edit
dl
rm
SimpleGtkbuilderApp.py
2037
0644
edit
dl
rm
telemetry.py
3478
0644
edit
dl
rm
utils.py
18349
0644
edit
dl
rm
xorg_fix_proprietary.py
4083
0644
edit
dl
rm
__init__.py
0
0644
edit
dl
rm
Edit:
/usr/lib/python3/dist-packages/DistUpgrade/ReleaseNotesViewerWebkit.py
(2983B)
# ReleaseNotesViewer.py # -*- Mode: Python; indent-tabs-mode: nil; tab-width: 4; coding: utf-8 -*- # # Copyright (c) 2011 Canonical # # Author: Michael Vogt <mvo@ubutnu.com> # # This modul provides an inheritance of the Gtk.TextView that is # aware of http URLs and allows to open them in a browser. # It is based on the pygtk-demo "hypertext". # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # USA from .ReleaseNotesViewer import open_url from gi.repository import Gtk webkit2 = False try: import gi gi.require_version("WebKit2", "4.0") from gi.repository import WebKit2 as WebKit webkit2 = True except ImportError: from gi.repository import WebKit class ReleaseNotesViewerWebkit(WebKit.WebView): def __init__(self, notes_url): super(ReleaseNotesViewerWebkit, self).__init__() self.load_uri(notes_url) if webkit2: self.connect("decide-policy", self._on_decide_policy) else: self.connect("navigation-policy-decision-requested", self._on_navigation_policy_decision_requested) def _on_navigation_policy_decision_requested(self, view, frame, request, action, policy): open_url(request.get_uri()) policy.ignore() return True def _on_decide_policy(self, web_view, decision, decision_type): if decision_type == WebKit.PolicyDecisionType.NAVIGATION_ACTION: navigation_action = decision.get_navigation_action() navigation_request = navigation_action.get_request() navigation_type = navigation_action.get_navigation_type() if navigation_type == WebKit.NavigationType.LINK_CLICKED: uri = navigation_request.get_uri() open_url(uri) decision.ignore() return True return False if __name__ == "__main__": win = Gtk.Window() win.set_size_request(600, 400) scroll = Gtk.ScrolledWindow() rv = ReleaseNotesViewerWebkit("http://archive.ubuntu.com/ubuntu/dists/" "devel/main/dist-upgrader-all/current/" "ReleaseAnnouncement.html") scroll.add(rv) win.add(scroll) win.show_all() Gtk.main()
Save
cmd:
run