maya-umbrella 0.14.2__tar.gz → 0.15.0__tar.gz

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.

Files changed (41) hide show
  1. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/PKG-INFO +36 -97
  2. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/README.md +30 -94
  3. maya_umbrella-0.15.0/maya_umbrella/__version__.py +1 -0
  4. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/signatures.py +12 -0
  5. maya_umbrella-0.15.0/maya_umbrella/vaccines/vaccine4.py +55 -0
  6. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/pyproject.toml +2 -2
  7. maya_umbrella-0.14.2/maya_umbrella/__version__.py +0 -1
  8. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/LICENSE +0 -0
  9. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/__init__.py +0 -0
  10. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/_vendor/__init__.py +0 -0
  11. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/_vendor/atomicwrites/LICENSE +0 -0
  12. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/_vendor/atomicwrites/__init__.py +0 -0
  13. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/_vendor/atomicwrites.pyi +0 -0
  14. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/_vendor/six/__init__.pyi +0 -0
  15. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/_vendor/six/moves/__init__.pyi +0 -0
  16. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/_vendor/six/moves/configparser.pyi +0 -0
  17. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/_vendor/six.LICENSE +0 -0
  18. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/_vendor/six.py +0 -0
  19. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/_vendor/vendor.txt +0 -0
  20. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/cleaner.py +0 -0
  21. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/collector.py +0 -0
  22. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/constants.py +0 -0
  23. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/defender.py +0 -0
  24. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/filesystem.py +0 -0
  25. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/hooks/__init__.py +0 -0
  26. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/hooks/delete_turtle.py +0 -0
  27. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/hooks/delete_unknown_plugin_node.py +0 -0
  28. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/hooks/fix_model_panel.py +0 -0
  29. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/hooks/fix_no_scene_name.py +0 -0
  30. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/hooks/fix_on_model_change_3dc.py +0 -0
  31. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/i18n.py +0 -0
  32. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/locales/en_US.json +0 -0
  33. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/locales/zh_CN.json +0 -0
  34. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/log.py +0 -0
  35. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/maya_funs.py +0 -0
  36. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/scanner.py +0 -0
  37. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/vaccine.py +0 -0
  38. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/vaccines/__init__.py +0 -0
  39. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/vaccines/vaccine1.py +0 -0
  40. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/vaccines/vaccine2.py +0 -0
  41. {maya_umbrella-0.14.2 → maya_umbrella-0.15.0}/maya_umbrella/vaccines/vaccine3.py +0 -0
@@ -1,9 +1,9 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: maya_umbrella
3
- Version: 0.14.2
3
+ Version: 0.15.0
4
4
  Summary: A better Autodesk Maya antivirus tool detects and removes malicious.
5
- Home-page: https://github.com/loonghao/maya_umbrella
6
5
  License: MIT
6
+ License-File: LICENSE
7
7
  Keywords: Autodesk Maya,python,Maya,dcc,antivirus,Security Tools,maya_umbrella
8
8
  Author: longhao
9
9
  Author-email: hal.long@outlook.com
@@ -19,11 +19,16 @@ Classifier: Programming Language :: Python :: 3.9
19
19
  Classifier: Programming Language :: Python :: 3.10
20
20
  Classifier: Programming Language :: Python :: 3.11
21
21
  Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Programming Language :: Python :: 3.14
22
24
  Project-URL: Documentation, https://github.com/loonghao/maya_umbrella
25
+ Project-URL: Homepage, https://github.com/loonghao/maya_umbrella
23
26
  Project-URL: Repository, https://github.com/loonghao/maya_umbrella
24
27
  Description-Content-Type: text/markdown
25
28
 
