Skip to content

Conversation

@beimingxinglian
Copy link
Collaborator

升版本操作

# 获取工程名称
script_name = nuke.scriptName()
# 匹配是否存在版本号,如果不存在,另存为版本1,并进行升级操作
if not re.search(script_name, r'.?_v/d*.nk$'):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re相关查询函数的参数列表都是pattern在前,string在后,这里的pattern应该写成r'.?_v\d+\.nk$

script_name = nuke.scriptName()
# 匹配是否存在版本号,如果不存在,另存为版本1,并进行升级操作
if not re.search(script_name, r'.?_v/d*.nk$'):
print re.search(script_name, r'.?_v/d*.nk$')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里只会返回一个_sre.SRE_Match对象,打印出来没有意义

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

. 的匹配最好变成 . 吧 ?不然别的字符也会匹配进去了 比如 lv001d 而不是 .v001.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zclongpop123 他只检查代码里有没有版本号,不关心其他字符,有就行

@beimingxinglian
Copy link
Collaborator Author

user_A,B启动不同的工作环境,A的menu.py会创建command1-3

@beimingxinglian beimingxinglian requested a review from haogeek April 19, 2020 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants