Skip to content

Commit

Permalink
Interim Submit
Browse files Browse the repository at this point in the history
  • Loading branch information
oRazeD committed Dec 18, 2023
1 parent d1b957e commit c4ffe90
Show file tree
Hide file tree
Showing 25 changed files with 2,779 additions and 2,135 deletions.
25 changes: 25 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

# Python
[*.py]
indent_style = space
indent_size = 4
max_line_length = 100

# YAML
[*.yaml]
indent_style = space
indent_size = 2

# JSON
[*.json]
indent_style = space
indent_size = 4
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ LICENSE

README.md

Temp/
_temp/

grabdocgit_updater/
29 changes: 29 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[MASTER]

ignore=__pycache__, .vscode, _source
disable=
no-member,
too-many-arguments,
too-few-public-methods,
logging-format-interpolation,
missing-module-docstring,
missing-function-docstring,
missing-class-docstring,
no-name-in-module,
c-extension-no-member,
fixme,
invalid-name,
consider-using-with,
wrong-import-position,
consider-using-f-string,
wrong-import-order,
ungrouped-imports,
unnecessary-lambda,
unused-wildcard-import,
attribute-defined-outside-init,
assignment-from-no-return


[FORMAT]

max-line-length=88
21 changes: 21 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"python.analysis.typeCheckingMode": "off",
"python.analysis.autoImportCompletions": true,
"cSpell.words": [
"backface",
"BLACKMAN",
"BSDF",
"colorspace",
"depsgraph",
"eevee",
"frustrum",
"gtao",
"matcap",
"mathutils",
"Metalness",
"overscan",
"ssao",
"Toolbag",
"viewlayer"
]
}
16 changes: 8 additions & 8 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
bl_info = {
"name": "GrabDoc Pro",
"author": "Ethan Simon-Law",
"location": "3D View > Sidebar > GrabDoc Tab",
"location": "3D View > Sidebar > GrabDoc",
"version": (1, 4, 0),
"blender": (3, 5, 0),
"blender": (4, 0, 1),
"tracker_url": "https://discord.com/invite/wHAyVZG",
"category": "3D View"
}
Expand All @@ -13,11 +13,11 @@


module_names = (
"ui",
"operators",
"mat_id_ops",
"marmoset_ops",
"preferences"
"operators.operators",
"operators.material",
"operators.marmoset",
"preferences",
"ui"
)

modules = []
Expand All @@ -26,7 +26,7 @@
if module_name in locals():
modules.append(importlib.reload(locals()[module_name]))
else:
modules.append(importlib.import_module("." + module_name, __package__))
modules.append(importlib.import_module(f".{module_name}", __package__))

def register():
for mod in modules:
Expand Down
50 changes: 25 additions & 25 deletions addon_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def backup_current(self):
return self._backup_current
@backup_current.setter
def backup_current(self, value):
if value == None:
if value is None:
self._backup_current = False
return
else:
Expand All @@ -187,7 +187,7 @@ def backup_ignore_patterns(self):
return self._backup_ignore_patterns
@backup_ignore_patterns.setter
def backup_ignore_patterns(self, value):
if value == None:
if value is None:
self._backup_ignore_patterns = None
return
elif type(value) != type(['list']):
Expand Down Expand Up @@ -271,7 +271,7 @@ def include_branch_list(self):
@include_branch_list.setter
def include_branch_list(self, value):
try:
if value == None:
if value is None:
self._include_branch_list = ['master']
elif type(value) != type(['master']) or value==[]:
raise ValueError("include_branch_list should be a list of valid branches")
Expand All @@ -298,7 +298,7 @@ def json(self):

@property
def latest_release(self):
if self._latest_release == None:
if self._latest_release is None:
return None
return self._latest_release

Expand All @@ -317,7 +317,7 @@ def overwrite_patterns(self):
return self._overwrite_patterns
@overwrite_patterns.setter
def overwrite_patterns(self, value):
if value == None:
if value is None:
self._overwrite_patterns = ["*.py","*.pyc"]
elif type(value) != type(['']):
raise ValueError("overwrite_patterns needs to be in a list format")
Expand All @@ -339,7 +339,7 @@ def remove_pre_update_patterns(self):
return self._remove_pre_update_patterns
@remove_pre_update_patterns.setter
def remove_pre_update_patterns(self, value):
if value == None:
if value is None:
self._remove_pre_update_patterns = []
elif type(value) != type(['']):
raise ValueError("remove_pre_update_patterns needs to be in a list format")
Expand Down Expand Up @@ -372,7 +372,7 @@ def stage_path(self):
return self._updater_path
@stage_path.setter
def stage_path(self, value):
if value == None:
if value is None:
if self._verbose: print("Aborting assigning stage_path, it's null")
return
elif value != None and not os.path.exists(value):
Expand Down Expand Up @@ -401,7 +401,7 @@ def tags(self):

@property
def tag_latest(self):
if self._tag_latest == None:
if self._tag_latest is None:
return None
return self._tag_latest["name"]

