-
Notifications
You must be signed in to change notification settings - Fork 5
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
base: master
Are you sure you want to change the base?
Conversation
# 获取工程名称 | ||
script_name = nuke.scriptName() | ||
# 匹配是否存在版本号,如果不存在,另存为版本1,并进行升级操作 | ||
if not re.search(script_name, r'.?_v/d*.nk$'): |
There was a problem hiding this comment.
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$') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里只会返回一个_sre.SRE_Match对象,打印出来没有意义
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
. 的匹配最好变成 . 吧 ?不然别的字符也会匹配进去了 比如 lv001d 而不是 .v001.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zclongpop123 他只检查代码里有没有版本号,不关心其他字符,有就行
user_A,B启动不同的工作环境,A的menu.py会创建command1-3 |
升版本操作