Merge branch 'devel' into dep-up
This commit is contained in:
commit
1001cc607e
70 files changed
+26832
-6680
No files matched your search
@@ -32,6 +32,8 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin,
|
||||
octoprint.plugin.StartupPlugin,
|
||||
octoprint.plugin.BlueprintPlugin):
|
||||
|
||||
ARCHIVE_EXTENSIONS = (".zip", ".tar.gz", ".tgz", ".tar")
|
||||
|
||||
def __init__(self):
|
||||
self._pending_enable = set()
|
||||
self._pending_disable = set()
|
||||
@@ -66,7 +68,8 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin,
|
||||
##~~ StartupPlugin
|
||||
|
||||
def on_startup(self, host, port):
|
||||
console_logging_handler = logging.handlers.RotatingFileHandler(self._settings.get_plugin_logfile_path(postfix="console"), maxBytes=2*1024*1024)
|
||||
from octoprint.logging.handlers import CleaningTimedRotatingFileHandler
|
||||
console_logging_handler = CleaningTimedRotatingFileHandler(self._settings.get_plugin_logfile_path(postfix="console"), when="D", backupCount=3)
|
||||
console_logging_handler.setFormatter(logging.Formatter("%(asctime)s %(message)s"))
|
||||
console_logging_handler.setLevel(logging.DEBUG)
|
||||
|
||||
@@ -115,7 +118,8 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin,
|
||||
plugins = sorted(self._get_plugins(), key=lambda x: x["name"].lower())
|
||||
return dict(
|
||||
all=plugins,
|
||||
thirdparty=filter(lambda p: not p["bundled"], plugins)
|
||||
thirdparty=filter(lambda p: not p["bundled"], plugins),
|
||||
archive_extensions=self.__class__.ARCHIVE_EXTENSIONS
|
||||
)
|
||||
|
||||
def get_template_types(self, template_sorting, template_rules, *args, **kwargs):
|
||||
@@ -140,7 +144,7 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin,
|
||||
upload_path = flask.request.values[input_upload_path]
|
||||
upload_name = flask.request.values[input_upload_name]
|
||||
|
||||
exts = filter(lambda x: upload_name.lower().endswith(x), (".zip", ".tar.gz", ".tgz", ".tar"))
|
||||
exts = filter(lambda x: upload_name.lower().endswith(x), self.__class__.ARCHIVE_EXTENSIONS)
|
||||
if not len(exts):
|
||||
return flask.make_response("File doesn't have a valid extension for a plugin archive", 400)
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@
|
||||
<div class="input-prepend span9">
|
||||
<span class="btn fileinput-button">
|
||||
<span>{{ _('Browse...') }}</span>
|
||||
<input id="settings_plugin_pluginmanager_repositorydialog_upload" type="file" name="file" data-url="{{ url_for("plugin.pluginmanager.upload_archive") }}">
|
||||
<input id="settings_plugin_pluginmanager_repositorydialog_upload" type="file" name="file" accept="{{ ",".join(plugin_pluginmanager_archive_extensions) }}" data-url="{{ url_for("plugin.pluginmanager.upload_archive") }}">
|
||||
</span>
|
||||
<span class="add-on add-on-limited text-left" data-bind="text: uploadFilename, attr: {title: uploadFilename}"></span>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user