maya-umbrella 0.14.1__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.1 → maya_umbrella-0.15.0}/PKG-INFO +71 -80
  2. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/README.md +65 -77
  3. maya_umbrella-0.15.0/maya_umbrella/__version__.py +1 -0
  4. {maya_umbrella-0.14.1 → 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.1 → maya_umbrella-0.15.0}/pyproject.toml +2 -2
  7. maya_umbrella-0.14.1/maya_umbrella/__version__.py +0 -1
  8. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/LICENSE +0 -0
  9. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/maya_umbrella/__init__.py +0 -0
  10. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/maya_umbrella/_vendor/__init__.py +0 -0
  11. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/maya_umbrella/_vendor/atomicwrites/LICENSE +0 -0
  12. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/maya_umbrella/_vendor/atomicwrites/__init__.py +0 -0
  13. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/maya_umbrella/_vendor/atomicwrites.pyi +0 -0
  14. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/maya_umbrella/_vendor/six/__init__.pyi +0 -0
  15. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/maya_umbrella/_vendor/six/moves/__init__.pyi +0 -0
  16. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/maya_umbrella/_vendor/six/moves/configparser.pyi +0 -0
  17. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/maya_umbrella/_vendor/six.LICENSE +0 -0
  18. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/maya_umbrella/_vendor/six.py +0 -0
  19. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/maya_umbrella/_vendor/vendor.txt +0 -0
  20. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/maya_umbrella/cleaner.py +0 -0
  21. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/maya_umbrella/collector.py +0 -0
  22. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/maya_umbrella/constants.py +0 -0
  23. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/maya_umbrella/defender.py +0 -0
  24. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/maya_umbrella/filesystem.py +0 -0
  25. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/maya_umbrella/hooks/__init__.py +0 -0
  26. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/maya_umbrella/hooks/delete_turtle.py +0 -0
  27. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/maya_umbrella/hooks/delete_unknown_plugin_node.py +0 -0
  28. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/maya_umbrella/hooks/fix_model_panel.py +0 -0
  29. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/maya_umbrella/hooks/fix_no_scene_name.py +0 -0
  30. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/maya_umbrella/hooks/fix_on_model_change_3dc.py +0 -0
  31. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/maya_umbrella/i18n.py +0 -0
  32. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/maya_umbrella/locales/en_US.json +0 -0
  33. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/maya_umbrella/locales/zh_CN.json +0 -0
  34. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/maya_umbrella/log.py +0 -0
  35. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/maya_umbrella/maya_funs.py +0 -0
  36. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/maya_umbrella/scanner.py +0 -0
  37. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/maya_umbrella/vaccine.py +0 -0
  38. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/maya_umbrella/vaccines/__init__.py +0 -0
  39. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/maya_umbrella/vaccines/vaccine1.py +0 -0
  40. {maya_umbrella-0.14.1 → maya_umbrella-0.15.0}/maya_umbrella/vaccines/vaccine2.py +0 -0
  41. {maya_umbrella-0.14.1 → 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.1
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)
@@ -43,10 +48,10 @@ Description-Content-Type: text/markdown
43
48
  [![maya-2018](https://img.shields.io/badge/maya-2018-green)](https://img.shields.io/badge/maya-2018-green)
44
49
 
45
50
  <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
46
- [![All Contributors](https://img.shields.io/badge/all_contributors-8-orange.svg?style=flat-square)](#contributors-)
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,166 +59,146 @@ 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-2020` 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-2020`,
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
-
133
119
 
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
- # 环境变量
146
+ # Environment Variables
147
+ We can use the following environment variables to modify some of the settings of maya_umbrella,
148
+ so that companies with pipelines can better integrate them.
170
149
 
171
- 我们可以通过下列环境变量去修改maya_umbrella的一些设置,方便有pipeline的公司可以更好的集成
172
-
173
- 修改maya umbrella的日志保存目录,默认是windows temp目录
150
+ Modify the log saving directory of maya umbrella, the default is the windows temp directory.
174
151
 
175
152
  ```shell
176
153
  MAYA_UMBRELLA_LOG_ROOT
177
154
  ```
178
-
179
- 修改maya umbrella的日志文件名称, 默认是`maya_umbrella`
155
+ Change the name of the log file for maya umbrella, default is `maya_umbrella`.
180
156
 
181
157
  ```shell
182
158
  MAYA_UMBRELLA_LOG_NAME
183
159
  ```
184
160
 
185
- 设置日志级别,默认是info, 可以是debug可以看到更多的日志信息
161
+ Set the log level, the default is info, can be debug can see more log information.
186
162
 
187
163
  ```shell
188
164
  MAYA_UMBRELLA_LOG_LEVEL
189
165
  ```
190
- 修改杀毒后文件的备份文件夹名称, 默认是`_virus`
191
- 比如:
192
- 你文件路径是 `c:/your/path/file.ma`
193
- 那么备份文件路径是 `c:/your/path/_virus/file.ma`
166
+ Change the name of the backup folder for antivirus files, default is `_virus`.
167
+
168
+ For example:
169
+
170
+ Your file path is `c:/your/path/file.ma`.
171
+
172
+ Then the backup file path is `c:/your/path/_virus/file.ma`.
194
173
  ```shell
195
174
  MAYA_UMBRELLA_BACKUP_FOLDER_NAME
196
175
  ```
197
- 默认的显示语言,包含日志打印输出等,默认是根据你当前maya的界面语言来设置的,当然我们也可以通过下面的环境变量去设置
176
+ The default display language, including logging printouts, etc.
177
+ is set by default according to your current maya interface language,
178
+ but of course we can also set it via the following environment variables.
198
179
  ```shell
199
180
  MAYA_UMBRELLA_LANG
200
181
  ```
182
+ Ignore saving to the 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
185
+ after the batch antivirus.
201
186
 
202
- 忽略保存到备份文件夹,*请注意,如果你不清楚这个会导致的后果请不要轻易修改*,默认批量杀毒后会把源文件自动备份到当前文件的备份文件夹.
203
187
  ```shell
204
188
  MAYA_UMBRELLA_IGNORE_BACKUP
205
189
  ```
206
-
207
- 如果忽略请设置为
190
+ If ignored please set to
208
191
  ```shell
209
192
  SET MAYA_UMBRELLA_IGNORE_BACKUP=true
210
193
  ```
211
194
 
212
- 如果是便携版Maya,可以通过添加 `MAYA_LOCATION` 环境变量指定Maya路径
195
+ For the portable version of Maya,
196
+ you can specify the Maya path by adding the `MAYA_LOCATION` environment variable.
197
+
213
198
  ```shell
214
199
  SET MAYA_LOCATION=d:/your/path/maya_version/
215
200
  ```
216
- 也可以通过命令行指定目录
201
+ You can also specify a directory from the command line.
217
202
 
218
203
  ```shell
219
204
  nox -s maya -- 2018 --install-root /your/local/maya/root
@@ -221,7 +206,8 @@ nox -s maya -- 2018 --install-root /your/local/maya/root
221
206
  ```
222
207
 
223
208
  # API
224
- 获取当前场景没有被修复的病毒文件
209
+
210
+ Get virus files that have not been repaired in the current scenario.
225
211
 
226
212
  ```python
227
213
  from maya_umbrella import MayaVirusDefender
@@ -230,7 +216,7 @@ api = MayaVirusDefender()
230
216
  print(api.get_unfixed_references())
231
217
  ```
232
218
 
233
- 批量修复文件, 通过正则表达式
219
+ Batch repair of files, via regular expressions.
234
220
  ```python
235
221
  from maya_umbrella import MayaVirusScanner
236
222
 
@@ -239,14 +225,18 @@ print(api.scan_files_from_pattern("your/path/*.m[ab]"))
239
225
 
240
226
  ```
241
227
 
242
- # 案例
243
- 如果你想要快速通过maya standalone去批量清理maya文件,
244
- 可以`下载`或者`git clone`当前`main`分支的工程,
245
- 根据上面指引设置好开发环境,
246
- 通过`nox`命令去启动maya `standalone`环境,maya版本根据你当前本地安装的maya为准,
247
- 比如你本地安装了`2018`,
248
- 那么就是 `nox -s maya -- 2018 --standalone`
249
- 下面的语法是启动一个maya-2020的环境去动态从`c:/test`文件夹下去查杀病毒
228
+ # Examples
229
+
230
+ If you want to quickly go through maya standalone and batch clean up maya files.
231
+
232
+ You can either `download` or `git clone` the current `main` branch.
233
+
234
+ Set up your development environment according to the guidelines above,
235
+ and Use the `nox` command to start the maya `standalone` environment,
236
+ the version of maya is based on your current local installation of maya.
237
+ For example, if you have `2018` installed locally, Then `nox -s maya -- 2018 --standalone`.
238
+
239
+ The following syntax starts a maya-2020 environment to dynamically check for viruses from the `c:/test` folder.
250
240
 
251
241
  ```shell
252
242
  nox -s maya -- 2018 --standalone --pattern c:/test/*.m[ab]
@@ -272,6 +262,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
272
262
  </tr>
273
263
  <tr>
274
264
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/Wenfeng-Zhang"><img src="https://avatars.githubusercontent.com/u/54899080?v=4?s=100" width="100px;" alt="Wenfeng Zhang"/><br /><sub><b>Wenfeng Zhang</b></sub></a><br /><a href="https://github.com/loonghao/maya_umbrella/commits?author=Wenfeng-Zhang" title="Tests">⚠️</a> <a href="https://github.com/loonghao/maya_umbrella/commits?author=Wenfeng-Zhang" title="Code">💻</a></td>
265
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/rickdave"><img src="https://avatars.githubusercontent.com/u/37840466?v=4?s=100" width="100px;" alt="rickdave"/><br /><sub><b>rickdave</b></sub></a><br /><a href="https://github.com/loonghao/maya_umbrella/issues?q=author%3Arickdave" title="Bug reports">🐛</a></td>
275
266
  </tr>
276
267
  </tbody>
277
268
  </table>
@@ -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)
@@ -18,10 +20,10 @@
18
20
  [![maya-2018](https://img.shields.io/badge/maya-2018-green)](https://img.shields.io/badge/maya-2018-green)
19
21
 
20
22
  <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
21
- [![All Contributors](https://img.shields.io/badge/all_contributors-8-orange.svg?style=flat-square)](#contributors-)
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,166 +31,146 @@ 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-2020` 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-2020`,
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
-
108
91
 
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
- # 环境变量
118
+ # Environment Variables
119
+ We can use the following environment variables to modify some of the settings of maya_umbrella,
120
+ so that companies with pipelines can better integrate them.
145
121
 
146
- 我们可以通过下列环境变量去修改maya_umbrella的一些设置,方便有pipeline的公司可以更好的集成
147
-
148
- 修改maya umbrella的日志保存目录,默认是windows temp目录
122
+ Modify the log saving directory of maya umbrella, the default is the windows temp directory.
149
123
 
150
124
  ```shell
151
125
  MAYA_UMBRELLA_LOG_ROOT
152
126
  ```
153
-
154
- 修改maya umbrella的日志文件名称, 默认是`maya_umbrella`
127
+ Change the name of the log file for maya umbrella, default is `maya_umbrella`.
155
128
 
156
129
  ```shell
157
130
  MAYA_UMBRELLA_LOG_NAME
158
131
  ```
159
132
 
160
- 设置日志级别,默认是info, 可以是debug可以看到更多的日志信息
133
+ Set the log level, the default is info, can be debug can see more log information.
161
134
 
162
135
  ```shell
163
136
  MAYA_UMBRELLA_LOG_LEVEL
164
137
  ```
165
- 修改杀毒后文件的备份文件夹名称, 默认是`_virus`
166
- 比如:
167
- 你文件路径是 `c:/your/path/file.ma`
168
- 那么备份文件路径是 `c:/your/path/_virus/file.ma`
138
+ Change the name of the backup folder for antivirus files, default is `_virus`.
139
+
140
+ For example:
141
+
142
+ Your file path is `c:/your/path/file.ma`.
143
+
144
+ Then the backup file path is `c:/your/path/_virus/file.ma`.
169
145
  ```shell
170
146
  MAYA_UMBRELLA_BACKUP_FOLDER_NAME
171
147
  ```
172
- 默认的显示语言,包含日志打印输出等,默认是根据你当前maya的界面语言来设置的,当然我们也可以通过下面的环境变量去设置
148
+ The default display language, including logging printouts, etc.
149
+ is set by default according to your current maya interface language,
150
+ but of course we can also set it via the following environment variables.
173
151
  ```shell
174
152
  MAYA_UMBRELLA_LANG
175
153
  ```
154
+ Ignore saving to the 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
157
+ after the batch antivirus.
176
158
 
177
- 忽略保存到备份文件夹,*请注意,如果你不清楚这个会导致的后果请不要轻易修改*,默认批量杀毒后会把源文件自动备份到当前文件的备份文件夹.
178
159
  ```shell
179
160
  MAYA_UMBRELLA_IGNORE_BACKUP
180
161
  ```
181
-
182
- 如果忽略请设置为
162
+ If ignored please set to
183
163
  ```shell
184
164
  SET MAYA_UMBRELLA_IGNORE_BACKUP=true
185
165
  ```
186
166
 
187
- 如果是便携版Maya,可以通过添加 `MAYA_LOCATION` 环境变量指定Maya路径
167
+ For the portable version of Maya,
168
+ you can specify the Maya path by adding the `MAYA_LOCATION` environment variable.
169
+
188
170
  ```shell
189
171
  SET MAYA_LOCATION=d:/your/path/maya_version/
190
172
  ```
191
- 也可以通过命令行指定目录
173
+ You can also specify a directory from the command line.
192
174
 
193
175
  ```shell
194
176
  nox -s maya -- 2018 --install-root /your/local/maya/root
@@ -196,7 +178,8 @@ nox -s maya -- 2018 --install-root /your/local/maya/root
196
178
  ```
197
179
 
198
180
  # API
199
- 获取当前场景没有被修复的病毒文件
181
+
182
+ Get virus files that have not been repaired in the current scenario.
200
183
 
201
184
  ```python
202
185
  from maya_umbrella import MayaVirusDefender
@@ -205,7 +188,7 @@ api = MayaVirusDefender()
205
188
  print(api.get_unfixed_references())
206
189
  ```
207
190
 
208
- 批量修复文件, 通过正则表达式
191
+ Batch repair of files, via regular expressions.
209
192
  ```python
210
193
  from maya_umbrella import MayaVirusScanner
211
194
 
@@ -214,14 +197,18 @@ print(api.scan_files_from_pattern("your/path/*.m[ab]"))
214
197
 
215
198
  ```
216
199
 
217
- # 案例
218
- 如果你想要快速通过maya standalone去批量清理maya文件,
219
- 可以`下载`或者`git clone`当前`main`分支的工程,
220
- 根据上面指引设置好开发环境,
221
- 通过`nox`命令去启动maya `standalone`环境,maya版本根据你当前本地安装的maya为准,
222
- 比如你本地安装了`2018`,
223
- 那么就是 `nox -s maya -- 2018 --standalone`
224
- 下面的语法是启动一个maya-2020的环境去动态从`c:/test`文件夹下去查杀病毒
200
+ # Examples
201
+
202
+ If you want to quickly go through maya standalone and batch clean up maya files.
203
+
204
+ You can either `download` or `git clone` the current `main` branch.
205
+
206
+ Set up your development environment according to the guidelines above,
207
+ and Use the `nox` command to start the maya `standalone` environment,
208
+ the version of maya is based on your current local installation of maya.
209
+ For example, if you have `2018` installed locally, Then `nox -s maya -- 2018 --standalone`.
210
+
211
+ The following syntax starts a maya-2020 environment to dynamically check for viruses from the `c:/test` folder.
225
212
 
226
213
  ```shell
227
214
  nox -s maya -- 2018 --standalone --pattern c:/test/*.m[ab]
@@ -247,6 +234,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
247
234
  </tr>
248
235
  <tr>
249
236
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/Wenfeng-Zhang"><img src="https://avatars.githubusercontent.com/u/54899080?v=4?s=100" width="100px;" alt="Wenfeng Zhang"/><br /><sub><b>Wenfeng Zhang</b></sub></a><br /><a href="https://github.com/loonghao/maya_umbrella/commits?author=Wenfeng-Zhang" title="Tests">⚠️</a> <a href="https://github.com/loonghao/maya_umbrella/commits?author=Wenfeng-Zhang" title="Code">💻</a></td>
237
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/rickdave"><img src="https://avatars.githubusercontent.com/u/37840466?v=4?s=100" width="100px;" alt="rickdave"/><br /><sub><b>rickdave</b></sub></a><br /><a href="https://github.com/loonghao/maya_umbrella/issues?q=author%3Arickdave" title="Bug reports">🐛</a></td>
250
238
  </tr>
251
239
  </tbody>
252
240
  </table>
@@ -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.1"
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.1"
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.1"
File without changes