diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7ff95e3ac..daa806b93 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -41,6 +41,13 @@
* The "Slicing done" notification is now colored green ([#558](https://github.com/foosel/OctoPrint/issues/558)).
* File management now supports STL files as first class citizens (including UI adjustments to allow management of
uploaded STL files including removal and reslicing) and also allows folders (not yet supported by UI)
+* Also interpret lines starting with "!!" as errors
+* Added deletion of pyc files to the `python setup.py clean` command
+* Settings now show a QRCode for the API Key ([#637](https://github.com/foosel/OctoPrint/pull/637))
+* Username in login dialog is not automatically capitalized on mobile devices anymore ([#639](https://github.com/foosel/OctoPrint/pull/639))
+* "Slicing Done" and "Streaming Done" notifications now have a green background ([#558](https://github.com/foosel/OctoPrint/issues/558))
+* Files that are currently in use, be it for slicing, printing or whatever, are now tracked and can not be deleted as
+ long as they are in use
### Bug Fixes
@@ -48,11 +55,22 @@
as 0
* [#633](https://github.com/foosel/OctoPrint/issues/633) - Correctly interpret temperature lines from multi extruder
setups under Smoothieware
+* [#556](https://github.com/foosel/OctoPrint/issues/556) - Allow login of the same user from multiple browsers without
+ side effects
* Various fixes of bugs in newly introduced features and improvements:
* [#625](https://github.com/foosel/OctoPrint/pull/625) - Newly added GCODE files were not being added to the analysis
queue
+* Various fixes without tickets:
+ * GCODE viewer now doesn't stumble over completely extrusionless GCODE files
-## 1.1.1 (Unreleased)
+## 1.1.2 (Unreleased)
+
+### Bug Fixes
+
+* [#634](https://github.com/foosel/OctoPrint/pull/634) - Fixed missing `branch` fields in version dicts generated
+ by versioneer
+
+## 1.1.1 (2014-10-27)
### Improvements
diff --git a/README.md b/README.md
index f219d1226..ac80de2e2 100644
--- a/README.md
+++ b/README.md
@@ -29,43 +29,45 @@ OctoPrint via `setup.py`:
python setup.py install
-You should also do this after pulling from the repository, since the dependencies might have changed.
+You should also do this every time after pulling from the repository, since the dependencies might have changed.
OctoPrint currently only supports Python 2.7.
Usage
-----
-From the source directory you can start the server via
+Running the `setup.py` script 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`.
- ./run
+You can start the server via
+
+ octoprint
By default it binds to all interfaces on port 5000 (so pointing your browser to `http://127.0.0.1:5000`
will do the trick). If you want to change that, use the additional command line parameters `host` and `port`,
which accept the host ip to bind to and the numeric port number respectively. If for example you want the server
to only listen on the local interface on port 8080, the command line would be
- ./run --host=127.0.0.1 --port=8080
+ octoprint --host=127.0.0.1 --port=8080
Alternatively, the host and port on which to bind can be defined via the configuration.
If you want to run OctoPrint as a daemon (only supported on Linux), use
- ./run --daemon {start|stop|restart} [--pid PIDFILE]
+ octoprint --daemon {start|stop|restart} [--pid PIDFILE]
If you do not supply a custom pidfile location via `--pid PIDFILE`, it will be created at `/tmp/octoprint.pid`.
You can also specify the configfile or the base directory (for basing off the `uploads`, `timelapse` and `logs` folders),
e.g.:
- ./run --config /path/to/another/config.yaml --basedir /path/to/my/basedir
+ octoprint --config /path/to/another/config.yaml --basedir /path/to/my/basedir
-See `run --help` for further information.
-
-Running the `setup.py` script also installs the `octoprint` startup 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
-examples above also work with that startup script as it excepts the same parameters as `run`.
+See `octoprint --help` for further information.
+OctoPrint also ships with a `run` script in its source directory. You can also invoke that to start up the server, it
+takes the same command line arguments as the `octoprint` script.
Configuration
-------------
@@ -75,4 +77,5 @@ 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).
+[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.
diff --git a/setup.py b/setup.py
index d6b6cb4ba..268768838 100644
--- a/setup.py
+++ b/setup.py
@@ -33,6 +33,26 @@ def package_data_dirs(source, sub_folders):
return dirs
+def _recursively_handle_files(directory, file_matcher, folder_handler=None, file_handler=None):
+ applied_handler = False
+
+ for filename in os.listdir(directory):
+ path = os.path.join(directory, filename)
+
+ if file_handler is not None and file_matcher(filename):
+ file_handler(path)
+ applied_handler = True
+
+ elif os.path.isdir(path):
+ sub_applied_handler = _recursively_handle_files(path, file_matcher, folder_handler=folder_handler, file_handler=file_handler)
+ if sub_applied_handler:
+ applied_handler = True
+
+ if folder_handler is not None:
+ folder_handler(path, sub_applied_handler)
+
+ return applied_handler
+
class CleanCommand(Command):
description = "clean build artifacts"
user_options = []
@@ -45,14 +65,37 @@ class CleanCommand(Command):
pass
def run(self):
+ # build folder
if os.path.exists('build'):
print "Deleting build directory"
shutil.rmtree('build')
+
+ # eggs
eggs = glob.glob('OctoPrint*.egg-info')
for egg in eggs:
print "Deleting %s directory" % egg
shutil.rmtree(egg)
+ # pyc files
+ def delete_folder_if_empty(path, applied_handler):
+ if not applied_handler:
+ return
+ if len(os.listdir(path)) == 0:
+ shutil.rmtree(path)
+ print "Deleted %s since it was empty" % path
+
+ def delete_file(path):
+ os.remove(path)
+ print "Deleted %s" % path
+
+ import fnmatch
+ _recursively_handle_files(
+ os.path.abspath("src"),
+ lambda name: fnmatch.fnmatch(name.lower(), "*.pyc"),
+ folder_handler=delete_folder_if_empty,
+ file_handler=delete_file
+ )
+
class NewTranslation(Command):
description = "create a new translation"
diff --git a/src/octoprint/_version.py b/src/octoprint/_version.py
index 3808a4f84..35090f5b8 100644
--- a/src/octoprint/_version.py
+++ b/src/octoprint/_version.py
@@ -214,7 +214,7 @@ def versions_from_parentdir(parentdir_prefix, root, verbose=False):
print("guessing rootdir is '%s', but '%s' doesn't start with prefix '%s'" %
(root, dirname, parentdir_prefix))
return None
- return {"version": dirname[len(parentdir_prefix):], "full": ""}
+ return {"version": dirname[len(parentdir_prefix):], "full": "", "branch": ""}
tag_prefix = ""
parentdir_prefix = ""
@@ -249,7 +249,7 @@ def parse_lookup_file(root, lookup_path=None):
break
return lookup
-def get_versions(default={"version": "unknown", "full": ""}, lookup_path=None, verbose=False):
+def get_versions(default={"version": "unknown", "full": "", "branch": "unknown"}, lookup_path=None, verbose=False):
# I am in _version.py, which lives at ROOT/VERSIONFILE_SOURCE. If we have
# __file__, we can work backwards from there to the root. Some
# py2exe/bbfreeze/non-CPython implementations don't do __file__, in which
diff --git a/src/octoprint/static/js/app/main.js b/src/octoprint/static/js/app/main.js
index 4edd11061..cef1e1556 100644
--- a/src/octoprint/static/js/app/main.js
+++ b/src/octoprint/static/js/app/main.js
@@ -378,6 +378,31 @@ $(function() {
}
};
+ ko.bindingHandlers.qrcode = {
+ update: function(element, valueAccessor, allBindings, viewModel, bindingContext) {
+ var val = ko.utils.unwrapObservable(valueAccessor());
+
+ var defaultOptions = {
+ text: "",
+ size: 200,
+ fill: "#000",
+ background: null,
+ label: "",
+ fontname: "sans",
+ fontcolor: "#000",
+ radius: 0,
+ ecLevel: "L"
+ };
+
+ var options = {};
+ _.each(defaultOptions, function(value, key) {
+ options[key] = ko.utils.unwrapObservable(val[key]) || value;
+ });
+
+ $(element).empty().qrcode(options);
+ }
+ };
+
ko.bindingHandlers.invisible = {
init: function(element, valueAccessor, allBindings, viewModel, bindingContext) {
if (!valueAccessor()) return;
diff --git a/src/octoprint/static/js/app/viewmodels/gcode.js b/src/octoprint/static/js/app/viewmodels/gcode.js
index b7396d326..5c8824651 100644
--- a/src/octoprint/static/js/app/viewmodels/gcode.js
+++ b/src/octoprint/static/js/app/viewmodels/gcode.js
@@ -354,11 +354,13 @@ function GcodeViewModel(loginStateViewModel, settingsViewModel) {
output.push(gettext("Layer number") + ": " + (layer.number + 1));
output.push(gettext("Layer height") + " (mm): " + layer.height);
output.push(gettext("GCODE commands in layer") + ": " + layer.commands);
- if (layer.filament.length == 1) {
- output.push(gettext("Filament used by layer") + ": " + layer.filament[0].toFixed(2) + "mm");
- } else {
- for (var i = 0; i < layer.filament.length; i++) {
- output.push(gettext("Filament used by layer") + " (" + gettext("Tool") + " " + i + "): " + layer.filament[i].toFixed(2) + "mm");
+ if (layer.filament != undefined) {
+ if (layer.filament.length == 1) {
+ output.push(gettext("Filament used by layer") + ": " + layer.filament[0].toFixed(2) + "mm");
+ } else {
+ for (var i = 0; i < layer.filament.length; i++) {
+ output.push(gettext("Filament used by layer") + " (" + gettext("Tool") + " " + i + "): " + layer.filament[i].toFixed(2) + "mm");
+ }
}
}
output.push(gettext("Print time for layer") + ": " + formatDuration(layer.printTime));
diff --git a/src/octoprint/static/js/app/viewmodels/settings.js b/src/octoprint/static/js/app/viewmodels/settings.js
index 54bd19e56..9c37e452b 100644
--- a/src/octoprint/static/js/app/viewmodels/settings.js
+++ b/src/octoprint/static/js/app/viewmodels/settings.js
@@ -380,5 +380,4 @@ function SettingsViewModel(loginStateViewModel, usersViewModel) {
}
});
};
-
}
diff --git a/src/octoprint/static/js/lib/jquery/jquery.qrcode.min.js b/src/octoprint/static/js/lib/jquery/jquery.qrcode.min.js
new file mode 100644
index 000000000..6e2dbcde1
--- /dev/null
+++ b/src/octoprint/static/js/lib/jquery/jquery.qrcode.min.js
@@ -0,0 +1,2 @@
+/* jQuery.qrcode 0.11.0 - http://larsjung.de/jquery-qrcode/ - uses //github.com/kazuhikoarase/qrcode-generator (MIT) */
+!function(){"use strict";function r(r,t,e,n){function o(r,t){return r-=n,t-=n,0>r||r>=a||0>t||t>=a?!1:i.isDark(r,t)}var i=y(e,t);i.addData(r),i.make(),n=n||0;var a=i.getModuleCount(),u=i.getModuleCount()+2*n,f=function(r,t,e,n){var o=this.isDark,i=1/u;this.isDark=function(a,u){var f=u*i,l=a*i,c=f+i,g=l+i;return o(a,u)&&(r>c||f>e||t>g||l>n)}};this.text=r,this.level=t,this.version=e,this.moduleCount=u,this.isDark=o,this.addBlank=f}function t(t,e,n,o,i){n=Math.max(1,n||1),o=Math.min(40,o||40);for(var a=n;o>=a;a+=1)try{return new r(t,e,a,i)}catch(u){}}function e(r,t,e){var n=e.size,o="bold "+e.mSize*n+"px "+e.fontname,i=d("")[0].getContext("2d");i.font=o;var a=i.measureText(e.label).width,u=e.mSize,f=a/n,l=(1-f)*e.mPosX,c=(1-u)*e.mPosY,g=l+f,s=c+u,h=.01;1===e.mode?r.addBlank(0,c-h,n,s+h):r.addBlank(l-h,c-h,g+h,s+h),t.fillStyle=e.fontcolor,t.font=o,t.fillText(e.label,l*n,c*n+.75*e.mSize*n)}function n(r,t,e){var n=e.size,o=e.image.naturalWidth||1,i=e.image.naturalHeight||1,a=e.mSize,u=a*o/i,f=(1-u)*e.mPosX,l=(1-a)*e.mPosY,c=f+u,g=l+a,s=.01;3===e.mode?r.addBlank(0,l-s,n,g+s):r.addBlank(f-s,l-s,c+s,g+s),t.drawImage(e.image,f*n,l*n,u*n,a*n)}function o(r,t,o){d(o.background).is("img")?t.drawImage(o.background,0,0,o.size,o.size):o.background&&(t.fillStyle=o.background,t.fillRect(o.left,o.top,o.size,o.size));var i=o.mode;1===i||2===i?e(r,t,o):(3===i||4===i)&&n(r,t,o)}function i(r,t,e,n,o,i,a,u){r.isDark(a,u)&&t.rect(n,o,i,i)}function a(r,t,e,n,o,i,a,u,f,l){a?r.moveTo(t+i,e):r.moveTo(t,e),u?(r.lineTo(n-i,e),r.arcTo(n,e,n,o,i)):r.lineTo(n,e),f?(r.lineTo(n,o-i),r.arcTo(n,o,t,o,i)):r.lineTo(n,o),l?(r.lineTo(t+i,o),r.arcTo(t,o,t,e,i)):r.lineTo(t,o),a?(r.lineTo(t,e+i),r.arcTo(t,e,n,e,i)):r.lineTo(t,e)}function u(r,t,e,n,o,i,a,u,f,l){a&&(r.moveTo(t+i,e),r.lineTo(t,e),r.lineTo(t,e+i),r.arcTo(t,e,t+i,e,i)),u&&(r.moveTo(n-i,e),r.lineTo(n,e),r.lineTo(n,e+i),r.arcTo(n,e,n-i,e,i)),f&&(r.moveTo(n-i,o),r.lineTo(n,o),r.lineTo(n,o-i),r.arcTo(n,o,n-i,o,i)),l&&(r.moveTo(t+i,o),r.lineTo(t,o),r.lineTo(t,o-i),r.arcTo(t,o,t+i,o,i))}function f(r,t,e,n,o,i,f,l){var c=r.isDark,g=n+i,s=o+i,h=e.radius*i,v=f-1,d=f+1,w=l-1,m=l+1,T=c(f,l),y=c(v,w),p=c(v,l),B=c(v,m),E=c(f,m),k=c(d,m),A=c(d,l),M=c(d,w),D=c(f,w);T?a(t,n,o,g,s,h,!p&&!D,!p&&!E,!A&&!E,!A&&!D):u(t,n,o,g,s,h,p&&D&&y,p&&E&&B,A&&E&&k,A&&D&&M)}function l(r,t,e){var n,o,a=r.moduleCount,u=e.size/a,l=i;for(m&&e.radius>0&&e.radius<=.5&&(l=f),t.beginPath(),n=0;a>n;n+=1)for(o=0;a>o;o+=1){var c=e.left+o*u,g=e.top+n*u,s=u;l(r,t,e,c,g,s,n,o)}if(d(e.fill).is("img")){t.strokeStyle="rgba(0,0,0,0.5)",t.lineWidth=2,t.stroke();var h=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",t.fill(),t.globalCompositeOperation=h,t.clip(),t.drawImage(e.fill,0,0,e.size,e.size),t.restore()}else t.fillStyle=e.fill,t.fill()}function c(r,e){var n=t(e.text,e.ecLevel,e.minVersion,e.maxVersion,e.quiet);if(!n)return null;var i=d(r).data("qrcode",n),a=i[0].getContext("2d");return o(n,a,e),l(n,a,e),i}function g(r){var t=d("").attr("width",r.size).attr("height",r.size);return c(t,r)}function s(r){return d("").attr("src",g(r)[0].toDataURL("image/png"))}function h(r){var e=t(r.text,r.ecLevel,r.minVersion,r.maxVersion,r.quiet);if(!e)return null;var n,o,i=r.size,a=r.background,u=Math.floor,f=e.moduleCount,l=u(i/f),c=u(.5*(i-l*f)),g={position:"relative",left:0,top:0,padding:0,margin:0,width:i,height:i},s={position:"absolute",padding:0,margin:0,width:l,height:l,"background-color":r.fill},h=d("