If you run "p4 info" in a subprocess, you can then look up "Client root". Something like this: info = subprocess.check_output('p4 info') info = info.splitlines() info = [L.split(':', 1) for L in info] info = dict(info) p4Root = info['Client root']
You can then compare p4Root to the paths you're interested in, something like: p4Root = os.path.normcase(os.path.normpath(p4Root)) path = os.path.normcase(os.path.normpath(path))if not path.startswith(p4Root): raise WhateverError() On Wednesday, 3 May 2017 06:39:25 UTC+10, todd....@gmail.com wrote: > > got an interesting issue at work. > > we use perforce for source control on all art assets. and do to a lack in > guidance, almost everyone on the art team has their perforce installs done > in different locations and paths > > ie : > D:/p4, E:/PROJECTS, C:/p4, et al > > Anyone have suggestions on how to setup the project paths so that it would > strip out the drive and root and just use the perforce directories as teh > root for the project? ...in our case, Interactive > > thanks > -todd > > -- > Todd Widup > Creature TD / Technical Artist > todd....@gmail.com <javascript:> > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/89e8d241-1e5e-4c2d-bc46-83f85d68df6f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.