From 005753e83e6f0fb2e6eb56cae59cc69d6ab4de69 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 4 Oct 2015 20:43:29 +0200 Subject: [PATCH] Remove some dead code. See #973. --- qutebrowser/browser/commands.py | 8 -------- qutebrowser/browser/history.py | 5 ----- qutebrowser/browser/rfc6266.py | 1 - qutebrowser/browser/webview.py | 2 -- qutebrowser/commands/cmdexc.py | 7 ------- 5 files changed, 23 deletions(-) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 3ff648f9c..5307d0c8e 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -217,14 +217,6 @@ class CommandDispatcher: raise cmdexc.CommandError("Last focused tab vanished!") self._set_current_index(idx) - def _editor_cleanup(self, oshandle, filename): - """Clean up temporary file when the editor was closed.""" - try: - os.close(oshandle) - os.remove(filename) - except OSError: - raise cmdexc.CommandError("Failed to delete tempfile...") - def _get_selection_override(self, left, right, opposite): """Helper function for tab_close to get the tab to select. diff --git a/qutebrowser/browser/history.py b/qutebrowser/browser/history.py index ed9c55e7f..e46dbe6f8 100644 --- a/qutebrowser/browser/history.py +++ b/qutebrowser/browser/history.py @@ -52,11 +52,6 @@ class HistoryEntry: def __str__(self): return '{} {}'.format(int(self.atime), self.url_string) - @classmethod - def from_str(cls, s): - """Get a history based on a 'TIME URL' string.""" - return cls(*s.split(' ', maxsplit=1)) - class WebHistory(QWebHistoryInterface): diff --git a/qutebrowser/browser/rfc6266.py b/qutebrowser/browser/rfc6266.py index 05771c284..ad03c042d 100644 --- a/qutebrowser/browser/rfc6266.py +++ b/qutebrowser/browser/rfc6266.py @@ -42,7 +42,6 @@ class UniqueNamespace(peg.Namespace): # RFC 2616 separator_chars = "()<>@,;:\\\"/[]?={} \t" ctl_chars = ''.join(chr(i) for i in range(32)) + chr(127) -nontoken_chars = separator_chars + ctl_chars # RFC 5987 diff --git a/qutebrowser/browser/webview.py b/qutebrowser/browser/webview.py index 28831d030..4c50a0212 100644 --- a/qutebrowser/browser/webview.py +++ b/qutebrowser/browser/webview.py @@ -64,7 +64,6 @@ class WebView(QWebView): win_id: The window ID of the view. search_text: The text of the last search. search_flags: The search flags of the last search. - _cur_url: The current URL (accessed via cur_url property). _has_ssl_errors: Whether SSL errors occurred during loading. _zoom: A NeighborList with the zoom levels. _old_scroll_pos: The old scroll position. @@ -119,7 +118,6 @@ class WebView(QWebView): # See https://github.com/The-Compiler/qutebrowser/issues/390 self.destroyed.connect(functools.partial( cfg.changed.disconnect, self.init_neighborlist)) - self._cur_url = None self.cur_url = QUrl() self.progress = 0 self.registry = objreg.ObjectRegistry() diff --git a/qutebrowser/commands/cmdexc.py b/qutebrowser/commands/cmdexc.py index ccc88ba1b..63932463f 100644 --- a/qutebrowser/commands/cmdexc.py +++ b/qutebrowser/commands/cmdexc.py @@ -42,13 +42,6 @@ class NoSuchCommandError(CommandMetaError): pass -class ArgumentCountError(CommandMetaError): - - """Raised when a command was called with an invalid count of arguments.""" - - pass - - class ArgumentTypeError(CommandMetaError): """Raised when an argument had an invalid type."""