This commit is contained in:
Florian Bruhin 2014-05-12 14:52:04 +02:00
parent db7077d94f
commit 8ff4b6dd99
2 changed files with 6 additions and 5 deletions

View File

@ -52,7 +52,9 @@ class NetworkManager(QNetworkAccessManager):
@pyqtSlot('QNetworkReply', 'QList<QSslError>')
def on_ssl_errors(self, reply, errors):
"""This slot is called on SSL/TLS errors.
"""Decide if SSL errors should be ignored or not.
This slot is called on SSL/TLS errors by the self.sslErrors signal.
Args:
reply: The QNetworkReply that is encountering the errors.
@ -64,7 +66,6 @@ class NetworkManager(QNetworkAccessManager):
message.error('SSL error: {}'.format(err.errorString()))
reply.ignoreSslErrors()
def createRequest(self, op, req, outgoing_data):
"""Return a new QNetworkReply object.

View File

@ -133,9 +133,9 @@ def javascript_escape(text):
# This is a list of tuples because order matters, and using OrderedDict
# makes no sense because we don't actually need dict-like properties.
replacements = [
('\\', r'\\'), # First escape all literal \ signs as \\
("'", r"\'"), # Then escape ' and " as \' and \"
('"', r'\"'), # (note it won't hurt when we escape the wrong one)
('\\', r'\\'), # First escape all literal \ signs as \\.
("'", r"\'"), # Then escape ' and " as \' and \".
('"', r'\"'), # (note it won't hurt when we escape the wrong one).
('\n', r'\n'), # We also need to escape newlines for some reason.
]
for orig, repl in replacements: