This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
'progress': { | |
'completion': 75.75757575757575, | |
'printTimeLeftOrigin': 'linear', | |
'printTime': 147, | |
'printTimeLeft': 178, | |
'filepos': 375 | |
}, | |
'state': { | |
'text': 'Printing', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _TEST(self, comm, script_type, script_name, *args, **kwargs): | |
if not script_type == "gcode": | |
return None | |
if script_name == "afterPrinterConnected": | |
prefix = "M117 prefix" | |
postfix = "M117 postfix" | |
return prefix, postfix | |
elif script_name == "beforePrinterDisconnected": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm -rf ~/oprint | |
python2.7 -m virtualenv ~/oprint | |
~/oprint/bin/pip install --index-url https://pypi.python.org/simple --upgrade pip | |
printf -- "[easy_install]\nindex-url = https://pypi.python.org/simple\n" > ~/.pydistutils.cfg | |
cd ~/OctoPrint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#FROM: | |
def _reset_idle_timer(self): | |
if self._idleTimer: | |
self._idleTimer.reset() | |
else: | |
self._start_idle_timer() | |
#TO: | |
def _reset_idle_timer(self): | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@psucontrol-on-color: #00FF00; | |
@psucontrol-off-color: #808080; | |
psucontrol_indicator { | |
&.on i { | |
color: @psucontrol-on-color; | |
} | |
&.off i { | |
color: @psucontrol-off-color; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def cli_commands(self, cli_group, pass_octoprint_ctx, *args, **kwargs): | |
import click | |
import sys | |
import requests.exceptions | |
from octoprint_client import Client, build_base_url | |
def _api_command(command): | |
host = cli_group.settings.get(["server", "host"]) | |
host = host if host != "0.0.0.0" else "127.0.0.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import logging.handlers | |
import logging.config | |
import threading | |
import time | |
import string | |
import serial | |
class SBLCD(): | |
logger = logging.getLogger('SBLCD') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_settings_version(self): | |
return 9 | |
def on_settings_migrate(self, target, current=None): | |
self._logger.debug("on_settings_migrate() target=%s, current=%s" % (target, current)) | |
if current is None or current < 2: | |
return | |
# v2 changes names of settings variables to accomidate system commands. | |
cur_switchingMethod = self._settings.get(["switchingMethod"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def on_event(self, event, payload): | |
if event == Events.CLIENT_OPENED: | |
self._plugin_manager.send_plugin_message(self._identifier, dict(automaticShutdownEnabled=self._automatic_shutdown_enabled, type="timeout", timeout_value=self._timeout_value)) | |
return | |
if event == Events.MOVIE_RENDERING: | |
self._logger.debug("Adding %s to the rendering queue." % payload.movie_basename) | |
self._renderingQueue.append(payload.movie_basename) | |
return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def on_event(self, event, payload): | |
if event == Events.CLIENT_OPENED: | |
self._plugin_manager.send_plugin_message(self._identifier, dict(automaticShutdownEnabled=self._automatic_shutdown_enabled, type="timeout", timeout_value=self._timeout_value)) | |
return | |
if not self._automatic_shutdown_enabled or not self._settings.global_get(["server", "commands", "systemShutdownCommand"]): | |
return | |
if event not in [Events.PRINT_DONE, Events.MOVIE_DONE, Events.MOVIE_FAILED]: | |
return |
NewerOlder