Uzbl

Tasklist

FS#289 - Small bugfix + extension to uzbl-tabbed

Attached to Project: Uzbl
Opened by S.A.V. (hoverisk) - 2011-12-23 08:32:05 PM
Task Type Bug Report
Category uzbl-tabbed
Status Unconfirmed
Assigned To No-one
Operating System All
Severity Low
Priority Normal
Reported Version Development
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

Details

Sorry for posting the patch here, I am too lazy to subscribe to the mailing list.

The patch is against the current version of uzbl-tabbed from the master branch in git.

Note: I am not an experienced python programmer, it might be a bad or incorrect code.

Changes:

(add) Now a value of window_size is read from config file (the old version always uses hardcoded value), examples:
set window_size = m # maximize window
set window_size = 300,300 # width,height

(fix) The uri parameter of the NEW_TAB event is a utf-8 string. Since this string is not properly encoded in the old version, URL containing non-ascii characters cannot be opened in a new tab.


*** uzbl-tabbed.orig 2011-12-23 22:36:46.000000000 +0300
--- uzbl-tabbed 2011-12-23 22:11:22.000000000 +0300
***************
*** 156,157 ****
--- 156,160 ----

+ import urllib
+ import urlparse
+
from gobject import io_add_watch, source_remove, timeout_add, IO_IN, IO_HUP
***************
*** 488,489 ****
--- 491,504 ----
self.parent.tabs[tab].title_changed(True)
+ elif var == "window_size":
+ if config['window_size'] == "m":
+ uzbl.window.maximize()
+ else:
+ try:
+ window_size = map(int, config['window_size'].split(','))
+ uzbl.window.resize(*window_size)
+
+ except:
+ print_exc()
+ error("Invalid value for window_size in config file.")
+

***************
*** 633,635 ****
print_exc()
! error("Invalid value for default_size in config file.")


--- 648,650 ----
print_exc()
! error("Invalid value for window_size in config file.")

***************
*** 876,878 ****
sid = tab.get_id()
! uri = uri.strip()
name = "%d-%d" % (os.getpid(), self.next_pid())
--- 891,898 ----
sid = tab.get_id()
!
! uri_parsed = urlparse.urlsplit(uri.strip().encode('utf-8'))
! query_quoted = urllib.urlencode(urlparse.parse_qsl(uri_parsed.query, True), True)
! path_quoted = urllib.quote(uri_parsed.path)
! uri = urlparse.urlunsplit((uri_parsed.scheme, uri_parsed.netloc, path_quoted, query_quoted, uri_parsed.fragment))
!
name = "%d-%d" % (os.getpid(), self.next_pid())
This task depends upon

2012-02-10: A task closure has been requested.
Comment by S.A.V. (hoverisk) - 2011-12-23 08:42:08 PM
Oops, the patch is broken. =)
Where should I send it then?
Comment by S.A.V. (hoverisk) - 2012-02-10 10:38:16 PM
Well, I've tried to subcribe to the mailing list, but failed. (I do not get any mail when try to subscribe).
I have a fork of uzbl in my repository with the patch applied:
https://github.com/hoverisk/uzbl/commit/c965fff3730beb481fcc221b118d6e87ae065b8a

If somebody reads bugreports here, please add this patch.
Comment by Brendan Taylor (bct) - 2012-02-12 07:43:06 PM
Sorry, I should have replied when you originally submitted this! I'm reviewing it now.

Loading...