maya-umbrella 0.7.0__py2.py3-none-any.whl → 0.9.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.7.0"
1
+ __version__ = "0.9.0"
@@ -97,7 +97,6 @@ def atomic_writes(src, mode, **options):
97
97
  shutil.move(temp_path, src)
98
98
 
99
99
 
100
-
101
100
  def id_generator(size=6, chars=string.ascii_uppercase + string.digits):
102
101
  """Generate a random string of the given size using the given characters."""
103
102
  return "".join(random.choice(chars) for _ in range(size))
@@ -266,3 +265,31 @@ def get_backup_path(path, root_path=None):
266
265
  except (OSError, IOError): # noqa: UP024
267
266
  pass
268
267
  return os.path.join(backup_path, filename)
268
+
269
+
270
+ def get_maya_install_root(maya_version):
271
+ """Get the Maya install root path."""
272
+ maya_location = os.environ.get("MAYA_LOCATION")
273
+ try:
274
+ # Import built-in modules
275
+ import winreg
276
+ except ImportError:
277
+ return maya_location
278
+ try:
279
+ key = winreg.OpenKey(
280
+ winreg.HKEY_LOCAL_MACHINE,
281
+ "SOFTWARE\\Autodesk\\Maya\\{maya_version}\\Setup\\InstallPath".format(maya_version=maya_version),
282
+ )
283
+ root, _ = winreg.QueryValueEx(key, "MAYA_INSTALL_LOCATION")
284
+ if not os.path.isdir(root):
285
+ print("Failed to locate the appropriate Maya path in the registration list.")
286
+ except OSError:
287
+ return maya_location
288
+ maya_location = maya_location or root
289
+ if not maya_location:
290
+ print("maya not found.")
291
+ return
292
+ maya_exe = os.path.join(maya_location, "bin", "maya.exe")
293
+ if not os.path.exists(maya_exe):
294
+ print("maya.exe not found in {maya_location}.".format(maya_location=maya_location))
295
+ return maya_location
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: maya_umbrella
3
- Version: 0.7.0
3
+ Version: 0.9.0
4
4
  Summary: Check and fix maya virus.
5
5
  Home-page: https://github.com/loonghao/maya_umbrella
6
6
  License: MIT
@@ -53,10 +53,15 @@ It ensures a secure and seamless user experience by proactively scanning for thr
53
53
  It can be provided as an API for seamless integration into your existing pipeline.
54
54
 
55
55
  # 安装
56
+
57
+ ## pip 安装
56
58
  maya_umbrella是以标准pipy包去发布的,所以我们可以通过pip install去安装
57
59
  ```shell
58
60
  your/maya-root/mayapy -m pip install maya-umbrella
59
61
  ```
62
+ ## 一键安装
63
+ 在release里面下载对应版本的zip包,解压后双击`install.bat`即可安装
64
+
60
65
  更新版本
61
66
  ```shell
62
67
  your/maya-root/mayapy -m pip install maya-umbrella --upgrade
@@ -80,13 +85,15 @@ pip install nox poetry
80
85
  # 开发调试
81
86
 
82
87
  ```shell
83
- nox -s maya-2020
88
+ nox -s maya -- 2020 --test
84
89
  ```
85
90
 
86
91
  ## 在maya中测试
87
92
 
88
- 通过`nox -s maya-xxx`, 启动maya.
89
- nox会动态根据你本地安装得maya去注册nox session, 比如你本地安装了`maya-2020`,那么通过`nox -s maya-2018`
93
+ 通过`nox -s maya -- <maya version>`, 启动maya.
94
+ nox会动态根据你本地安装得maya去注册nox session, 比如你本地安装了`maya-2020`,
95
+
96
+ 那么通过`nox -s maya -- 2018`, **注意:maya 与 版本号之间有 俩个`-`**
90
97
 
91
98
  启动maya后在脚本编辑器中执行下面得代码,就会动态的从`<repo>/tests/virus/`里面去open ma文件去进行测试.
92
99
 
@@ -112,7 +119,7 @@ nox -s ruff_check
112
119
  # 生成安装包
113
120
 
114
121
  执行下面的命令可以在<repo>/.zip下面创建zip,参数 `--version` 当前工具的版本号
115
-
122
+ **注意:`make-zip` 与 `--version`之间有 俩个`-`**
116
123
  ```shell
117
124
  nox -s make-zip -- --version 0.5.0
118
125
  ```
@@ -154,6 +161,12 @@ MAYA_UMBRELLA_LANG
154
161
  ```shell
155
162
  MAYA_UMBRELLA_IGNORE_BACKUP
156
163
  ```
164
+
165
+ 如果是便携版Maya,可以通过添加 `MAYA_LOCATION` 环境变量指定Maya路径
166
+ ```shell
167
+ SET MAYA_LOCATION=d:/your/path/maya_version/
168
+ ```
169
+
157
170
  如果忽略请设置为
158
171
  ```shell
