Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

03009 zhang ying #3

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

03009 zhang ying #3

wants to merge 6 commits into from

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 他只检查代码里有没有版本号,不关心其他字符,有就行

homeworks/lesson5/script_update.py Show resolved Hide resolved
homeworks/lesson5/script_update.py Show resolved Hide resolved
@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.

3 participants