Commit Graph

4332 Commits

Author SHA1 Message Date
Patric Schmitz
fdde05569c remove redundant __init__ and rely on base class 2015-11-28 18:29:51 +01:00
Patric Schmitz
c322130dc0 style changes 2015-11-28 18:29:51 +01:00
Patric Schmitz
6f65397dfe always set valid_values in __init__ instead of class scope variable 2015-11-28 18:29:51 +01:00
Patric Schmitz
9b453aaad5 revert config transformation 2015-11-28 18:29:51 +01:00
Patric Schmitz
9aaf5c18c1 set valid_values in __init__ methods, except for BaseType s.t. variable is shared across derived class scopes 2015-11-28 18:29:51 +01:00
Patric Schmitz
55edd9cda7 add valid_values = None to config basetype 2015-11-28 18:29:51 +01:00
Patric Schmitz
2867df4c21 revert log-javascript-console changes 2015-11-28 18:29:51 +01:00
Patric Schmitz
6431542eba fixes to config types, remove unneeded derived __init__ and call base __init__ 2015-11-28 18:29:51 +01:00
Patric Schmitz
2a705e2eb6 Make non-specialized config types String. Closes #1103 2015-11-28 18:29:51 +01:00
Patric Schmitz
75f9f2af8d get rid of redundant option description 2015-11-28 18:29:51 +01:00
Patric Schmitz
ff6d3e05a6 log-javascript-console now String option: none, debug, info
Make BaseType.valid_values per-instance variable
2015-11-28 18:29:51 +01:00
Florian Bruhin
b79049261e Delay :yank notification until message was yanked.
This should make yankpaste tests more reliable.
2015-11-27 18:32:17 +01:00
Florian Bruhin
23068e9679 Don't log yanked test with :yank-selected.
It makes our tests fail (invalid log line) and is probably not needed.
2015-11-26 21:23:11 +01:00
Florian Bruhin
8e7a76280b Use cmdutils.check_exclusive for :tab-clone. 2015-11-26 20:11:53 +01:00
Florian Bruhin
7f5e07d7cc bdd: Add some tests for :tab-move. 2015-11-26 18:37:47 +01:00
Florian Bruhin
f56e7b1220 Simplify :tab-move code. 2015-11-26 17:44:34 +01:00
Florian Bruhin
987ee59f58 :tab-move: Fix tab index shown in error message. 2015-11-26 16:37:54 +01:00
Florian Bruhin
5a95cfdc7a Change CommandError to ValueError for :tab-move.
This should never happen.
2015-11-26 16:37:29 +01:00
Daniel Schadt
d082c248a8 Disallow empty values in url-incdec-segments 2015-11-25 19:35:37 +01:00
Florian Bruhin
951c2e8eb6 Fix qflags_key comparison. 2015-11-25 18:54:03 +01:00
Florian Bruhin
a6045ab551 Handle invalid select-on-remove case. 2015-11-25 18:47:36 +01:00
Florian Bruhin
73e9fd1118 Handle BOM (\ufeff) for webelem.javascript_escape. 2015-11-25 18:14:52 +01:00
Florian Bruhin
24a71e5c2e Fix webelem.javascript_escape with U+2028/U+2029. 2015-11-25 10:32:22 +01:00
Florian Bruhin
027a10c04b bdd: Add some tests for :navigate. 2015-11-24 21:32:45 +01:00
Florian Bruhin
8faf4717e5 Make :debug-console toggle the console. 2015-11-24 18:32:18 +01:00
Florian Bruhin
35de87f973 Expand ~ with :dump-page. 2015-11-24 18:04:10 +01:00
Florian Bruhin
b37dac7bfa Handle errors in :dump-page. 2015-11-24 18:03:39 +01:00
Florian Bruhin
e405492667 Ignore errors when removing temp basedir. 2015-11-24 17:50:39 +01:00
Florian Bruhin
3905884a84 Disable all QWebSettings storage when quitting.
This hopefully helps with issues on the Windows buildbot:

    Error in atexit._run_exitfuncs:
    Traceback (most recent call last):
      File "C:\Users\florian\buildbot\slave\win8\build\.tox\py34\lib\shutil.py", line 371, in _rmtree_unsafe
	os.unlink(fullname)
    PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\florian\\AppData\\Local\\Temp\\qutebrowser-basedir-ixuexfeu\\data\\local-storage\\qrc__0.localstorage'
2015-11-24 17:24:14 +01:00
Florian Bruhin
43d7b139e8 Ignore another libpng warning.
This happened here:
https://ci.appveyor.com/project/The-Compiler/qutebrowser/build/master-1536/job/k8es4nh719cc27hf
2015-11-24 16:59:35 +01:00
Florian Bruhin
922fdc0526 Fix :fake-key with no focused webview. 2015-11-24 16:28:56 +01:00
Florian Bruhin
75178b0cdc Log when the focus object changed.
This is mainly needed for tests to synchronize things properly.
2015-11-24 15:24:45 +01:00
Florian Bruhin
c73de6ea4d Change "Added binding ..." logs to vdebug. 2015-11-23 21:41:31 +01:00
Florian Bruhin
b0d4ebe844 Don't log VDEBUG messages with --debug.
This reduces the log spam quite a bit, which also makes things easier when
dealing with CI output.
2015-11-23 21:40:11 +01:00
Florian Bruhin
607ca0f478 tests: Wait until page is dumped for header check.
If we don't do this, it's possible for the test process to delete the temporary
directory before qutebrowser actually writes the file.
2015-11-23 20:12:52 +01:00
Florian Bruhin
31892b437e Add :debug-dump-page command.
This can probably be merged into :download later, when the mess is cleaned up.
2015-11-23 14:35:46 +01:00
Florian Bruhin
16e1a65448 Merge branch 'download-page' of https://github.com/Kingdread/qutebrowser into Kingdread-download-page 2015-11-23 13:16:16 +01:00
Daniel Schadt
89c9b5959e Don't ask the user twice for a filename
Fixes a bug where the user would be asked twice for a filename when
using :download without a dest-argument.

The problem was that we unconditionally overwrote filename, even if one
was given, thus discarding any "filename-finding-process" that we had
and asking the user again.
2015-11-23 12:32:58 +01:00
Florian Bruhin
efa745b53f Fix indent. 2015-11-23 11:26:01 +01:00
Florian Bruhin
f4cccdf13f Merge branch 'patch-1' of https://github.com/larryhynes/qutebrowser into larryhynes-patch-1 2015-11-23 11:23:10 +01:00
Florian Bruhin
ee0627128a Merge branch 'argparse-usage' of https://github.com/forkbong/qutebrowser into forkbong-argparse-usage 2015-11-23 11:20:49 +01:00
Florian Bruhin
ea06c64ed4 Fix typos. 2015-11-23 11:17:26 +01:00
Panagiotis Ktistakis
f3f0ef9841 Remove unnecessary 'usage:' from argument parser. 2015-11-23 01:10:35 +02:00
larryhynes
706a4e3d39 Change error to warning for text not found on page 2015-11-21 23:47:00 +00:00
Daniel Schadt
c12011c84d Style fixes 2015-11-21 00:10:49 +01:00
Florian Bruhin
2727f3c2a8 Hide QObject::connect stateChanged warning. 2015-11-20 22:01:21 +01:00
Daniel Schadt
b776aeac84 Use same representation in webview and quteprocess
Otherwise the "page loaded" message will not be recognized.

Also use percent-encoding to avoid unicode-related bugs on different
systems.
2015-11-20 19:11:20 +01:00
Florian Bruhin
af875f4b8f Add a :fake-key command.
Closes #556.
See #551.
2015-11-20 19:06:06 +01:00
Daniel Schadt
d5bc962046 mhtml: Current index != Current tab_id 2015-11-20 18:15:03 +01:00
Daniel Schadt
b38a3caa4c Hide dest-old in the documentation of download 2015-11-20 16:34:27 +01:00
Florian Bruhin
1ec03462c8 Add a utils.parse_keystring. 2015-11-20 07:06:16 +01:00
xd1le
b9163c5079 doc: Document <unbound> in keys.conf.
Closes #1117.
2015-11-20 00:55:33 +11:00
Florian Bruhin
271cb47f87 Merge branch 'netrc' of https://github.com/Konubinix/qutebrowser into Konubinix-netrc 2015-11-18 20:38:57 +01:00
Florian Bruhin
c7f386cec0 Avoid logging in signal handlers.
If we don't do that, we can get this:

--- Logging error ---
Traceback (most recent call last):
  File ".../python3.5/logging/__init__.py", line 984, in emit
    self.flush()
  File ".../python3.5/logging/__init__.py", line 964, in flush
    self.stream.flush()
RuntimeError: reentrant call inside <_io.BufferedWriter name='<stderr>'>
Call stack:
  [...]
  File ".../qutebrowser/app.py", line 122, in qt_mainloop
    return qApp.exec_()
  File ".../qutebrowser/utils/objreg.py", line 118, in on_destroyed
    log.destroy.debug("schedule removal: {}".format(name))
  File ".../python3.5/logging/__init__.py", line 1267, in debug
    self._log(DEBUG, msg, args, **kwargs)
  File ".../python3.5/logging/__init__.py", line 1415, in _log
    self.handle(record)
  File ".../python3.5/logging/__init__.py", line 1425, in handle
    self.callHandlers(record)
  File ".../python3.5/logging/__init__.py", line 1487, in callHandlers
    hdlr.handle(record)
  File ".../python3.5/logging/__init__.py", line 855, in handle
    self.emit(record)
  File ".../python3.5/logging/__init__.py", line 984, in emit
    self.flush()
  File ".../python3.5/logging/__init__.py", line 964, in flush
    self.stream.flush()
  File ".../qutebrowser/misc/crashsignal.py", line 365, in interrupt
    log.destroy.info("Do the same again to forcefully quit.")
Message: 'Do the same again to forcefully quit.'
Arguments: ()
2015-11-18 20:21:23 +01:00
Daniel Schadt
3438a45b19 Merge branch 'master' into download-page 2015-11-18 19:27:26 +01:00
Samuel Loury
0298fcc841 Use credentials from netrc when available 2015-11-18 16:44:45 +01:00
Florian Bruhin
f20ffca540 Merge branch 'issue923' of https://github.com/lamarpavel/qutebrowser into lamarpavel-issue923 2015-11-17 19:43:35 +01:00
Florian Bruhin
726525b26a bdd: Add some more tests for scrolling with floats. 2015-11-17 06:57:33 +01:00
Florian Bruhin
40e2258ef3 Don't accept floats for :scroll-px. 2015-11-17 06:57:13 +01:00
Florian Bruhin
bbaab24ce8 Fix lint. 2015-11-16 20:24:27 +01:00
Florian Bruhin
b68adf1245 Merge _scroll_percent into scroll_perc. 2015-11-16 19:05:05 +01:00
Florian Bruhin
a4d15b550e Abort :back/:forward at beginning/end of history. 2015-11-16 19:03:07 +01:00
Florian Bruhin
eeab4d41ba Make it possible to pass a count via command name.
This is only used for tests so far and not intended for general usage (and thus
undocumented).
2015-11-15 19:55:01 +01:00
Florian Bruhin
7de206e350 Fix :scroll-perc 0/100 0. 2015-11-15 16:38:56 +01:00
Lamar Pavel
46d335cdee Update list of user agents with new script. 2015-11-14 16:06:45 +01:00
Lamar Pavel
d745819715 Improve script to print entries grouped by browser
The ua_fetch.py has been re-written entirely to find specific entries for
each browser based on diversity rather than sole popularity. The output
is now formatted to print the entries for each browser grouped together.
2015-11-14 15:57:24 +01:00
Florian Bruhin
1da7996c3b Style fixes. 2015-11-13 22:27:41 +01:00
Daniel Schadt
aef26e7779 mhtml: Recognize more files as css 2015-11-12 20:11:36 +01:00
Daniel Schadt
30e2afb59d mhtml: reduce test flakiness
Waiting for "All assets downloaded" may lead to race conditions when
the output file is read before qute wrote it, so the test fails.
2015-11-12 13:17:10 +01:00
Daniel Schadt
c759bf7a2f Move common filename-ask-code to a function
This should reduce code/logic-duplication regarding asking for download
filenames.
2015-11-12 00:12:51 +01:00
Daniel Schadt
18da73227b Don't shadow built-in "dir" 2015-11-11 21:20:04 +01:00
Daniel Schadt
62b0c4d178 Merge branch 'download-page-tests' of https://github.com/The-Compiler/qutebrowser into download-page 2015-11-11 21:03:36 +01:00
Daniel Schadt
4e3cd8b9e8 Don't prompt if not storage->prompt-download-dir 2015-11-11 20:39:35 +01:00
Daniel Schadt
0f8ec73c55 mhtml: also check dir before starting the download
Otherwise the downloads will be useless anyway.
2015-11-11 20:05:42 +01:00
Daniel Schadt
43c3a38938 mhtml: Don't crash if output dir doesn't exist 2015-11-11 20:00:20 +01:00
Florian Bruhin
7cddd52b2d Merge branch 'download-page' of https://github.com/Kingdread/qutebrowser into Kingdread-download-page 2015-11-10 22:39:07 +01:00
Florian Bruhin
d99f9a3a20 Improve :set error messages. 2015-11-10 22:09:36 +01:00
Florian Bruhin
54e2cea460 Fix some corner cases with :set. 2015-11-10 21:27:42 +01:00
Florian Bruhin
7701bf602a Add --append argument to :set-cmd-text. 2015-11-10 19:21:54 +01:00
Florian Bruhin
250f0e7410 Merge branch 'test-browser-cache-more' of https://github.com/lamarpavel/qutebrowser into lamarpavel-test-browser-cache-more 2015-11-10 18:57:28 +01:00
Florian Bruhin
374b448e51 Get rid of unnecessary file.readline() calls. 2015-11-10 18:44:42 +01:00
Daniel
a5ee39c35e Fix PEP 8 2015-11-10 09:45:01 +01:00
Daniel
c0535727ef Only download elements with rel={stylesheet,icon}
Websites may set the rel attribute to whatever they want, so we just
care about stylesheets and icons and not the other stuff like wss
links (looking at you, GitHub), RSS-feeds, ...
2015-11-09 22:57:31 +01:00
Florian Bruhin
2fc1612bd4 Fix removing of automatic downloads w/ -1 timeout.
With ui -> remove-finished-downloads set to -1, when a download was started
with auto_remove=True (like with :adblock-update), there was a QTimer set up
with timeout -1, which causes this instead of doing something sane:

