Skip to content
This repository was archived by the owner on Jun 28, 2021. It is now read-only.

Commit c977aef

Browse files
committed
Add auto update hook + update version number
1 parent cac9f9b commit c977aef

File tree

2 files changed

+32
-33
lines changed

2 files changed

+32
-33
lines changed

octoprint_cyborgtheme/__init__.py

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,35 @@
55

66
class CyborgThemePlugin(octoprint.plugin.AssetPlugin):
77

8-
def get_assets(self):
9-
return dict(
10-
css=["css/cyborg.css", "css/overrides-min.css", "css/bootstrap-modal.css"]
11-
)
8+
def get_assets(self):
9+
return dict(
10+
css=["css/cyborg.css", "css/overrides-min.css", "css/bootstrap-modal.css"]
11+
)
12+
13+
def get_update_information(self):
14+
return dict(
15+
cyborgtheme=dict(
16+
displayName="Cyborg Theme",
17+
displayVersion=self._plugin_version,
18+
19+
# version check: github repository
20+
type="github_release",
21+
user="ntoff",
22+
repo="Octoprint-CyborgTheme",
23+
current=self._plugin_version,
24+
25+
# update method: pip
26+
pip="https://github.com/ntoff/Octoprint-CyborgTheme/archive/{target_version}.zip"
27+
)
28+
)
1229

1330
__plugin_name__ = "Cyborg Theme"
14-
__plugin_implementation__ = CyborgThemePlugin()
31+
32+
def __plugin_load__():
33+
global __plugin_implementation__
34+
__plugin_implementation__ = __plugin_implementation__ = CyborgThemePlugin()
35+
36+
global __plugin_hooks__
37+
__plugin_hooks__ = {
38+
"octoprint.plugin.softwareupdate.check_config": __plugin_implementation__.get_update_information
39+
}

setup.py

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,36 @@
11
# coding=utf-8
22

3-
########################################################################################################################
4-
### Do not forget to adjust the following variables to your own plugin.
53

6-
# The plugin's identifier, has to be unique
74
plugin_identifier = "cyborgtheme"
85

9-
# The plugin's python package, should be "octoprint_<plugin identifier>", has to be unique
106
plugin_package = "octoprint_cyborgtheme"
117

12-
# The plugin's human readable name. Can be overwritten within OctoPrint's internal data via __plugin_name__ in the
13-
# plugin module
148
plugin_name = "OctoPrint-CyborgTheme"
159

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

19-
# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
20-
# module
21-
plugin_description = """Bootstrap Cyborg theme for octoprint: https://bootswatch.com/2/cyborg/"""
12+
plugin_description = """Bootstrap Cyborg theme ( https://bootswatch.com/2/cyborg/ ) adapted for octoprint."""
2213

23-
# The plugin's author. Can be overwritten within OctoPrint's internal data via __plugin_author__ in the plugin module
2414
plugin_author = "ntoff"
2515

26-
# The plugin's author's mail address.
2716
plugin_author_email = ""
2817

29-
# The plugin's homepage URL. Can be overwritten within OctoPrint's internal data via __plugin_url__ in the plugin module
3018
plugin_url = "https://github.com/ntoff/OctoPrint-CyborgTheme"
3119

32-
# The plugin's license. Can be overwritten within OctoPrint's internal data via __plugin_license__ in the plugin module
3320
plugin_license = "AGPLv3"
3421

35-
# Any additional requirements besides OctoPrint should be listed here
3622
plugin_requires = []
3723

3824
### --------------------------------------------------------------------------------------------------------------------
3925
### More advanced options that you usually shouldn't have to touch follow after this point
4026
### --------------------------------------------------------------------------------------------------------------------
4127

42-
# Additional package data to install for this plugin. The subfolders "templates", "static" and "translations" will
43-
# already be installed automatically if they exist.
4428
plugin_additional_data = []
4529

46-
# Any additional python packages you need to install with your plugin that are not contained in <plugin_package>.*
4730
plugin_additional_packages = []
4831

49-
# Any python packages within <plugin_package>.* you do NOT want to install with your plugin
5032
plugin_ignored_packages = []
5133

52-
# Additional parameters for the call to setuptools.setup. If your plugin wants to register additional entry points,
53-
# define dependency links or other things like that, this is the place to go. Will be merged recursively with the
54-
# default setup parameters as provided by octoprint_setuptools.create_plugin_setup_parameters using
55-
# octoprint.util.dict_merge.
56-
#
57-
# Example:
58-
# plugin_requires = ["someDependency==dev"]
59-
# additional_setup_parameters = {"dependency_links": ["https://github.com/someUser/someRepo/archive/master.zip#egg=someDependency-dev"]}
6034
additional_setup_parameters = {}
6135

6236
########################################################################################################################

0 commit comments

Comments
 (0)