Code style review changes
This commit is contained in:
parent
950e4227e3
commit
ffddf9a15f
@ -1,8 +1,8 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
|
|
||||||
{% block script %}
|
{% block script %}
|
||||||
var paste_version = function(){
|
function paste_version() {
|
||||||
xhr = new XMLHttpRequest();
|
const xhr = new XMLHttpRequest();
|
||||||
xhr.open("GET", "qute://pastebin-version");
|
xhr.open("GET", "qute://pastebin-version");
|
||||||
xhr.send();
|
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/">
|
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>.
|
http://www.gnu.org/licenses/</a> or open <a href="qute://gpl">qute://gpl</a>.
|
||||||
</p>
|
</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 %}
|
{% endblock %}
|
||||||
|
@ -50,6 +50,7 @@ except ImportError: # pragma: no cover
|
|||||||
import qutebrowser
|
import qutebrowser
|
||||||
from qutebrowser.utils import qtutils, log, debug
|
from qutebrowser.utils import qtutils, log, debug
|
||||||
|
|
||||||
|
|
||||||
fake_clipboard = None
|
fake_clipboard = None
|
||||||
log_clipboard = False
|
log_clipboard = False
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ class DistributionInfo:
|
|||||||
pretty = attr.ib()
|
pretty = attr.ib()
|
||||||
|
|
||||||
|
|
||||||
PASTEBIN_URL = None
|
pastebin_url = None
|
||||||
Distribution = enum.Enum(
|
Distribution = enum.Enum(
|
||||||
'Distribution', ['unknown', 'ubuntu', 'debian', 'void', 'arch',
|
'Distribution', ['unknown', 'ubuntu', 'debian', 'void', 'arch',
|
||||||
'gentoo', 'fedora', 'opensuse', 'linuxmint', 'manjaro'])
|
'gentoo', 'fedora', 'opensuse', 'linuxmint', 'manjaro'])
|
||||||
@ -460,18 +460,18 @@ def pastebin_version():
|
|||||||
message.info("Version url {} yanked to clipboard.".format(url))
|
message.info("Version url {} yanked to clipboard.".format(url))
|
||||||
|
|
||||||
def _on_paste_version_success(url):
|
def _on_paste_version_success(url):
|
||||||
global PASTEBIN_URL
|
global pastebin_url
|
||||||
_yank_url(url)
|
_yank_url(url)
|
||||||
pbclient.deleteLater()
|
pbclient.deleteLater()
|
||||||
PASTEBIN_URL = url
|
pastebin_url = url
|
||||||
|
|
||||||
def _on_paste_version_err(text):
|
def _on_paste_version_err(text):
|
||||||
message.error("Failed to pastebin version"
|
message.error("Failed to pastebin version"
|
||||||
" info: {}".format(text))
|
" info: {}".format(text))
|
||||||
pbclient.deleteLater()
|
pbclient.deleteLater()
|
||||||
|
|
||||||
if PASTEBIN_URL:
|
if pastebin_url:
|
||||||
_yank_url(PASTEBIN_URL)
|
_yank_url(pastebin_url)
|
||||||
return
|
return
|
||||||
|
|
||||||
app = QApplication.instance()
|
app = QApplication.instance()
|
||||||
|
Loading…
Reference in New Issue
Block a user