diff --git a/.versioneer-lookup b/.versioneer-lookup index ea7606ff8..7c9750a02 100644 --- a/.versioneer-lookup +++ b/.versioneer-lookup @@ -10,10 +10,10 @@ # master shall not use the lookup table, only tags master -# maintenance is currently the branch for preparation of maintenance release 1.2.3 +# maintenance is currently the branch for preparation of maintenance release 1.2.4 # so are any fix/... branches -maintenance 1.2.3-dev 1c6b0554c796f03ed539397daa4b13c44d05a99d -fix/.* 1.2.3-dev 1c6b0554c796f03ed539397daa4b13c44d05a99d +maintenance 1.2.4-dev 3761995aff94acf32495556730f133a1626245b3 +fix/.* 1.2.4-dev 3761995aff94acf32495556730f133a1626245b3 # every other branch is a development branch and thus gets resolved to 1.3.0-dev for now .* 1.3.0-dev 198d3450d94be1a2 diff --git a/AUTHORS.md b/AUTHORS.md new file mode 100644 index 000000000..07f0fc9ab --- /dev/null +++ b/AUTHORS.md @@ -0,0 +1,59 @@ +# Authors + +The following people have contributed to OctoPrint's code base (ordered by +date of first contribution): + + * [Gina Häußge](https://github.com/foosel) + * [Thomas Sanladerer](https://github.com/imitation) + * [Alex Ustyantsev](https://github.com/hudbrog) + * [Andrew Dalgleish](https://github.com/ajd4096) + * [Dale Price](https://github.com/daprice) + * [Václav "ax" Hůla](https://github.com/AxTheB) + * [Tom Perry](https://github.com/daftscience) + * [Andreas Gohr](https://github.com/splitbrain) + * [Lars Norpchen](https://github.com/norpchen) + * [Marlon Wünnemann](https://github.com/marwue) + * ["algspd"](https://github.com/algspd) + * [Peter Uithoven](https://github.com/peteruithoven) + * [Bryan Mayland](https://github.com/CapnBry) + * [Ross Hendrickson](https://github.com/savorywatt) + * [Dan Lipsitt](https://github.com/DanLipsitt) + * [James Gao](https://github.com/jamesgao) + * [Tonnerre Lombard](https://github.com/tonnerre) + * [Marc Hannappel](https://github.com/Salandora) + * [Brad Pitcher](https://github.com/brad) + * [Gabe Rosenhouse](https://github.com/rosenhouse) + * [chriskoz](https://github.com/chriskoz) + * [Ilya Novoselov](https://github.com/nullie) + * [Corey C](https://github.com/C-o-r-E) + * [Jarek Szczepanski](https://github.com/imrahil) + * [Jon Nordby](https://github.com/jonnor) + * [Aaron Bieber](https://github.com/qbit) + * [Guy Sheffer](https://github.com/guysoft) + * [Dattas Moonchaser](https://github.com/dattas) + * [Pim Rutgers](https://github.com/Booli) + * [Koen Kooi](https://github.com/koenkooi) + * [Colin Wallace](https://github.com/Wallacoloo) + * [Michael Ang](https://github.com/mangtronix) + * [Philipp Engel](https://github.com/nosyjoe) + * [Giles Hall](https://github.com/vishnubob) + * [Bevaz](https://github.com/Bevaz) + * [Bortek](https://github.com/bortek) + * [Rob Speed](https://github.com/rspeed) + * [Renha](https://github.com/Renha) + * [Antoine Bertin](https://github.com/Diaoul) + * [Teja Philipp](https://github.com/hungerpirat) + * ["matobago"](https://github.com/matobago) + * ["nophead"](https://github.com/nophead) + * [Bob Clough](https://github.com/thinkl33t) + * [Mikk Kiilaspää](https://github.com/Mikk36) + * [Jack Minardi](https://github.com/jminardi) + * [Mark Walker](https://github.com/markwal) + * [Lucas Clemente](https://github.com/lucas-clemente) + * [Andrew Erickson](https://github.com/aerickson) + * [Nicanor Romero Venier](https://github.com/nicanor-romero) + +OctoPrint started off as a fork of [Cura](https://github.com/daid/Cura) by +[Daid Braam](https://github.com/daid). Parts of its communication layer and +the server side GCODE interpreter are still based on Cura's code base from +December 2012 and hence on the work of its authors up until then. diff --git a/CHANGELOG.md b/CHANGELOG.md index 31c9fac96..11546dbf1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,37 @@ # OctoPrint Changelog +## 1.2.4 (2015-07-23) + +### Improvements + + * `RepeatedTimer` now defaults to `daemon` set to `True`. This makes sure + plugins using it don't have to remember to set that flag themselves in + order for the server to properly shut down when timers are still active. + * Fixed a typo in the docs about `logging.yaml` (top level element is + `loggers`, not `logger`). + * Support for plugins with external dependencies (`dependency_links` in + setuptools), interesting for plugin authors who need to depend on Python + libraries that are (not yet) available on PyPI. + * Better resilience against errors within plugins. + +### Bug Fixes + + * Do not cache web page when running for the first time, to avoid caching + the first run dialog popup along side with it. This should solve issues + people were having when configuring OctoPrint for the first time, then + reloading the page without clearing the cache, being again prompted with + the dialog with no chance to clear it. + * Fix/workaround for occasional white panes in settings dialog on Safari 8, + which appears to have an issue with fixed positioning. + * Fixed form field truncation in upload requests that could lead to problems + when trying to import Cura profiles with names longer than 28 characters. + * Fixed webcam rotation for timelapse rendering. + * Fixed user settings not reaching the editor in the frontend. + * Notifications that are in process of being closed don't open again on + mouse over (that was actually more of an unwanted feature). + +([Commits](https://github.com/foosel/OctoPrint/compare/1.2.3...1.2.4)) + ## 1.2.3 (2015-07-09) ### Improvements diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4f4c46cf8..24bc38902 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -21,29 +21,31 @@ Pull Requests plugin. If the current plugin system doesn't allow you to implement your feature as a plugin, create a "Brainstorming" ticket to get the discussion going how best to solve *this* in OctoPrint's plugin system - maybe that's the actual PR you have been waiting for to contribute :) -2. If you plan to make **any large changes to the code or appearance, please open a "Brainstorming" ticket first** so that +2. If you plan to make **any large changes to the code or appearance, please open a "Brainstorming" ticket first** so that we can determine if it's a good time for your specific pull request. It might be that I'm currently in the process of - making heavy changes to the code locations you'd target as well, or your approach doesn't fit the general "project + making heavy changes to the code locations you'd target as well, or your approach doesn't fit the general "project vision", and that would just cause unnecessary work and frustration for everyone or possibly get the PR rejected. 3. When adding code to OctoPrint, make sure you **follow the current coding style**. That means tabs instead of spaces in the python files (yes, I know that this goes against PEP-8, I don't care) and space instead of tabs in the Javascript sources, english language (that means code, variables, comments!), comments where necessary (tell why the code does something like it does it, structure your code), following the general architecture. If your PR needs to make changes to the Stylesheets, - change the ``.less`` files from which the CSS is compiled. PRs that contain direct changes to the compiled - CSS will be closed. -4. **Test your changes thoroughly**. That also means testing with usage scenarios you don't normally use, e.g. if you only + change the ``.less`` files from which the CSS is compiled. PRs that contain direct changes to the compiled + CSS will be closed. +4. **Test your changes thoroughly**. That also means testing with usage scenarios you don't normally use, e.g. if you only use access control, test without and vice versa. If you only test with your printer, test with the virtual printer and vice versa. State in your pull request how your tested your changes. 5. Please create all pull requests **against the `devel` branch**. 6. Create **one pull request per feature/bug fix**. 7. Create a **custom branch** for your feature/bug fix and use that as base for your pull request. Pull requests directly against your version of `devel` will be closed. -7. In your pull request's description, **state what your pull request is doing**, as in, what feature does it implement, what +8. In your pull request's description, **state what your pull request is doing**, as in, what feature does it implement, what bug does it fix. The more thoroughly you explain your intent behind the PR here, the higher the chances it will get merged fast. +9. Don't forget to **add yourself to the [AUTHORS](../AUTHORS.md) file** :) History ------- * 2015-01-23: More guidelines for creating pull requests, support/questions redirected to Mailinglist/G+ community * 2015-01-27: Added another explicit link to the FAQ + * 2015-07-07: Added step to add yourself to AUTHORS when creating a PR :) diff --git a/README.md b/README.md index ac80de2e2..57ebc9abb 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,35 @@ OctoPrint ========= -[![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=foosel&url=https://github.com/foosel/OctoPrint&title=OctoPrint&language=&tags=github&category=software) - OctoPrint provides a responsive web interface for controlling a 3D printer (RepRap, Ultimaker, ...). It is Free Software and released under the [GNU Affero General Public License V3](http://www.gnu.org/licenses/agpl.html). Its website can be found at [octoprint.org](http://octoprint.org). +The documentation is located at [docs.octoprint.org](http://docs.octoprint.org). + +You are currently looking at the source code repository of OctoPrint. If you already installed it +(e.g. by using the Raspberry Pi targeted distribution [OctoPi](https://github.com/guysoft/OctoPi)) and only +want to find out how to use it, [the documentation](http://docs.octoprint.org/) and [the public wiki](https://github.com/foosel/OctoPrint/wiki) +might be of more interest for you. You might also want to subscribe to [the mailing list](https://groups.google.com/group/octoprint) +or the [G+ Community](https://plus.google.com/communities/102771308349328485741) where there are other active users who might be +able to help you with any questions you might have. + Contributing ------------ -Please see the project's [Contribution Guidelines](https://github.com/foosel/OctoPrint/blob/master/CONTRIBUTING.md). +Contributions of all kinds are welcome, not only in the form of code but also with regards to the +[official documentation](http://docs.octoprint.org/) or [the public wiki](https://github.com/foosel/OctoPrint/wiki), support +of other users in the [bug tracker](https://github.com/foosel/OctoPrint/issues), +[the Mailinglist](https://groups.google.com/group/octoprint) or +[the G+ Community](https://plus.google.com/communities/102771308349328485741). + +If you think something is bad as it is about OctoPrint or its documentation the way it is, please help +in any way to make it better instead of just complaining about it -- this is an Open Source Project +after all :) + +For information about how to go about contributions of any kind, please see the project's +[Contribution Guidelines](https://github.com/foosel/OctoPrint/blob/master/CONTRIBUTING.md). Installation ------------ @@ -21,6 +39,11 @@ Installation instructions for installing from source for different operating sys If you want to run OctoPrint on a Raspberry Pi you might want to take a look at [OctoPi](https://github.com/guysoft/OctoPi) which is a custom SD card image that includes OctoPrint plus dependencies. +After installation, please make sure you follow the first-run wizard and set up +access control as necessary. If you want to not only be notified about new +releases but also be able to automatically upgrade to them from within +OctoPrint, take a look [at the documentation of the Software Update Plugin](https://github.com/foosel/OctoPrint/wiki/Plugin:-Software-Update#making-octoprint-updateable-on-existing-installations). + Dependencies ------------ @@ -36,7 +59,11 @@ OctoPrint currently only supports Python 2.7. Usage ----- -Running the `setup.py` script installs the `octoprint` script in your Python installation's scripts folder +Running the `setup.py` script via + + python setup.py install + +installs the `octoprint` script in your Python installation's scripts folder (which depending on whether you installed OctoPrint globally or into a virtual env will be on your `PATH` or not). The following usage examples assume that said `octoprint` script is on your `PATH`. @@ -77,5 +104,12 @@ which is located at `~/.octoprint` on Linux, at `%APPDATA%/OctoPrint` on Windows at `~/Library/Application Support/OctoPrint` on MacOS. A comprehensive overview of all available configuration settings can be found -[on the wiki](https://github.com/foosel/OctoPrint/wiki/Configuration). Please note that the most commonly used -configuration settings can also easily be edited from OctoPrint's settings dialog. +[in the docs](http://docs.octoprint.org/en/master/configuration/config_yaml.html). +Please note that the most commonly used configuration settings can also easily +be edited from OctoPrint's settings dialog. + +Special Thanks +-------------- + +The development of OctoPrint is sponsored and maintained by [BQ](http://www.bq.com/). +Cross-browser testing services are kindly provided by [BrowserStack](http://www.browserstack.com/). diff --git a/docs/configuration/logging_yaml.rst b/docs/configuration/logging_yaml.rst index daf8b462d..549611884 100644 --- a/docs/configuration/logging_yaml.rst +++ b/docs/configuration/logging_yaml.rst @@ -17,7 +17,7 @@ Changing log levels If you need to change the default logging level within OctoPrint, create the file with a text editor of your choice (it's usually not there). The general format is this:: - logger: + loggers: : level: @@ -27,7 +27,7 @@ new log level to set. An example for increasing the log level of the events and .. code-block:: yaml - logger: + loggers: octoprint.events: level: DEBUG octoprint.filemanager: @@ -97,4 +97,4 @@ expressed in YAML as follows: format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s" The possible keys for the logging format can be found in the -`Python documentation on LogRecord attributes `_. \ No newline at end of file +`Python documentation on LogRecord attributes `_. diff --git a/src/octoprint/filemanager/__init__.py b/src/octoprint/filemanager/__init__.py index 2fdfeb89c..dae5ed51d 100644 --- a/src/octoprint/filemanager/__init__.py +++ b/src/octoprint/filemanager/__init__.py @@ -314,7 +314,12 @@ def add_file(self, destination, path, file_object, links=None, allow_overwrite=F printer_profile = self._printer_profile_manager.get_current_or_default() for hook in self._preprocessor_hooks.values(): - hook_file_object = hook(path, file_object, links=links, printer_profile=printer_profile, allow_overwrite=allow_overwrite) + try: + hook_file_object = hook(path, file_object, links=links, printer_profile=printer_profile, allow_overwrite=allow_overwrite) + except: + self._logger.exception("Error when calling preprocessor hook {}, ignoring".format(hook)) + continue + if hook_file_object is not None: file_object = hook_file_object file_path = self._storage(destination).add_file(path, file_object, links=links, printer_profile=printer_profile, allow_overwrite=allow_overwrite) diff --git a/src/octoprint/plugins/pluginmanager/__init__.py b/src/octoprint/plugins/pluginmanager/__init__.py index a458acd13..c7950f481 100644 --- a/src/octoprint/plugins/pluginmanager/__init__.py +++ b/src/octoprint/plugins/pluginmanager/__init__.py @@ -39,6 +39,7 @@ def __init__(self): self._pending_uninstall = set() self._pip_caller = None + self._pip_version_dependency_links = pkg_resources.parse_version("1.5") self._repository_available = False self._repository_plugins = [] @@ -80,7 +81,9 @@ def get_settings_defaults(self): return dict( repository="http://plugins.octoprint.org/plugins.json", repository_ttl=24*60, - pip=None + pip=None, + dependency_links=False, + hidden=[] ) def on_settings_save(self, data): @@ -181,6 +184,7 @@ def on_api_command(self, command, data): plugin_name = data["plugin"] if "plugin" in data else None return self.command_install(url=url, force="force" in data and data["force"] in valid_boolean_trues, + dependency_links="dependency_links" in data and data["dependency_links"] in valid_boolean_trues, reinstall=plugin_name) elif command == "uninstall": @@ -199,7 +203,7 @@ def on_api_command(self, command, data): plugin = self._plugin_manager.plugins[plugin_name] return self.command_toggle(plugin, command) - def command_install(self, url=None, path=None, force=False, reinstall=None): + def command_install(self, url=None, path=None, force=False, reinstall=None, dependency_links=False): if url is not None: pip_args = ["install", sarge.shell_quote(url)] elif path is not None: @@ -207,6 +211,9 @@ def command_install(self, url=None, path=None, force=False, reinstall=None): else: raise ValueError("Either url or path must be provided") + if dependency_links or self._settings.get_boolean(["dependency_links"]): + pip_args.append("--process-dependency-links") + all_plugins_before = self._plugin_manager.find_plugins() success_string = "Successfully installed" @@ -415,8 +422,17 @@ def _send_result_notification(self, action, result): def _call_pip(self, args): if self._pip_caller is None or not self._pip_caller.available: raise RuntimeError(u"No pip available, can't operate".format(**locals())) + + if "--process-dependency-links" in args: + self._log_message(u"Installation needs to process external dependencies, that might make it take a bit longer than usual depending on the pip version") + if self._pip_caller < self._pip_version_dependency_links: + args.remove("--process-dependency-links") + return self._pip_caller.execute(*args) + def _log_message(self, *lines): + self._log(lines, prefix=u"*", stream="message") + def _log_call(self, *lines): self._log(lines, prefix=u" ", stream="call") @@ -515,6 +531,9 @@ def _refresh_repository(self, repo_data=None): def map_repository_entry(entry): result = dict(entry) + if not "follow_dependency_links" in result: + result["follow_dependency_links"] = False + result["is_compatible"] = dict( octoprint=True, os=True diff --git a/src/octoprint/plugins/pluginmanager/static/js/pluginmanager.js b/src/octoprint/plugins/pluginmanager/static/js/pluginmanager.js index eba85fade..7c5265ff5 100644 --- a/src/octoprint/plugins/pluginmanager/static/js/pluginmanager.js +++ b/src/octoprint/plugins/pluginmanager/static/js/pluginmanager.js @@ -70,6 +70,8 @@ $(function() { self.loglines = ko.observableArray([]); self.installedPlugins = ko.observableArray([]); + self.followDependencyLinks = ko.observable(false); + self.working = ko.observable(false); self.workingTitle = ko.observable(); self.workingDialog = undefined; @@ -125,6 +127,9 @@ $(function() { self.uploadButton.unbind("click"); self.uploadButton.bind("click", function() { self._markWorking(gettext("Installing plugin..."), gettext("Installing plugin from uploaded archive...")); + data.formData = { + dependency_links: self.followDependencyLinks() + }; data.submit(); return false; }); @@ -240,13 +245,13 @@ $(function() { } if (self.installed(data)) { - self.installPlugin(data.archive, data.title, data.id); + self.installPlugin(data.archive, data.title, data.id, data.follow_dependency_links || self.followDependencyLinks()); } else { - self.installPlugin(data.archive, data.title, undefined); + self.installPlugin(data.archive, data.title, undefined, data.follow_dependency_links || self.followDependencyLinks()); } }; - self.installPlugin = function(url, name, reinstall) { + self.installPlugin = function(url, name, reinstall, followDependencyLinks) { if (!self.loginState.isAdmin()) { return; } @@ -260,6 +265,10 @@ $(function() { } if (!url) return; + if (followDependencyLinks === undefined) { + followDependencyLinks = self.followDependencyLinks(); + } + var workTitle, workText; if (!reinstall) { workTitle = gettext("Installing plugin..."); @@ -275,7 +284,7 @@ $(function() { self._markWorking(workTitle, workText); var command = "install"; - var payload = {url: url}; + var payload = {url: url, dependency_links: followDependencyLinks}; if (reinstall) { payload["plugin"] = reinstall; payload["force"] = true; diff --git a/src/octoprint/plugins/pluginmanager/templates/pluginmanager_settings.jinja2 b/src/octoprint/plugins/pluginmanager/templates/pluginmanager_settings.jinja2 index 559817c06..b855dc81f 100644 --- a/src/octoprint/plugins/pluginmanager/templates/pluginmanager_settings.jinja2 +++ b/src/octoprint/plugins/pluginmanager/templates/pluginmanager_settings.jinja2 @@ -147,6 +147,21 @@ {{ _('This does not look like a valid plugin archive. Valid plugin archives should be either zip files or tarballs and have the extension ".zip", ".tar.gz", ".tgz" or ".tar"') }} + +
+ +
+
+
+
+ +
+
+
+
+