WARNING: QTimer::singleShot: Timers cannot have negative timeouts
2015-11-09 22:45:51 +01:00
Florian Bruhin
566f94111c Don't warn if element vanished on mouse release.
This happens somewhat reliably on Ubuntu Trusty with the hint test, and more
reliably on Travis.
2015-11-09 22:12:24 +01:00
Florian Bruhin
6579866abe Quote weird Qt functions for logging. 2015-11-09 19:55:05 +01:00
Florian Bruhin
65648da1ad Fix #889 during a webpage shutdown.
If we're in the middle of closing a WebPage, the webview will still be
registered, but already deleted by Qt - so we get a RuntimeError/TypeError
there.
2015-11-09 18:22:35 +01:00
Florian Bruhin
f3d76b5af6 Fix :follow-hint with an invalid keystring. 2015-11-09 18:20:23 +01:00
Florian Bruhin
35c36725f2 Disallow :follow-hint outside of hint mode.
Fixes #1105.
2015-11-09 18:20:23 +01:00
Daniel
f79722975f Fix _download_dir reference 2015-11-09 17:14:04 +01:00
Daniel
a1bc020fec mhtml: Sanitize default filename suggestion 2015-11-09 17:01:08 +01:00
Daniel
4f01382c64 mhtml: Ignore non-http(s) assets 2015-11-09 17:01:08 +01:00
Daniel
71533b3456 mhtml: Add comments describing the hostblock check 2015-11-09 17:01:08 +01:00
Daniel
9694b3b548 downloads: Remove safety check in on_reply_error
Probably not needed after the last commit.
2015-11-09 17:01:08 +01:00
Daniel
252dc9a8bd mhtml: Don't attempt to download hostblocked urls 2015-11-09 17:01:08 +01:00
Daniel
f34161423c Fix "line too long" 2015-11-09 17:01:08 +01:00
Daniel
a780325a3a Allow directories to be entered as destination
The filename will then default to 'page title.mht'
2015-11-09 17:01:08 +01:00
Daniel
ae8a9b8798 Handle non-ASCII in headers/url better 2015-11-09 17:01:08 +01:00
Daniel
8bb887ddab Specify window and tab instead of 'current' 2015-11-09 17:01:08 +01:00
Daniel
a1e0ccb787 Fix spelling/style. 2015-11-09 17:01:08 +01:00