159
172
  SET MAYA_UMBRELLA_IGNORE_BACKUP=true
@@ -181,8 +194,8 @@ print(api.scan_files_from_pattern("your/path/*.m[ab]"))
181
194
  # 案例
182
195
  如果你想要快速通过maya standalone去批量清理maya文件,可以`下载`或者`git clone`当前`main`分支的工程,
183
196
  根据上面指引设置好开发环境
184
- 通过`nox`命令去启动maya standalone环境,maya版本根据你当前本地安装的maya为准,比如你本地安装了`2018`,
185
- 那么就是 `nox -s maya-2018-s`
197
+ 通过`nox`命令去启动maya `standalone`环境,maya版本根据你当前本地安装的maya为准,比如你本地安装了`2018`,
198
+ 那么就是 `nox -s maya -- 2018 --standalone`
186
199
  下面的语法是启动一个maya-2020的环境去动态从`c:/test`文件夹下去查杀病毒
187
200
  ```shell
188
201
  nox -s maya-2020-s -- c:/test/*.m[ab]
@@ -1,10 +1,10 @@
1
1
  maya_umbrella/__init__.py,sha256=uHgbJ-AL3NOfDNB55_7a4_c-OAuP4X8eQ_Yi1udaA0I,401
2
- maya_umbrella/__version__.py,sha256=RaANGbRu5e-vehwXI1-Qe2ggPPfs1TQaZj072JdbLk4,22
2
+ maya_umbrella/__version__.py,sha256=H9NWRZb7NbeRRPLP_V1fARmLNXranorVM-OOY-8_2ug,22
3
3
  maya_umbrella/cleaner.py,sha256=5EC3w4qRkIsr9AIZneEV8ljhxaOw385Gj2C2KTrzyJg,5044
4
4
  maya_umbrella/collector.py,sha256=rAFmvY8Isdle89ezn2-H36hSJd77iBvPBLRPzruCycA,13111
5
5
  maya_umbrella/constants.py,sha256=2sl0dL0U82mwu-Msda9B8-USxr89Wu2yu6SYiuaaJZk,539
6
6
  maya_umbrella/defender.py,sha256=K5EERl9bwd0IY_ilvnNYXYaQpIe-DUGep-buEb3qLV8,5601
7
- maya_umbrella/filesystem.py,sha256=CY3MlOXi_fJ8NTITvgotyPiZHyzM4uZQTgMmOYD25T0,8333
7
+ maya_umbrella/filesystem.py,sha256=y5LfpON4qPqCApQ4ijgM7bBaZ8vmvzaYpmTJluFpw74,9360
8
8
  maya_umbrella/hooks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  maya_umbrella/hooks/delete_turtle.py,sha256=OPFRFH1iwonHvETndrP87MZQlJLhxpe564AJE3KyJY8,761
10
10
  maya_umbrella/hooks/delete_unknown_plugin_node.py,sha256=xbJvihfjZBhF946ugVqj2IpY_VjOBZt_8KO5omDrJhw,1281
@@ -22,7 +22,7 @@ maya_umbrella/vaccines/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
22
22
  maya_umbrella/vaccines/vaccine1.py,sha256=WLo1uJElTLSjVCf5CBtRNU4HKs63my5mkHiGqTfnNEE,489
23
23
  maya_umbrella/vaccines/vaccine2.py,sha256=yvHpnrQ6Jts9_zCy8WRJcbxz0CVSRAPkn2vF552atQs,2123
24
24
  maya_umbrella/vaccines/vaccine3.py,sha256=d89Ocj1AmsZt9YJjggjDJqAWXcckGLMl-6u8jXeAPjg,3493
25
- maya_umbrella-0.7.0.dist-info/LICENSE,sha256=tJf0Pz8q_65AjEkm3872K1cl4jGil28vJO5Ko_LhUqc,1060
26
- maya_umbrella-0.7.0.dist-info/METADATA,sha256=jgCXimSbweHh85lZRmdIJJc5P030SAs9Vc3je-4EawA,10847
27
- maya_umbrella-0.7.0.dist-info/WHEEL,sha256=IrRNNNJ-uuL1ggO5qMvT1GGhQVdQU54d6ZpYqEZfEWo,92
28
- maya_umbrella-0.7.0.dist-info/RECORD,,
25
+ maya_umbrella-0.9.0.dist-info/LICENSE,sha256=tJf0Pz8q_65AjEkm3872K1cl4jGil28vJO5Ko_LhUqc,1060
26
+ maya_umbrella-0.9.0.dist-info/METADATA,sha256=x18KoaE0HqGjRPeBT-6Q6i0wdHtUbvGqgSNuttVDpIA,11271
27
+ maya_umbrella-0.9.0.dist-info/WHEEL,sha256=IrRNNNJ-uuL1ggO5qMvT1GGhQVdQU54d6ZpYqEZfEWo,92
28
+ maya_umbrella-0.9.0.dist-info/RECORD,,