Code style review changes

This commit is contained in:
George Edward Bulmer 2018-02-10 15:14:07 +00:00
parent 950e4227e3
commit ffddf9a15f
3 changed files with 9 additions and 8 deletions

View File

@ -1,8 +1,8 @@
{% extends "base.html" %}
{% block script %}
var paste_version = function(){
xhr = new XMLHttpRequest();
function paste_version() {
const xhr = new XMLHttpRequest();
xhr.open("GET", "qute://pastebin-version");
xhr.send();
}
@ -36,5 +36,5 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <a href="http://www.gnu.org/licenses/">
http://www.gnu.org/licenses/</a> or open <a href="qute://gpl">qute://gpl</a>.
</p>
<button id="paste" onclick="paste_version()">Pastebin Version Info</button>
<button id="paste" onclick="paste_version()">Yank Pastebin URL for Version Info</button>
{% endblock %}

View File

@ -50,6 +50,7 @@ except ImportError: # pragma: no cover
import qutebrowser
from qutebrowser.utils import qtutils, log, debug
fake_clipboard = None
log_clipboard = False

View File

@ -66,7 +66,7 @@ class DistributionInfo:
pretty = attr.ib()
PASTEBIN_URL = None
pastebin_url = None
Distribution = enum.Enum(
'Distribution', ['unknown', 'ubuntu', 'debian', 'void', 'arch',
'gentoo', 'fedora', 'opensuse', 'linuxmint', 'manjaro'])
@ -460,18 +460,18 @@ def pastebin_version():
message.info("Version url {} yanked to clipboard.".format(url))
def _on_paste_version_success(url):
global PASTEBIN_URL
global pastebin_url
_yank_url(url)
pbclient.deleteLater()
PASTEBIN_URL = url
pastebin_url = url
def _on_paste_version_err(text):
message.error("Failed to pastebin version"
" info: {}".format(text))
pbclient.deleteLater()
if PASTEBIN_URL:
_yank_url(PASTEBIN_URL)
if pastebin_url:
_yank_url(pastebin_url)
return
app = QApplication.instance()