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 import git
except: except:
FreeCAD.Console.PrintWarning("python-git not found. Git-related functions are disabled\n") FreeCAD.Console.PrintWarning("python-git not found. Git-related functions are disabled\n")
try: else:
repo = git.Repo(LIBRARYPATH) try:
except: repo = git.Repo(LIBRARYPATH)
FreeCAD.Console.PrintError("Your library is not a valid Git repository. Please clone it with git first.\n") except:
return FreeCAD.Console.PrintError("Your library is not a valid Git repository. Please clone it with git first.\n")
if not repo.remotes: else:
FreeCAD.Console.PrintWarning("No remote repository set.\n") if not repo.remotes:
return FreeCAD.Console.PrintWarning("No remote repository set.\n")
if not repo: if not repo:
updatebutton.setEnabled(False) updatebutton.setEnabled(False)
configbutton.setEnabled(False) configbutton.setEnabled(False)