Expand Down Expand Up @@ -454,7 +454,7 @@ def version_max_update(self):
return self._version_max_update
@version_max_update.setter
def version_max_update(self, value):
if value == None:
if value is None:
self._version_max_update = None
return
if type(value) != type((1,2,3)):
Expand All @@ -469,7 +469,7 @@ def version_min_update(self):
return self._version_min_update
@version_min_update.setter
def version_min_update(self, value):
if value == None:
if value is None:
self._version_min_update = None
return
if type(value) != type((1,2,3)):
Expand Down Expand Up @@ -588,14 +588,14 @@ def get_tags(self):
}
self._tags = [include] + self._tags # append to front

if self._tags == None:
if self._tags is None:
# some error occurred
self._tag_latest = None
self._tags = []
return
elif self._prefiltered_tag_count == 0 and self._include_branches == False:
self._tag_latest = None
if self._error == None: # if not None, could have had no internet
if self._error is None: # if not None, could have had no internet
self._error = "No releases found"
self._error_msg = "No releases or tags found on this repository"
if self._verbose: print("No releases or tags found on this repository")
Expand Down Expand Up @@ -905,7 +905,7 @@ def unpack_staged_zip(self,clean=False):
if os.path.isfile(os.path.join(unpath,"__init__.py")) == False:
dirlist = os.listdir(unpath)
if len(dirlist)>0:
if self._subfolder_path == "" or self._subfolder_path == None:
if self._subfolder_path == "" or self._subfolder_path is None:
unpath = os.path.join(unpath, dirlist[0])
else:
unpath = os.path.join(unpath, self._subfolder_path)
Expand Down Expand Up @@ -1083,7 +1083,7 @@ def urlretrieve(self, urlfile, filepath):


def version_tuple_from_text(self,text):
if text == None: return ()
if text is None: return ()

# should go through string and remove all non-integers,
# and for any given break split into a different section
Expand Down Expand Up @@ -1125,7 +1125,7 @@ def check_for_update_async(self, callback=None):
elif self._async_checking == True:
if self._verbose: print("Skipping async check, already started")
return # already running the bg thread
elif self._update_ready == None:
elif self._update_ready is None:
self.start_async_check_update(False, callback)


Expand All @@ -1139,7 +1139,7 @@ def check_for_update_now(self, callback=None):
if self._async_checking == True:
if self._verbose: print("Skipping async check, already started")
return # already running the bg thread
elif self._update_ready == None:
elif self._update_ready is None:
self.start_async_check_update(True, callback)
else:
self._update_ready = None
Expand All @@ -1160,11 +1160,11 @@ def check_for_update(self, now=False):
if self._update_ready != None and now == False:
return (self._update_ready,self._update_version,self._update_link)

if self._current_version == None:
if self._current_version is None:
raise ValueError("current_version not yet defined")
if self._repo == None:
if self._repo is None:
raise ValueError("repo not yet defined")
if self._user == None:
if self._user is None:
raise ValueError("username not yet defined")

self.set_updater_json() # self._json
Expand Down Expand Up @@ -1325,7 +1325,7 @@ def run_update(self,force=False,revert_tag=None,clean=False,callback=None):
self._addon_package,
"Update stopped, new version not ready")
return "Update stopped, new version not ready"
elif self._update_link == None:
elif self._update_link is None:
# this shouldn't happen if update is ready
if self._verbose:
print("Update stopped, update link unavailable")
Expand Down Expand Up @@ -1353,7 +1353,7 @@ def run_update(self,force=False,revert_tag=None,clean=False,callback=None):
return res

else:
if self._update_link == None:
if self._update_link is None:
if self._verbose:
print("Update stopped, could not get link")
return "Update stopped, could not get link"
Expand Down Expand Up @@ -1427,7 +1427,7 @@ def get_json_path(self):

def set_updater_json(self):
"""Load or initialize JSON dictionary data for updater state"""
if self._updater_path == None:
if self._updater_path is None:
raise ValueError("updater_path is not defined")
elif os.path.isdir(self._updater_path) == False:
os.makedirs(self._updater_path)
Expand Down Expand Up @@ -1586,7 +1586,7 @@ def get_zip_url(self, name, updater):
name=name)

def parse_tags(self, response, updater):
if response == None:
if response is None:
return []
return [{"name": tag["name"], "zipball_url": self.get_zip_url(tag["name"], updater)} for tag in response["values"]]

Expand Down Expand Up @@ -1617,7 +1617,7 @@ def form_branch_url(self, branch, updater):
"/zipball/",branch)

def parse_tags(self, response, updater):
if response == None:
if response is None:
return []
return response

Expand Down Expand Up @@ -1660,7 +1660,7 @@ def get_zip_url(self, sha, updater):
# return self.form_repo_url(updater)+"/repository/archive.zip?sha:"+id

def parse_tags(self, response, updater):
if response == None:
if response is None:
return []
return [{"name": tag["name"], "zipball_url": self.get_zip_url(tag["commit"]["id"], updater)} for tag in response]

Expand Down
Loading

0 comments on commit c4ffe90

Please sign in to comment.