Skip to content

Commit

Permalink
potential integration error fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardFrangenberg committed Dec 12, 2018
1 parent 7112c61 commit 3b2aca4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,11 @@ def writeMaxFiles(self, installPath):
origInitFile = os.path.join(integrationBase, "initPandora.py")
shutil.copy2(origInitFile, initPy)

with open(initPy, "r+") as init:
with open(initPy, "r") as init:
initStr = init.read()

with open(initPy, "w") as init:
initStr = initStr.replace("PANDORAROOT", "\"%s\"" % self.core.pandoraRoot.replace("\\", "/"))
init.seek(0)
init.write(initStr)

pandoraMenu = os.path.join(maxpath, "PandoraMenu.ms")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,11 @@ def writeBlenderFiles(self, blenderPath):
shutil.copy2(baseinitfile, initpath)
addedFiles.append(initpath)

with open(initpath, "r+") as init:
with open(initpath, "r") as init:
initStr = init.read()

with open(initpath, "w") as init:
initStr = initStr.replace("PANDORAROOT", "\"%s\"" % self.core.pandoraRoot.replace("\\", "/"))
init.seek(0)
init.write(initStr)

if platform.system() == "Windows":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,11 @@ def writeHoudiniFiles(self, houdiniPath):
shutil.copy2(origInitFile, initpath)
addedFiles.append(initpath)

with open(initpath, "r+") as init:
with open(initpath, "r") as init:
initStr = init.read()

with open(initpath, "w") as init:
initStr = initStr.replace("PANDORAROOT", "\"%s\"" % self.core.pandoraRoot.replace("\\", "/"))
init.seek(0)
init.write(initStr)

return True
Expand Down
10 changes: 6 additions & 4 deletions Pandora/Plugins/Apps/Maya/Scripts/Pandora_Maya_Integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,11 @@ def writeMayaFiles(self, mayaPath):
shutil.copy2(origInitFile, initpath)
addedFiles.append(initpath)

with open(initpath, "r+") as init:
with open(initpath, "r") as init:
initStr = init.read()

with open(initpath, "w") as init:
initStr = initStr.replace("PANDORAROOT", "\"%s\"" % self.core.pandoraRoot.replace("\\", "/"))
init.seek(0)
init.write(initStr)

shelfpath = os.path.join(mayaPath, "prefs", "shelves", "shelf_Pandora.mel")
Expand All @@ -226,10 +227,11 @@ def writeMayaFiles(self, mayaPath):
shutil.copy2(origShelfFile, shelfpath)
addedFiles.append(shelfpath)

with open(shelfpath, "r+") as init:
with open(shelfpath, "r") as init:
initStr = init.read()

with open(initpath, "w") as init:
initStr = initStr.replace("PANDORAROOT", self.core.pandoraRoot.replace("\\", "\\\\"))
init.seek(0)
init.write(initStr)

icons = ["pandoraSubmitter.png", "pandoraRenderHandler.png", "pandoraSettings.png"]
Expand Down

0 comments on commit 3b2aca4

Please sign in to comment.