From: Damien Mahoney <damien@(email surpressed).au>
Subject: Re: Python Maya submit script not fully using the path_convert
   Date: Fri, 08 Mar 2013 06:17:57 -0500
Msg# 2286
View Complete Thread (4 articles) | All Threads
Last Next
Awesome! fixed in no time thanks Greg.

On 03/08/2013 05:25 PM, Greg Ercolano wrote:
Hi Damien,

    Confirmed.
Always nice to know I'm not crazy.

    Short answer: looks like the fix is to make two changes:

        1) Change the following line in the lib/RushSubmit.py script:

        BEFORE:   
scriptpath_ = scriptpath.replace("\\","/")
        AFTER:     scriptpath_ = RushSiteSettings.FixPath(scriptpath.replace("\\","/"))

        2) Change the following line in the lib/RushSiteSettings.py script.

        BEFORE:
  
path = Rush.FrontSlashes(path)                      # \path\file -> /path/file
        AFTER:     path = Rush.PathConvert(Rush.FrontSlashes(path))    # \path\file -> /path/file

    So to be specific, in your case you'd edit these two scripts on your file server:
        //YETY/drive/rushscripts/python/lib/RushSubmit.py
   
//YETY/drive/rushscripts/python/lib/RushSiteSettings.py

This works a charm. Thank you!
    The error you showed from the python frame log:
python: can't open file '/YETY/drive/rushscripts/python/submit_maya.py': 
[Errno 2] No such file or directory

    ..seems to show the problem is specifically with the path to the python script itself
    not getting the path_convert treatment. That is why the above fix should solve that,
    by making sure the scripts immediately apply the path conversion as soon as they
    record it with the Init() function.

    Note that in the Rush example scripts, path conversions are implemented this way:
  • In perl with the FixPath() function (defined in .common.pl)
  • In python with the RushSiteSettings.FixPath()  (defined in lib/RushSiteSettings.py)
    In the previous versions of rush, you'd modify these functions directly to include regular expressions
    to do the pathname conversions.

    In the 103 version of Rush, I wanted to "centralize" this so that both scripts would access
    the path conversion info from a centralized location, which brought about the new path_convert feature.
    Any script can ask for a path to be translated by invoking:

         rush -pathconvert /some/pathname

    ..and reading stdout for the resulting path conversion. And this is what the above FixPath()
    functions do now (in addition to letting you customize them with regex if you want).

PS. In your original message, I think (hope) you had accidentally pasted an extra copy of your
path_convert file into the middle of your perl frame log.. I re-edited your message (below) to
remove that stray paste for readability.


Yes that is right. I was a bit too slap dash.


Last Next