def clone(url, dest, username = None, password = None):
     commands = ['clone', url, dest]
     if username is not None and password is not None:
         commands.extend(["--username", username, "--password", password])
     port = config.getConfigValue(config.GENERAL, config.GATEWAY_PORT)
     setGatewayPort(port)
     try:
         execute(lambda: _runGateway(commands, os.path.dirname(__file__)), "Downloading repository data")
     except Py4JConnectionException:
         startGateway()
         execute(lambda: _runGateway(commands, os.path.dirname(__file__)), "Downloading repository data")
 def runDecorated(self, func, progressMessage = None):
     port = config.getConfigValue(config.GENERAL, config.GATEWAY_PORT)
     setGatewayPort(port)
     if not self._showProgress:
         progressMessage = None
     return execute(func, progressMessage)