maya-umbrella 0.15.0__py2.py3-none-any.whl → 0.16.0__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of maya-umbrella might be problematic. Click here for more details.

@@ -1 +1 @@
1
- __version__ = "0.15.0"
1
+ __version__ = "0.16.0"
@@ -123,14 +123,58 @@ def load_hook(hook_file):
123
123
  return module
124
124
 
125
125
 
126
+ def is_hooks_disabled():
127
+ """Check if all hooks are disabled via environment variable.
128
+
129
+ Returns:
130
+ bool: True if hooks are disabled, False otherwise.
131
+ """
132
+ return os.getenv("MAYA_UMBRELLA_DISABLE_ALL_HOOKS", "false").lower() == "true"
133
+
134
+
135
+ def get_disabled_hooks():
136
+ """Get the list of disabled hook names from environment variable.
137
+
138
+ The environment variable MAYA_UMBRELLA_DISABLE_HOOKS should be a comma-separated
139
+ list of hook names (without .py extension).
140
+
141
+ Example:
142
+ SET MAYA_UMBRELLA_DISABLE_HOOKS=delete_turtle,delete_unknown_plugin_node
143
+
144
+ Returns:
145
+ list: A list of disabled hook names.
146
+ """
147
+ disabled = os.getenv("MAYA_UMBRELLA_DISABLE_HOOKS", "")
148
+ if not disabled:
149
+ return []
150
+ return [name.strip() for name in disabled.split(",") if name.strip()]
151
+
152
+
126
153
  def get_hooks():
127
154
  """Return a list of paths to all hook files in the 'hooks' directory.
128
155
 
156
+ This function respects the following environment variables:
157
+ - MAYA_UMBRELLA_DISABLE_ALL_HOOKS: Set to "true" to disable all hooks.
158
+ - MAYA_UMBRELLA_DISABLE_HOOKS: Comma-separated list of hook names to disable.
159
+
129
160
  Returns:
130
161
  list: A list of paths to all hook files in the 'hooks' directory.
131
162
  """
163
+ if is_hooks_disabled():
164
+ return []
165
+
132
166
  pattern = os.path.join(this_root(), "hooks", "*.py")
133
- return [hook for hook in glob.glob(pattern) if "__init__" not in hook]
167
+ disabled_hooks = get_disabled_hooks()
168
+
169
+ hooks = []
170
+ for hook in glob.glob(pattern):
171
+ if "__init__" in hook:
172
+ continue
173
+ hook_name = os.path.basename(hook).replace(".py", "")
174
+ if hook_name in disabled_hooks:
175
+ continue
176
+ hooks.append(hook)
177
+ return hooks
134
178
 
135
179
 
136
180
  def get_vaccines():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maya_umbrella
