Merge lp:~mvo/software-center/webkit-debug into lp:software-center

Proposed by Michael Vogt
Status: Merged
Merged at revision: 3010
Proposed branch: lp:~mvo/software-center/webkit-debug
Merge into: lp:software-center
Diff against target: 37 lines (+9/-0)
2 files modified
README (+1/-0)
softwarecenter/ui/gtk3/views/purchaseview.py (+8/-0)
To merge this branch: bzr merge lp:~mvo/software-center/webkit-debug
Reviewer Review Type Date Requested Status
Natalia Bidart Approve
Review via email: mp+106618@code.launchpad.net

Description of the change

Small branch that adds support for basic webkit debugging for url open (this was useful for Michael Nelson
the other day so I felt I should add it permanently).

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

To followup from irc, the reason that its just using "*args" in the def _log_debug_output(self, *args) handler (and that those are not logged too) is that its just "object, GParamSpec" that is passed, but because we only use this function for the "notify::uri" we know the value of it already. I do not mind adding it to the log, but it will probably not add much additional information.

Revision history for this message
Natalia Bidart (nataliabidart) wrote :

(09:40:01 AM) nessita: mvo: Any reason not to log the args argument in the callback?
(09:47:37 AM) mvo: nessita: I followed up in the MP, I don't mind adding it to the MP, but AIUI it will mostly be reduandant
(09:48:29 AM) nessita: mvo: well, I would log only args instead of self.wk.webkit.get_property("uri"), but is a tiny detail. Will approve as is.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README'
2--- README 2012-03-08 18:08:49 +0000
3+++ README 2012-05-21 12:31:22 +0000
4@@ -44,6 +44,7 @@
5 SOFTWARE_CENTER_AGENT_HOST - an alternative host to query for pay software
6 SOFTWARE_CENTER_REVIEWS_HOST - an alternative host for the ratings&reviews
7 SOFTWARE_CENTER_DEBUG_HTTP - enable httplib2 debuging
8+SOFTWARE_CENTER_DEBUG_WEBKIT - enable webkit debuging
9 SOFTWARE_CENTER_IPSUM_REVIEWS - generate random reviews
10 SOFTWARE_CENTER_FAKE_REVIEW_API - use a fake server for all review network operations
11 SOFTWARE_CENTER_GWIBBER_MOCK_USERS=2 - use mock gwibber service
12
13=== modified file 'softwarecenter/ui/gtk3/views/purchaseview.py'
14--- softwarecenter/ui/gtk3/views/purchaseview.py 2012-04-02 18:23:20 +0000
15+++ softwarecenter/ui/gtk3/views/purchaseview.py 2012-05-21 12:31:22 +0000
16@@ -109,6 +109,10 @@
17 self._oauth_token = None
18 self.config = get_config()
19
20+ def _log_debug_output(self, *args):
21+ LOG.info("uri changed: '%s'", self.wk.webkit.get_property("uri"))
22+
23+
24 def init_view(self):
25 if self.wk is None:
26 self.wk = ScrolledWebkitWindow()
27@@ -118,6 +122,10 @@
28 self.wk.webkit.connect("close-web-view", self._on_close_web_view)
29 self.wk.webkit.connect("console-message", self._on_console_message)
30
31+ # check if the user wants url debugging
32+ if os.environ.get("SOFTWARE_CENTER_DEBUG_WEBKIT"):
33+ self.wk.webkit.connect("notify::uri", self._log_debug_output)
34+
35 # a possible way to do IPC (script or title change)
36 self.wk.webkit.connect("script-alert", self._on_script_alert)
37 self.wk.webkit.connect("title-changed", self._on_title_changed)

Subscribers

People subscribed via source and target branches