Some small bugfixes in the plugin handling code and a changelog entry

This commit is contained in:
Gina Häußge 2014-09-14 14:41:18 +02:00
parent 1c19bb4dfc
commit 604c2a0bdd
3 changed files with 8 additions and 3 deletions

View file

@ -16,6 +16,8 @@
search
* You can now define a folder (default: `~/.octoprint/watched`) to be watched for newly added GCODE (or -- if slicing
support is enabled -- STL) files to automatically add.
* OctoPrint now has a [plugin system](http://docs.octoprint.org/en/devel/plugins/index.html) which allows extending its
core functionality.
### Improvements

View file

@ -133,11 +133,11 @@ def plugin_assets(name, filename):
asset_plugins = pluginManager.get_implementations(octoprint.plugin.AssetPlugin)
if not name in asset_plugins:
return make_response(404)
return make_response("Asset not found", 404)
asset_plugin = asset_plugins[name]
asset_folder = asset_plugin.get_asset_folder()
if asset_folder is None:
make_response(404)
return make_response("Asset not found", 404)
return send_from_directory(asset_folder, filename)

View file

@ -259,7 +259,10 @@ def interface_addresses(family=None):
family = netifaces.AF_INET
for interface in netifaces.interfaces():
ifaddresses = netifaces.ifaddresses(interface)
try:
ifaddresses = netifaces.ifaddresses(interface)
except:
continue
if family in ifaddresses:
for ifaddress in ifaddresses[family]:
if not ifaddress["addr"].startswith("169.254."):