3
- Version: 0.15.0
3
+ Version: 0.16.0
4
4
  Summary: A better Autodesk Maya antivirus tool detects and removes malicious.
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -36,6 +36,7 @@ Description-Content-Type: text/markdown
36
36
  [![Downloads](https://static.pepy.tech/badge/maya-umbrella)](https://pepy.tech/project/maya-umbrella)
37
37
  [![Downloads](https://static.pepy.tech/badge/maya-umbrella/month)](https://pepy.tech/project/maya-umbrella)
38
38
  [![Downloads](https://static.pepy.tech/badge/maya-umbrella/week)](https://pepy.tech/project/maya-umbrella)
39
+ [![GitHub Release](https://img.shields.io/github/downloads/loonghao/maya_umbrella/total?label=GitHub%20Downloads)](https://github.com/loonghao/maya_umbrella/releases)
39
40
  [![License](https://img.shields.io/pypi/l/maya-umbrella)](https://pypi.org/project/maya-umbrella/)
40
41
  [![PyPI Format](https://img.shields.io/pypi/format/maya-umbrella)](https://pypi.org/project/maya-umbrella/)
41
42
  [![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/loonghao/maya-umbrella/graphs/commit-activity)
@@ -205,6 +206,34 @@ nox -s maya -- 2018 --install-root /your/local/maya/root
205
206
 
206
207
  ```
207
208
 
209
+ ## Hooks Control
210
+
211
+ Disable all hooks. When set to `true`, no hooks will be executed.
212
+ ```shell
213
+ MAYA_UMBRELLA_DISABLE_ALL_HOOKS
214
+ ```
215
+ If you want to disable all hooks:
216
+ ```shell
217
+ SET MAYA_UMBRELLA_DISABLE_ALL_HOOKS=true
218
+ ```
219
+
220
+ Disable specific hooks by name. Use a comma-separated list of hook names (without `.py` extension).
221
+
222
+ Available hooks:
223
+ - `delete_turtle` - Remove Turtle plugin and related nodes
224
+ - `delete_unknown_plugin_node` - Remove unknown plugin nodes
225
+ - `fix_model_panel` - Fix model panel issues
226
+ - `fix_no_scene_name` - Fix scenes without names
227
+ - `fix_on_model_change_3dc` - Fix 3D Coat model change callback
228
+
229
+ ```shell
230
+ MAYA_UMBRELLA_DISABLE_HOOKS
231
+ ```
232
+ For example, to disable the `delete_turtle` and `delete_unknown_plugin_node` hooks:
233
+ ```shell
234
+ SET MAYA_UMBRELLA_DISABLE_HOOKS=delete_turtle,delete_unknown_plugin_node
235
+ ```
236
+
208
237
  # API
209
238
 
210
239
  Get virus files that have not been repaired in the current scenario.
@@ -1,5 +1,5 @@
1
1
  maya_umbrella/__init__.py,sha256=rcCnFWmELeJsGoKvLHyzC_GmZu-eT1QXjQCHRGj6HuQ,529
2
- maya_umbrella/__version__.py,sha256=wGIgxINRfcIKyk0LjIbc9UF9UwuclyCQZv_axTUzwNw,23
2
+ maya_umbrella/__version__.py,sha256=3Msc5baw88UJubVj5AVFB8tExkT2OFIsNWe2leaoHhc,23
3
3
  maya_umbrella/_vendor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  maya_umbrella/_vendor/atomicwrites/LICENSE,sha256=h4Mp8L2HitAVEpzovagvSB6G7C6Agx6QnA1nFx2SLnM,1069
5
5
  maya_umbrella/_vendor/atomicwrites/__init__.py,sha256=myvxvKRBb7vebPTSUiAopsRrvsm6VojiAvET1xohT-4,6970
@@ -14,7 +14,7 @@ maya_umbrella/cleaner.py,sha256=T_-QgF7Or9Bqoa463YZm2trhwGu0-KfbyiozXj3G86o,5384
14
14
  maya_umbrella/collector.py,sha256=SiC-wpDjer7w6ofsyWTFJmUF8pPz233xDXeANNz-LrY,13119
15
15
  maya_umbrella/constants.py,sha256=SuD8OP8e0Kh3a9ohyS5_MXjo5pHNQ8MWEPtJ6puZfIU,130
16
16
  maya_umbrella/defender.py,sha256=eT4uK23uOB1V8Y3uiaU1C2Tp-s1SngrGo3TWDbSIVJY,6008
17
- maya_umbrella/filesystem.py,sha256=E1bs4WguYI9cKr6JnfyERu2fVE9Ii9qYUv-DcfVZa1k,9194
17
+ maya_umbrella/filesystem.py,sha256=8aQAw-VK8OnRPnavY1oVSQOwGxy2ozdJPiiQRsuygqo,10524
18
18
  maya_umbrella/hooks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
19
  maya_umbrella/hooks/delete_turtle.py,sha256=OPFRFH1iwonHvETndrP87MZQlJLhxpe564AJE3KyJY8,761
20
20
  maya_umbrella/hooks/delete_unknown_plugin_node.py,sha256=5YXaOem-t9Em1sr3wmBqWk5He1Lm8CsOMQsSQ3ixLfs,1293
@@ -34,7 +34,7 @@ maya_umbrella/vaccines/vaccine1.py,sha256=WLo1uJElTLSjVCf5CBtRNU4HKs63my5mkHiGqT
34
34
  maya_umbrella/vaccines/vaccine2.py,sha256=qYiI_-BSojgN7j4esYCGBDLeyBSneDOGUwZhKHccxh8,2170
35
35
  maya_umbrella/vaccines/vaccine3.py,sha256=vcjGt0jZxBDb7iCUMmBWBQGPZD3BFH96gL6pPxNwDr0,3676
36
36
  maya_umbrella/vaccines/vaccine4.py,sha256=IftMSf9CM6NJ9FmTXeRTYQ3qiYVrRSzJxMyHDdE2tQc,2272
37
- maya_umbrella-0.15.0.dist-info/METADATA,sha256=8cCvHo7XX-OV7InxxPU6sAVzEBm4yzxoULOgP4j6C4w,13134
38
- maya_umbrella-0.15.0.dist-info/WHEEL,sha256=MICUlqIgkuEnKh9OWy254Ca7q2MHOW-q0u36TZR60nU,92
39
- maya_umbrella-0.15.0.dist-info/licenses/LICENSE,sha256=tJf0Pz8q_65AjEkm3872K1cl4jGil28vJO5Ko_LhUqc,1060
40
- maya_umbrella-0.15.0.dist-info/RECORD,,
37
+ maya_umbrella-0.16.0.dist-info/METADATA,sha256=SUh-TwBxhm_2qBT31CjGKOIKhnntvG4erDd5hpu1gNg,14128
38
+ maya_umbrella-0.16.0.dist-info/WHEEL,sha256=MICUlqIgkuEnKh9OWy254Ca7q2MHOW-q0u36TZR60nU,92
39
+ maya_umbrella-0.16.0.dist-info/licenses/LICENSE,sha256=tJf0Pz8q_65AjEkm3872K1cl4jGil28vJO5Ko_LhUqc,1060
40
+ maya_umbrella-0.16.0.dist-info/RECORD,,