Allow the macro to work without git - fixes #137

This commit is contained in:
Yorik van Havre 2015-12-15 14:05:03 -02:00
parent 88db2acb7d
commit 40d6827517

View file

@ -191,14 +191,14 @@ class ExpDockWidget(QtGui.QDockWidget):
import git
except:
FreeCAD.Console.PrintWarning("python-git not found. Git-related functions are disabled\n")
try:
repo = git.Repo(LIBRARYPATH)
except:
FreeCAD.Console.PrintError("Your library is not a valid Git repository. Please clone it with git first.\n")
return
if not repo.remotes:
FreeCAD.Console.PrintWarning("No remote repository set.\n")
return
else:
try:
repo = git.Repo(LIBRARYPATH)
except:
FreeCAD.Console.PrintError("Your library is not a valid Git repository. Please clone it with git first.\n")
else:
if not repo.remotes:
FreeCAD.Console.PrintWarning("No remote repository set.\n")
if not repo:
updatebutton.setEnabled(False)
configbutton.setEnabled(False)