Skip to content

Commit

Permalink
Merge pull request #73 from neomonkeus/develop
Browse files Browse the repository at this point in the history
Formatting pep8 from neomonkeus
  • Loading branch information
TheDuckCow authored May 28, 2021
2 parents e0735a7 + 07d80bb commit 847a1bb
Show file tree
Hide file tree
Showing 5 changed files with 3,237 additions and 3,200 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Included in this repository is an example addon which is integrates the auto-upd
....
updater_intrval_minutes = bpy.props.IntProperty(
updater_interval_minutes = bpy.props.IntProperty(
name='Minutes',
description = "Number of minutes between checking for updates",
default=0,
Expand Down Expand Up @@ -149,7 +149,7 @@ if updater.update_ready == True:
if res == 0:
print("Update ran successfully, restart blender")
else:
print("Updater returned "+str(res)+", error occurred")
print("Updater returned " + str(res) + ", error occurred")
elif updater.update_ready == False:
print("No update available")
elif updater.update_ready == None:
Expand All @@ -160,11 +160,11 @@ elif updater.update_ready == None:

```
tag_version = updater.tags[2] # or otherwise select a valid tag
res = updater.run_update(force=False,revert_tag=None, callback=function_obj)
res = updater.run_update(force=False, revert_tag=None, callback=function_obj)
if res == 0:
print("Update ran successfully, restart blender")
else:
print("Updater returned "+str(res)+", error occurred")
print("Updater returned " + str(res) + ", error occurred")
```


Expand All @@ -173,11 +173,11 @@ If utilizing updater.include_branches, you can grab the latest release tag by sk
```
n = len(updater.include_branch_list)
tag_version = updater.tags[n] # or otherwise select a valid tag
res = updater.run_update(force=False,revert_tag=None, callback=function_obj)
res = updater.run_update(force=False, revert_tag=None, callback=function_obj)
if res == 0:
print("Update ran successfully, restart blender")
else:
print("Updater returned "+str(res)+", error occurred")
print("Updater returned " + str(res) + ", error occurred")
```


Expand Down Expand Up @@ -515,7 +515,7 @@ To accomplish the mentioned behavior, use the below configuration.

```
updater.overwrite_patterns = ["README.md", "custom_icon.png"]
updater.remove_pre_update_patterns = ["*.py","*.pyc", "default.blend"]
updater.remove_pre_update_patterns = ["*.py", "*.pyc", "default.blend"]
```

Breaking this down, we always specify to overwrite the README and custom_icon.png files explicitly. No need to remove either in pre update since we expect they will be found in the update, and the overwrite patterns ensures they always get overwritten and only those files.
Expand Down
27 changes: 15 additions & 12 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
bl_info = {
"name": "Addon Updater Demo",
"description": "Demo addon for showcasing the blender-addon-updater module",
"author": "Patrick W. Crawford",
"version": (1, 0, 9),
"author": "Patrick W. Crawford, neomonkeus",
"version": (1, 1, 0),
"blender": (2, 80, 0),
"location": "View 3D > Tool Shelf > Demo Updater",
"warning": "", # used for warning icon and text in addons panel
Expand All @@ -36,10 +36,10 @@
from . import addon_updater_ops


class OBJECT_PT_DemoUpdaterPanel(bpy.types.Panel):
class DemoUpdaterPanel(bpy.types.Panel):
"""Panel to demo popup notice and ignoring functionality"""
bl_label = "Updater Demo Panel"
bl_idname = "OBJECT_PT_hello"
bl_idname = "OBJECT_PT_DemoUpdaterPanel_hello"
bl_space_type = 'VIEW_3D'
bl_region_type = 'TOOLS' if bpy.app.version < (2, 80) else 'UI'
bl_context = "objectmode"
Expand All @@ -56,7 +56,6 @@ def draw(self, context):
# and if the time interval has passed
addon_updater_ops.check_for_update_background()


layout.label(text="Demo Updater Addon")
layout.label(text="")

Expand All @@ -68,7 +67,7 @@ def draw(self, context):

# could also use your own custom drawing
# based on shared variables
if addon_updater_ops.updater.update_ready == True:
if addon_updater_ops.updater.update_ready:
layout.label(text="Custom update message", icon="INFO")
layout.label(text="")

Expand All @@ -88,27 +87,31 @@ class DemoPreferences(bpy.types.AddonPreferences):
description="If enabled, auto-check for updates using an interval",
default=False,
)
updater_intrval_months = bpy.props.IntProperty(

updater_interval_months = bpy.props.IntProperty(
name='Months',
description="Number of months between checking for updates",
default=0,
min=0
)
updater_intrval_days = bpy.props.IntProperty(

updater_interval_days = bpy.props.IntProperty(
name='Days',
description="Number of days between checking for updates",
default=7,
min=0,
max=31
)
updater_intrval_hours = bpy.props.IntProperty(

updater_interval_hours = bpy.props.IntProperty(
name='Hours',
description="Number of hours between checking for updates",
default=0,
min=0,
max=23
)
updater_intrval_minutes = bpy.props.IntProperty(

updater_interval_minutes = bpy.props.IntProperty(
name='Minutes',
description="Number of minutes between checking for updates",
default=0,
Expand Down Expand Up @@ -141,7 +144,7 @@ def draw(self, context):

classes = (
DemoPreferences,
OBJECT_PT_DemoUpdaterPanel
DemoUpdaterPanel
)


Expand All @@ -153,7 +156,7 @@ def register():

# register the example panel, to show updater buttons
for cls in classes:
addon_updater_ops.make_annotations(cls) # to avoid blender 2.8 warnings
addon_updater_ops.make_annotations(cls) # to avoid blender 2.8 warnings
bpy.utils.register_class(cls)


Expand Down
Loading

0 comments on commit 847a1bb

Please sign in to comment.