Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server api files inconsistent with new printer currentJob dictionary #476

Closed
CapnBry opened this issue May 23, 2014 · 7 comments

Comments

Projects
None yet
2 participants
@CapnBry
Copy link
Contributor

commented May 23, 2014

(devel branch) When a file is selected as the current job, if you upload a new version of that file the printer state doesn't update with the new details in the webui and no updated gcode file is requested by the browser.

Tracking this down, the server/api/files.py class still references the old currentJob['filename'] which is now currentJob.file.name (or is it currentJob['file']['name'] I am not good at python) and also 'sd' I believe is 'file.location'?

In any instance it also won't prevent you from uploading a file that's currently printing either, which could be an even nastier problem.

foosel added a commit that referenced this issue May 25, 2014

Properly detect current file, forgot to adjust detection stuff in upl…
…oad API after renaming things in the job tracking.

Thanks to Bryan Mayland for spotting this.

Closes #476
@foosel

This comment has been minimized.

Copy link
Owner

commented May 25, 2014

Thanks for spotting this, should be fixed now.

@foosel foosel closed this May 25, 2014

@CapnBry

This comment has been minimized.

Copy link
Contributor Author

commented May 28, 2014

It still doesn't properly detect a file change on the current job I'm afraid :(

In selectAndOrPrint() the variable filename isn't in scope, so that's None and nameToSelect I think has the full file path so that's not directly comparable to currentFilename either. printer.selectFile() I believe wants the full path so you can't just pass the basename. You can't pass both to selectAndOrPrint because that changes the function signature used by the SD streamer callback.

Oye vey! The simple solution would be to from os.path import basename; filename = basename(nameToSelect) but I'm not sure how happy you'd be with how clean that is.

@foosel foosel reopened this Jun 23, 2014

foosel added a commit that referenced this issue Jun 23, 2014

@foosel

This comment has been minimized.

Copy link
Owner

commented Jun 23, 2014

Ookay... I changed some signatures, tested things both with local and SD files, both currently selected and not selected, both via the UI and directly via the API.

Can you try again too?

@CapnBry

This comment has been minimized.

Copy link
Contributor Author

commented Jun 23, 2014

Confirmed working with selected / not selected / sd card / local. The whiteboard works!

Should I mention that the metadata doesn't fill in on the currently selected file when the background processing completes or will I get the hose again?

@foosel

This comment has been minimized.

Copy link
Owner

commented Jun 23, 2014

goes to fetch the hose

foosel added a commit that referenced this issue Jun 23, 2014

@foosel

This comment has been minimized.

Copy link
Owner

commented Jun 23, 2014

There you are :)

@foosel foosel closed this Jun 23, 2014

@CapnBry

This comment has been minimized.

Copy link
Contributor Author

commented Jun 23, 2014

It is everything I ever wanted in a changeset and more.

foosel added a commit that referenced this issue Aug 8, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.