Formatting

This commit is contained in:
shortcutme 2018-03-20 21:53:39 +01:00
parent c3b146611b
commit 9adec79401
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -1,7 +1,6 @@
import json import json
import time import time
import sys import sys
import hashlib
import os import os
import shutil import shutil
import re import re
@ -18,6 +17,7 @@ from Translate import translate as _
from util import helper from util import helper
from Content.ContentManager import VerifyError, SignError from Content.ContentManager import VerifyError, SignError
@PluginManager.acceptPlugins @PluginManager.acceptPlugins
class UiWebsocket(object): class UiWebsocket(object):
@ -97,8 +97,8 @@ class UiWebsocket(object):
if ("0.0.0.0" == bind_ip or "*" == bind_ip) and (not whitelist): if ("0.0.0.0" == bind_ip or "*" == bind_ip) and (not whitelist):
self.site.notifications.append([ self.site.notifications.append([
"error", "error",
_(u"You are not going to set up a public gateway. However, <b>your Web UI is<br>" + \ _(u"You are not going to set up a public gateway. However, <b>your Web UI is<br>" +
"open to the whole Internet.</b> " + \ "open to the whole Internet.</b> " +
"Please check your configuration.") "Please check your configuration.")
]) ])
@ -436,7 +436,7 @@ class UiWebsocket(object):
self.site.saveSettings() self.site.saveSettings()
self.site.announce() self.site.announce()
if not inner_path in self.site.content_manager.contents: if inner_path not in self.site.content_manager.contents:
return self.response(to, {"error": "File %s not found" % inner_path}) return self.response(to, {"error": "File %s not found" % inner_path})
event_name = "publish %s %s" % (self.site.address, inner_path) event_name = "publish %s %s" % (self.site.address, inner_path)
@ -941,10 +941,9 @@ class UiWebsocket(object):
import Translate import Translate
for translate in Translate.translates: for translate in Translate.translates:
translate.setLanguage(value) translate.setLanguage(value)
self.cmd("notification", ["done", message = _["You have successfully changed the web interface's language!"] + "<br>"
_["You have successfully changed the web interface's language!"] + "<br>" + message += _["Due to the browser's caching, the full transformation could take some minute."]
_["Due to the browser's caching, the full transformation could take some minute."] self.cmd("notification", ["done", message, 10000])
, 10000])
config.language = value config.language = value
self.response(to, "ok") self.response(to, "ok")