Skip to content

Commit

Permalink
misc. minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
berrystephenw committed Jun 7, 2021
1 parent b33fc69 commit 512e524
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 31 deletions.
5 changes: 2 additions & 3 deletions octoprint_fortune/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ def on_after_startup(self):

self._logger.info("--------------------------------------------")
self._logger.info(f"Fortune started: {self._plugin_version}")
self._logger.info(f"Fortune name: {self._identifier}")
self._logger.info("--------------------------------------------")

##~~ SettingsPlugin mixin
Expand All @@ -169,7 +168,7 @@ def get_settings_defaults(self):
"push_message": None,
"show_navbar_button": True,
"enable_text_fortunes": False,
"timeout": 1,
"timeout": 10,
# put your plugin's default settings here
}

Expand Down Expand Up @@ -204,7 +203,7 @@ def get_update_information(self):
# If you want your plugin to be registered within OctoPrint under a different name than what you defined in setup.py
# ("OctoPrint-PluginSkeleton"), you may define that here. Same goes for the other metadata derived from setup.py that
# can be overwritten via __plugin_xyz__ control properties. See the documentation for that.
__plugin_name__ = "Fortune Plugin"
__plugin_name__ = "Fortune"

# Starting with OctoPrint 1.4.0 OctoPrint will also support to run under Python 3 in addition to the deprecated
# Python 2. New plugins should make sure to run under both versions for now. Uncomment one of the following
Expand Down
6 changes: 1 addition & 5 deletions octoprint_fortune/static/js/fortune.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ $(function() {
url: API_BASEURL + "plugin/fortune",
type: "GET",
dataType: "json",
data: "test", // {
//command: "test",
/* token: self.settings.settings.plugins.OctoText.access_token(), */
//channel: 1
//},
data: "test",
contentType: "application/json; charset=UTF-8",
success: function (response) {
var delayf;
Expand Down
48 changes: 25 additions & 23 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# coding=utf-8

########################################################################################################################
### Do not forget to adjust the following variables to your own plugin.

Expand All @@ -14,7 +12,7 @@
plugin_name = "OctoPrint-Fortune"

# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
plugin_version = "0.1.0"
plugin_version = "0.1.1"

# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
# module
Expand Down Expand Up @@ -66,31 +64,35 @@
from setuptools import setup

try:
import octoprint_setuptools
import octoprint_setuptools
except:
print("Could not import OctoPrint's setuptools, are you sure you are running that under "
"the same python installation that OctoPrint is installed under?")
import sys
sys.exit(-1)
print(
"Could not import OctoPrint's setuptools, are you sure you are running that under "
"the same python installation that OctoPrint is installed under?"
)
import sys

sys.exit(-1)

setup_parameters = octoprint_setuptools.create_plugin_setup_parameters(
identifier=plugin_identifier,
package=plugin_package,
name=plugin_name,
version=plugin_version,
description=plugin_description,
author=plugin_author,
mail=plugin_author_email,
url=plugin_url,
license=plugin_license,
requires=plugin_requires,
additional_packages=plugin_additional_packages,
ignored_packages=plugin_ignored_packages,
additional_data=plugin_additional_data
identifier=plugin_identifier,
package=plugin_package,
name=plugin_name,
version=plugin_version,
description=plugin_description,
author=plugin_author,
mail=plugin_author_email,
url=plugin_url,
license=plugin_license,
requires=plugin_requires,
additional_packages=plugin_additional_packages,
ignored_packages=plugin_ignored_packages,
additional_data=plugin_additional_data,
)

if len(additional_setup_parameters):
from octoprint.util import dict_merge
setup_parameters = dict_merge(setup_parameters, additional_setup_parameters)
from octoprint.util import dict_merge

setup_parameters = dict_merge(setup_parameters, additional_setup_parameters)

setup(**setup_parameters)

0 comments on commit 512e524

Please sign in to comment.