26
- ![maya_umbrella.ing Banner](https://raw.githubusercontent.com/loonghao/maya_umbrella/main/resources/banner.png)
29
+ ![Maya Umbrella Banner](https://raw.githubusercontent.com/loonghao/maya_umbrella/main/resources/banner.png)
30
+
31
+ [English](https://github.com/loonghao/maya_umbrella/blob/main/README.md) | [中文](https://github.com/loonghao/maya_umbrella/blob/main/README_zh.md)
27
32
 
28
33
  [![Python Version](https://img.shields.io/pypi/pyversions/maya-umbrella)](https://img.shields.io/pypi/pyversions/maya-umbrella)
29
34
  [![Nox](https://img.shields.io/badge/%F0%9F%A6%8A-Nox-D85E00.svg)](https://github.com/wntrblm/nox)
@@ -46,7 +51,7 @@ Description-Content-Type: text/markdown
46
51
  [![All Contributors](https://img.shields.io/badge/all_contributors-9-orange.svg?style=flat-square)](#contributors-)
47
52
  <!-- ALL-CONTRIBUTORS-BADGE:END -->
48
53
 
49
- A better Autodesk Maya antivirus tool detects and removes malicious.
54
+ A better Autodesk Maya antivirus tool that detects and removes malicious code.
50
55
 
51
56
  This tool is designed to provide a robust solution for identifying and resolving any potential viruses within Autodesk
52
57
  Maya.
@@ -54,144 +59,107 @@ It ensures a secure and seamless user experience by proactively scanning for thr
54
59
 
55
60
  It can be provided as an API for seamless integration into your existing pipeline.
56
61
 
57
- # 安装
62
+ # Installation
58
63
 
59
- ## pip 安装
64
+ ## pip installation
60
65
  maya_umbrella is distributed as a standard pipy package, so we can install it via pip install.
61
-
62
- maya_umbrella是以标准pipy包去发布的,所以我们可以通过pip install去安装
63
66
  ```shell
64
67
  your/maya-root/mayapy -m pip install maya-umbrella
65
68
  ```
66
- ## 一键安装
69
+ ## One-click installation
67
70
  Download the corresponding version of the zip package in the release, unzip it and double-click `install.bat` to install it.
68
71
 
69
- 在release里面下载对应版本的zip包,解压后双击`install.bat`即可安装
70
-
71
- 更新版本
72
+ Update version
72
73
  ```shell
73
74
  your/maya-root/mayapy -m pip install maya-umbrella --upgrade
74
75
  ```
75
- 卸载
76
+ Uninstall
76
77
  ```shell
77
78
  your/maya-root/mayapy -m pip uninstall maya-umbrella
78
79
  ```
79
80
 
80
- # 开发环境设置
81
+ # Development Environment Setup
81
82
 
82
83
  Set up the development environment using a virtual environment,
83
84
  and it is recommended to use Python 3.8 or higher versions.
84
85
 
85
- 通过虚拟环境去设置开发环境, 推荐python-3.8以上的版本
86
-
87
- 通过pip安装相关开发依赖
86
+ Install development dependencies via pip
88
87
 
89
88
  ```shell
90
89
  pip install -r requirements-dev.txt
91
90
  ```
92
91
 
93
- # 开发调试
92
+ # Development Debugging
94
93
 
95
94
 
96
- ## 在maya中测试
97
- With `nox -s maya -- <maya version>`, start maya.
98
- Nox will dynamically register a nox session based on your local installation of maya,
99
- e.g. if you have `maya-2018` installed locally, then you can start maya with a test environment.
100
- Then you can start maya with a test environment via
101
-
102
- 通过`nox -s maya -- <maya version>`, 启动maya.
103
- nox会动态根据你本地安装得maya去注册nox session, 比如你本地安装了`maya-2018`,
104
- 那么通过可以启动带有测试环境的maya
95
+ ## Testing in Maya
96
+ With `nox -s maya -- <maya version>`, start Maya.
97
+ Nox will dynamically register a nox session based on your local installation of Maya,
98
+ e.g. if you have `maya-2018` installed locally, then you can start Maya with a test environment.
105
99
 
106
100
  ```shell
107
101
  nox -s maya -- 2018
108
102
  ```
109
103
  **Note: there are two `-` between maya and the version number**.
110
104
 
111
- Starting maya and executing the following code in the script editor will dynamically open the ma file from `<repo>/tests/virus/` to test it.
112
-
113
- **注意:maya 与 版本号之间有 俩个`-`**
114
-
115
- 启动maya后在脚本编辑器中执行下面得代码,就会动态的从`<repo>/tests/virus/`里面去open ma文件去进行测试.
105
+ After starting Maya, executing the following code in the script editor will dynamically open the ma file from `<repo>/tests/virus/` to test it.
116
106
 
117
107
  ```python
118
108
  import manual_test_in_maya
119
109
 
120
110
  manual_test_in_maya.start()
121
111
  ```
122
- It is also possible to execute the corresponding tests via pytest, which also requires a local installation of the corresponding maya
123
-
124
- 也可以通过pytest去执行对应的测试,也需要本地安装了对应的maya
112
+ It is also possible to execute the corresponding tests via pytest, which also requires a local installation of the corresponding Maya
125
113
 
126
114
  ```shell
127
115
  nox -s maya -- 2018 --test
128
116
  ```
129
117
  **Note: Command line crash may occur in versions below maya-2022 (PY2)**.
130
118
 
131
- **注意:在maya-2022 (PY2) 以下的版本可能会出现命令行crash的情况**
132
119
 
133
-
134
- ## 增加新的疫苗
135
- Create a new py in `<repo>/maya_umbrella/vaccines/`, since many viruses don't have a specific name, we'll use `vaccine<id>.py`.
120
+ ## Adding New Vaccines
121
+ Create a new py in `<repo>/maya_umbrella/vaccines/`. Since many viruses don't have a specific name, we'll use `vaccine<id>.py`.
136
122
  Inherit `from maya_umbrella.vaccine import AbstractVaccine` and call the class `Vaccine`, and then write the virus collection logic.
137
123
 
138
- 在`<repo>/maya_umbrella/vaccines/` 新建一个py, 因为有很多病毒没有具体的名字代号,我们统一以`vaccine<id>.py`
139
- 继承`from maya_umbrella.vaccine import AbstractVaccine`并且class名字叫`Vaccine`即可, 然后去写具体的收集病毒逻辑
140
-
141
- ## 代码检查
124
+ ## Code Check
142
125
 
143
126
  We can use the encapsulated `nox` command to perform a code check.
144
127
 
145
- 我们可以利用封装好的`nox`命令去执行进行代码检查
146
-
147
128
  ```shell
148
129
  nox -s lint
149
130
  ```
150
131
 
151
- 进行代码整理
132
+ Format code
152
133
  ```shell
153
134
  nox -s lint-fix
154
135
  ```
155
136
 
156
- # 生成安装包
137
+ # Generate Installation Package
157
138
  Execute the following command to create a zip under <repo>/.zip, with `--version` the version number of the current tool.
158
139
 
159
140
  **Note: between `make-zip` and `--version` there are two `-`**.
160
141
 
161
- 执行下面的命令可以在<repo>/.zip下面创建zip,参数 `--version` 当前工具的版本号
162
-
163
- **注意:`make-zip` 与 `--version`之间有 俩个`-`**
164
-
165
142
  ```shell
166
143
  nox -s make-zip -- --version 0.5.0
167
144
  ```
168
145
 
169
- # 环境变量
170
- We can use the following environment variables to modify some of the settings of maya_umbrella,
171
-
146
+ # Environment Variables
147
+ We can use the following environment variables to modify some of the settings of maya_umbrella,
172
148
  so that companies with pipelines can better integrate them.
173
149
 
174
150
  Modify the log saving directory of maya umbrella, the default is the windows temp directory.
175
151
 
176
- 我们可以通过下列环境变量去修改maya_umbrella的一些设置,方便有pipeline的公司可以更好的集成
177
-
178
- 修改maya umbrella的日志保存目录,默认是windows temp目录
179
-
180
152
  ```shell
181
153
  MAYA_UMBRELLA_LOG_ROOT
182
154
  ```
183
155
  Change the name of the log file for maya umbrella, default is `maya_umbrella`.
184
156
 
185
- 修改maya umbrella的日志文件名称, 默认是`maya_umbrella`
186
-
187
157
  ```shell
188
158
  MAYA_UMBRELLA_LOG_NAME
189
159
  ```
190
160
 
191
161
  Set the log level, the default is info, can be debug can see more log information.
192
162
 
193
- 设置日志级别,默认是info, 可以是debug可以看到更多的日志信息.
194
-
195
163
  ```shell
196
164
  MAYA_UMBRELLA_LOG_LEVEL
197
165
  ```
@@ -202,53 +170,36 @@ For example:
202
170
  Your file path is `c:/your/path/file.ma`.
203
171
 
204
172
  Then the backup file path is `c:/your/path/_virus/file.ma`.
205
-
206
- 修改杀毒后文件的备份文件夹名称, 默认是`_virus`
207
- 比如:
208
- 你文件路径是 `c:/your/path/file.ma`
209
- 那么备份文件路径是 `c:/your/path/_virus/file.ma`
210
173
  ```shell
211
174
  MAYA_UMBRELLA_BACKUP_FOLDER_NAME
212
175
  ```
213
176
  The default display language, including logging printouts, etc.
214
-
215
- is set by default according to your current maya interface language,
216
-
177
+ is set by default according to your current maya interface language,
217
178
  but of course we can also set it via the following environment variables.
218
-
219
- 默认的显示语言,包含日志打印输出等,默认是根据你当前maya的界面语言来设置的,当然我们也可以通过下面的环境变量去设置.
220
179
  ```shell
221
180
  MAYA_UMBRELLA_LANG
222
181
  ```
223
182
  Ignore saving to the backup folder,
224
- *please note that if you are not clear about the consequences of this please do not modify it easily*,
225
- the default batch antivirus will automatically back up the source file to the current file's backup folder
183
+ *please note that if you are not clear about the consequences of this please do not modify it easily*,
184
+ the default batch antivirus will automatically back up the source file to the current file's backup folder
226
185
  after the batch antivirus.
227
186
 
228
- 忽略保存到备份文件夹,*请注意,如果你不清楚这个会导致的后果请不要轻易修改*,默认批量杀毒后会把源文件自动备份到当前文件的备份文件夹.
229
-
230
187
  ```shell
231
188
  MAYA_UMBRELLA_IGNORE_BACKUP
232
189
  ```
233
190
  If ignored please set to
234
-
235
- 如果忽略请设置为
236
191
  ```shell
237
192
  SET MAYA_UMBRELLA_IGNORE_BACKUP=true
238
193
  ```
239
194
 
240
- For the portable version of Maya,
195
+ For the portable version of Maya,
241
196
  you can specify the Maya path by adding the `MAYA_LOCATION` environment variable.
242
197
 
243
- 如果是便携版Maya,可以通过添加 `MAYA_LOCATION` 环境变量指定Maya路径
244
-
245
198
  ```shell
246
199
  SET MAYA_LOCATION=d:/your/path/maya_version/
247
200
  ```
248
201
  You can also specify a directory from the command line.
249
202
 
250
- 也可以通过命令行指定目录
251
-
252
203
  ```shell
253
204
  nox -s maya -- 2018 --install-root /your/local/maya/root
254
205
 
@@ -258,8 +209,6 @@ nox -s maya -- 2018 --install-root /your/local/maya/root
258
209
 
259
210
  Get virus files that have not been repaired in the current scenario.
260
211
 
261
- 获取当前场景没有被修复的病毒文件
262
-
263
212
  ```python
264
213
  from maya_umbrella import MayaVirusDefender
265
214
 
@@ -268,8 +217,6 @@ print(api.get_unfixed_references())
268
217
  ```
269
218
 
270
219
  Batch repair of files, via regular expressions.
271
-
272
- 批量修复文件, 通过正则表达式
273
220
  ```python
274
221
  from maya_umbrella import MayaVirusScanner
275
222
 
@@ -278,7 +225,7 @@ print(api.scan_files_from_pattern("your/path/*.m[ab]"))
278
225
 
279
226
  ```
280
227
 
281
- # 案例
228
+ # Examples
282
229
 
283
230
  If you want to quickly go through maya standalone and batch clean up maya files.
284
231
 
@@ -291,14 +238,6 @@ For example, if you have `2018` installed locally, Then `nox -s maya -- 2018 --s
291
238
 
292
239
  The following syntax starts a maya-2020 environment to dynamically check for viruses from the `c:/test` folder.
293
240
 
294
- 如果你想要快速通过maya standalone去批量清理maya文件,
295
- 可以`下载`或者`git clone`当前`main`分支的工程,
296
- 根据上面指引设置好开发环境,
297
- 通过`nox`命令去启动maya `standalone`环境,maya版本根据你当前本地安装的maya为准,
298
- 比如你本地安装了`2018`,
299
- 那么就是 `nox -s maya -- 2018 --standalone`
300
- 下面的语法是启动一个maya-2020的环境去动态从`c:/test`文件夹下去查杀病毒
301
-
302
241
  ```shell
303
242
  nox -s maya -- 2018 --standalone --pattern c:/test/*.m[ab]
304
243
  ```
@@ -1,4 +1,6 @@
1
- ![maya_umbrella.ing Banner](https://raw.githubusercontent.com/loonghao/maya_umbrella/main/resources/banner.png)
1
+ ![Maya Umbrella Banner](https://raw.githubusercontent.com/loonghao/maya_umbrella/main/resources/banner.png)
2
+
3
+ [English](https://github.com/loonghao/maya_umbrella/blob/main/README.md) | [中文](https://github.com/loonghao/maya_umbrella/blob/main/README_zh.md)
2
4
 
3
5
  [![Python Version](https://img.shields.io/pypi/pyversions/maya-umbrella)](https://img.shields.io/pypi/pyversions/maya-umbrella)
4
6
  [![Nox](https://img.shields.io/badge/%F0%9F%A6%8A-Nox-D85E00.svg)](https://github.com/wntrblm/nox)
@@ -21,7 +23,7 @@
21
23
  [![All Contributors](https://img.shields.io/badge/all_contributors-9-orange.svg?style=flat-square)](#contributors-)
22
24
  <!-- ALL-CONTRIBUTORS-BADGE:END -->
23
25
 
24
- A better Autodesk Maya antivirus tool detects and removes malicious.
26
+ A better Autodesk Maya antivirus tool that detects and removes malicious code.
25
27
 
26
28
  This tool is designed to provide a robust solution for identifying and resolving any potential viruses within Autodesk
27
29
  Maya.
@@ -29,144 +31,107 @@ It ensures a secure and seamless user experience by proactively scanning for thr
29
31
 
30
32
  It can be provided as an API for seamless integration into your existing pipeline.
31
33
 
32
- # 安装
34
+ # Installation
33
35
 
34
- ## pip 安装
36
+ ## pip installation
35
37
  maya_umbrella is distributed as a standard pipy package, so we can install it via pip install.
36
-
37
- maya_umbrella是以标准pipy包去发布的,所以我们可以通过pip install去安装
38
38
  ```shell
39
39
  your/maya-root/mayapy -m pip install maya-umbrella
40
40
  ```
41
- ## 一键安装
41
+ ## One-click installation
42
42
  Download the corresponding version of the zip package in the release, unzip it and double-click `install.bat` to install it.
43
43
 
44
- 在release里面下载对应版本的zip包,解压后双击`install.bat`即可安装
45
-
46
- 更新版本
44
+ Update version
47
45
  ```shell
48
46
  your/maya-root/mayapy -m pip install maya-umbrella --upgrade
49
47
  ```
50
- 卸载
48
+ Uninstall
51
49
  ```shell
52
50
  your/maya-root/mayapy -m pip uninstall maya-umbrella
53
51
  ```
54
52
 
55
- # 开发环境设置
53
+ # Development Environment Setup
56
54
 
57
55
  Set up the development environment using a virtual environment,
58
56
  and it is recommended to use Python 3.8 or higher versions.
59
57
 
60
- 通过虚拟环境去设置开发环境, 推荐python-3.8以上的版本
61
-
62
- 通过pip安装相关开发依赖
58
+ Install development dependencies via pip
63
59
 
64
60
  ```shell
65
61
  pip install -r requirements-dev.txt
66
62
  ```
67
63
 
68
- # 开发调试
64
+ # Development Debugging
69
65
 
70
66
 
71
- ## 在maya中测试
72
- With `nox -s maya -- <maya version>`, start maya.
73
- Nox will dynamically register a nox session based on your local installation of maya,
74
- e.g. if you have `maya-2018` installed locally, then you can start maya with a test environment.
75
- Then you can start maya with a test environment via
76
-
77
- 通过`nox -s maya -- <maya version>`, 启动maya.
78
- nox会动态根据你本地安装得maya去注册nox session, 比如你本地安装了`maya-2018`,
79
- 那么通过可以启动带有测试环境的maya
67
+ ## Testing in Maya
68
+ With `nox -s maya -- <maya version>`, start Maya.
69
+ Nox will dynamically register a nox session based on your local installation of Maya,
70
+ e.g. if you have `maya-2018` installed locally, then you can start Maya with a test environment.
80
71
 
81
72
  ```shell
82
73
  nox -s maya -- 2018
83
74
  ```
84
75
  **Note: there are two `-` between maya and the version number**.
85
76
 
86
- Starting maya and executing the following code in the script editor will dynamically open the ma file from `<repo>/tests/virus/` to test it.
87
-
88
- **注意:maya 与 版本号之间有 俩个`-`**
89
-
90
- 启动maya后在脚本编辑器中执行下面得代码,就会动态的从`<repo>/tests/virus/`里面去open ma文件去进行测试.
77
+ After starting Maya, executing the following code in the script editor will dynamically open the ma file from `<repo>/tests/virus/` to test it.
91
78
 
92
79
  ```python
93
80
  import manual_test_in_maya
94
81
 
95
82
  manual_test_in_maya.start()
96
83
  ```
97
- It is also possible to execute the corresponding tests via pytest, which also requires a local installation of the corresponding maya
98
-
99
- 也可以通过pytest去执行对应的测试,也需要本地安装了对应的maya
84
+ It is also possible to execute the corresponding tests via pytest, which also requires a local installation of the corresponding Maya
100
85
 
101
86
  ```shell
102
87
  nox -s maya -- 2018 --test
103
88
  ```
104
89
  **Note: Command line crash may occur in versions below maya-2022 (PY2)**.
105
90
 
106
- **注意:在maya-2022 (PY2) 以下的版本可能会出现命令行crash的情况**
107
91
 
108
-
109
- ## 增加新的疫苗
110
- Create a new py in `<repo>/maya_umbrella/vaccines/`, since many viruses don't have a specific name, we'll use `vaccine<id>.py`.
92
+ ## Adding New Vaccines
93
+ Create a new py in `<repo>/maya_umbrella/vaccines/`. Since many viruses don't have a specific name, we'll use `vaccine<id>.py`.
111
94
  Inherit `from maya_umbrella.vaccine import AbstractVaccine` and call the class `Vaccine`, and then write the virus collection logic.
112
95
 
113
- 在`<repo>/maya_umbrella/vaccines/` 新建一个py, 因为有很多病毒没有具体的名字代号,我们统一以`vaccine<id>.py`
114
- 继承`from maya_umbrella.vaccine import AbstractVaccine`并且class名字叫`Vaccine`即可, 然后去写具体的收集病毒逻辑
115
-
116
- ## 代码检查
96
+ ## Code Check
117
97
 
118
98
  We can use the encapsulated `nox` command to perform a code check.
119
99
 
120
- 我们可以利用封装好的`nox`命令去执行进行代码检查
121
-
122
100
  ```shell
123
101
  nox -s lint
124
102
  ```
125
103
 
126
- 进行代码整理
104
+ Format code
127
105
  ```shell
128
106
  nox -s lint-fix
129
107
  ```
130
108
 
131
- # 生成安装包
109
+ # Generate Installation Package
132
110
  Execute the following command to create a zip under <repo>/.zip, with `--version` the version number of the current tool.
133
111
 
134
112
  **Note: between `make-zip` and `--version` there are two `-`**.
135
113
 
136
- 执行下面的命令可以在<repo>/.zip下面创建zip,参数 `--version` 当前工具的版本号
137
-
138
- **注意:`make-zip` 与 `--version`之间有 俩个`-`**
139
-
140
114
  ```shell
141
115
  nox -s make-zip -- --version 0.5.0
142
116
  ```
143
117
 
144
- # 环境变量
145
- We can use the following environment variables to modify some of the settings of maya_umbrella,
146
-
118
+ # Environment Variables
119
+ We can use the following environment variables to modify some of the settings of maya_umbrella,
147
120
  so that companies with pipelines can better integrate them.
148
121
 
149
122
  Modify the log saving directory of maya umbrella, the default is the windows temp directory.
150
123
 
151
- 我们可以通过下列环境变量去修改maya_umbrella的一些设置,方便有pipeline的公司可以更好的集成
152
-
153
- 修改maya umbrella的日志保存目录,默认是windows temp目录
154
-
155
124
  ```shell
156
125
  MAYA_UMBRELLA_LOG_ROOT
157
126
  ```
158
127
  Change the name of the log file for maya umbrella, default is `maya_umbrella`.
159
128
 
160
- 修改maya umbrella的日志文件名称, 默认是`maya_umbrella`
161
-
162
129
  ```shell
163
130
  MAYA_UMBRELLA_LOG_NAME
164
131
  ```
165
132
 
166
133
  Set the log level, the default is info, can be debug can see more log information.
167
134
 
168
- 设置日志级别,默认是info, 可以是debug可以看到更多的日志信息.
169
-
170
135
  ```shell
171
136
  MAYA_UMBRELLA_LOG_LEVEL
172
137
  ```
@@ -177,53 +142,36 @@ For example:
177
142
  Your file path is `c:/your/path/file.ma`.
178
143
 
179
144
  Then the backup file path is `c:/your/path/_virus/file.ma`.
180
-
181
- 修改杀毒后文件的备份文件夹名称, 默认是`_virus`
182
- 比如:
183
- 你文件路径是 `c:/your/path/file.ma`
184
- 那么备份文件路径是 `c:/your/path/_virus/file.ma`
185
145
  ```shell
186
146
  MAYA_UMBRELLA_BACKUP_FOLDER_NAME
187
147
  ```
188
148
  The default display language, including logging printouts, etc.
189
-
190
- is set by default according to your current maya interface language,
191
-
149
+ is set by default according to your current maya interface language,
192
150
  but of course we can also set it via the following environment variables.
193
-
194
- 默认的显示语言,包含日志打印输出等,默认是根据你当前maya的界面语言来设置的,当然我们也可以通过下面的环境变量去设置.
195
151
  ```shell
196
152
  MAYA_UMBRELLA_LANG
197
153
  ```
198
154
  Ignore saving to the backup folder,
199
- *please note that if you are not clear about the consequences of this please do not modify it easily*,
200
- the default batch antivirus will automatically back up the source file to the current file's backup folder
155
+ *please note that if you are not clear about the consequences of this please do not modify it easily*,
156
+ the default batch antivirus will automatically back up the source file to the current file's backup folder
201
157
  after the batch antivirus.
202
158
 
203
- 忽略保存到备份文件夹,*请注意,如果你不清楚这个会导致的后果请不要轻易修改*,默认批量杀毒后会把源文件自动备份到当前文件的备份文件夹.
204
-
205
159
  ```shell
206
160
  MAYA_UMBRELLA_IGNORE_BACKUP
207
161
  ```
208
162
  If ignored please set to
209
-
210
- 如果忽略请设置为
211
163
  ```shell
212
164
  SET MAYA_UMBRELLA_IGNORE_BACKUP=true
213
165
  ```
214
166
 
215
- For the portable version of Maya,
167
+ For the portable version of Maya,
216
168
  you can specify the Maya path by adding the `MAYA_LOCATION` environment variable.
217
169
 
218
- 如果是便携版Maya,可以通过添加 `MAYA_LOCATION` 环境变量指定Maya路径
219
-
220
170
  ```shell
221
171
  SET MAYA_LOCATION=d:/your/path/maya_version/
222
172
  ```
223
173
  You can also specify a directory from the command line.
224
174
 
225
- 也可以通过命令行指定目录
226
-
227
175
  ```shell
228
176
  nox -s maya -- 2018 --install-root /your/local/maya/root
229
177
 
@@ -233,8 +181,6 @@ nox -s maya -- 2018 --install-root /your/local/maya/root
233
181
 
234
182
  Get virus files that have not been repaired in the current scenario.
235
183
 
236
- 获取当前场景没有被修复的病毒文件
237
-
238
184
  ```python
239
185
  from maya_umbrella import MayaVirusDefender
240
186
 
@@ -243,8 +189,6 @@ print(api.get_unfixed_references())
243
189
  ```
244
190
 
245
191
  Batch repair of files, via regular expressions.
246
-
247
- 批量修复文件, 通过正则表达式
248
192
  ```python
249
193
  from maya_umbrella import MayaVirusScanner
250
194
 
@@ -253,7 +197,7 @@ print(api.scan_files_from_pattern("your/path/*.m[ab]"))
253
197
 
254
198
  ```
255
199
 
256
- # 案例
200
+ # Examples
257
201
 
258
202
  If you want to quickly go through maya standalone and batch clean up maya files.
259
203
 
@@ -266,14 +210,6 @@ For example, if you have `2018` installed locally, Then `nox -s maya -- 2018 --s
266
210
 
267
211
  The following syntax starts a maya-2020 environment to dynamically check for viruses from the `c:/test` folder.
268
212
 
269
- 如果你想要快速通过maya standalone去批量清理maya文件,
270
- 可以`下载`或者`git clone`当前`main`分支的工程,
271
- 根据上面指引设置好开发环境,
272
- 通过`nox`命令去启动maya `standalone`环境,maya版本根据你当前本地安装的maya为准,
273
- 比如你本地安装了`2018`,
274
- 那么就是 `nox -s maya -- 2018 --standalone`
275
- 下面的语法是启动一个maya-2020的环境去动态从`c:/test`文件夹下去查杀病毒
276
-
277
213
  ```shell
278
214
  nox -s maya -- 2018 --standalone --pattern c:/test/*.m[ab]
279
215
  ```
@@ -0,0 +1 @@
1
+ __version__ = "0.15.0"
@@ -9,16 +9,28 @@ virus20240430_sig1 = VirusSignature("virus20240430", "python(.*);.+exec.+(pyCode
9
9
  # https://regex101.com/r/2D14UA/1
10
10
  virus20240430_sig2 = VirusSignature("virus20240430", r"^\['.+']")
11
11
 
12
+ # maya_secure_system virus signatures
13
+ maya_secure_system_sig1 = VirusSignature("maya_secure_system", "import maya_secure_system")
14
+ maya_secure_system_sig2 = VirusSignature("maya_secure_system", r"maya_secure_system\.MayaSecureSystem\(\)\.startup\(\)")
15
+
12
16
  JOB_SCRIPTS_VIRUS_SIGNATURES = [
13
17
  "petri_dish_path.+cmds.internalVar.+",
14
18
  "userSetup",
15
19
  "fuckVirus",
16
20
  virus20240430_sig1.signature,
17
21
  virus20240430_sig2.signature,
22
+ maya_secure_system_sig1.signature,
23
+ maya_secure_system_sig2.signature,
18
24
  ]
19
25
 
20
26
  FILE_VIRUS_SIGNATURES = [
21
27
  "import vaccine",
22
28
  "cmds.evalDeferred.*leukocyte.+",
23
29
  virus20240430_sig1.signature,
30
+ maya_secure_system_sig1.signature,
31
+ ]
32
+
33
+ MAYA_SECURE_SYSTEM_VIRUS_SIGNATURES = [
34
+ maya_secure_system_sig1.signature,
35
+ maya_secure_system_sig2.signature,
24
36
  ]
@@ -0,0 +1,55 @@
1
+ # Import built-in modules
2
+ import os
3
+
4
+ # Import local modules
5
+ from maya_umbrella.filesystem import check_virus_by_signature
6
+ from maya_umbrella.filesystem import check_virus_file_by_signature
7
+ from maya_umbrella.maya_funs import check_reference_node_exists
8
+ from maya_umbrella.maya_funs import cmds
9
+ from maya_umbrella.maya_funs import get_attr_value
10
+ from maya_umbrella.signatures import MAYA_SECURE_SYSTEM_VIRUS_SIGNATURES
11
+ from maya_umbrella.vaccine import AbstractVaccine
12
+
13
+
14
+ class Vaccine(AbstractVaccine):
15
+ """A class for handling the maya_secure_system virus."""
16
+
17
+ virus_name = "maya_secure_system"
18
+
19
+ def collect_infected_nodes(self):
20
+ """Collect all bad nodes related to the virus."""
21
+ for script_node in cmds.ls(type="script"):
22
+ if check_reference_node_exists(script_node):
23
+ continue
24
+ for attr_name in ("before", "after"):
25
+ script_string = get_attr_value(script_node, attr_name)
26
+ if not script_string:
27
+ continue
28
+ if check_virus_by_signature(script_string, MAYA_SECURE_SYSTEM_VIRUS_SIGNATURES):
29
+ self.report_issue(script_node)
30
+ self.api.add_infected_node(script_node)
31
+
32
+ def collect_issues(self):
33
+ """Collect all issues related to the virus."""
34
+ # Add malicious files that need to be deleted
35
+ self.api.add_malicious_files(
36
+ [
37
+ os.path.join(self.api.local_script_path, "maya_secure_system.py"),
38
+ os.path.join(self.api.local_script_path, "maya_secure_system.pyc"),
39
+ ],
40
+ )
41
+ self.collect_infected_user_setup_py()
42
+ self.collect_infected_nodes()
43
+
44
+ def collect_infected_user_setup_py(self):
45
+ """Collect all bad userSetup.py files related to the virus."""
46
+ user_setup_py_files = [
47
+ os.path.join(self.api.local_script_path, "userSetup.py"),
48
+ os.path.join(self.api.user_script_path, "userSetup.py"),
49
+ ]
50
+
51
+ for user_setup_py in user_setup_py_files:
52
+ if os.path.exists(user_setup_py):
53
+ if check_virus_file_by_signature(user_setup_py):
54
+ self.report_issue(user_setup_py)
55
+ self.api.add_infected_file(user_setup_py)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "maya_umbrella"
3
- version = "0.14.2"
3
+ version = "0.15.0"
4
4
  description = "A better Autodesk Maya antivirus tool detects and removes malicious."
5
5
  homepage = "https://github.com/loonghao/maya_umbrella"
6
6
  repository = "https://github.com/loonghao/maya_umbrella"
@@ -36,7 +36,7 @@ nox = { version = "^2024.3.2", python = ">=3.8.1,<3.11" }
36
36
 
37
37
  [tool.commitizen]
38
38
  name = "cz_conventional_commits"
39
- version = "0.14.2"
39
+ version = "0.15.0"
40
40
  tag_format = "v$version"
41
41
  version_files = [
42
42
  "pyproject.toml:version",
@@ -1 +0,0 @@
1
- __version__ = "0.14.2"
File without changes