diff --git a/gitlab-project-export.py b/gitlab-project-export.py index 0fe629d..6f00228 100755 --- a/gitlab-project-export.py +++ b/gitlab-project-export.py @@ -17,24 +17,24 @@ if __name__ == '__main__': # Parsing arguments parser = argparse.ArgumentParser( - description=""" + description=""" GitLab Project Export is small project using Gitlab API for exporting whole gitlab project with wikis, issues etc. Good for migration or simple backup your gitlab projects. """, epilog='Created by Robert Vojcik ') - + # Arguments parser.add_argument('-c', dest='config', default='config.yaml', - help='config file') + help='config file') parser.add_argument('-d', dest='debug', default=False, action='store_const', const=True, - help='Debug mode') - + help='Debug mode') + args = parser.parse_args() if not os.path.isfile(args.config): - print("Unable to find config file %s" % (args.config)) + print("Unable to find config file %s" % (args.config)) c = config.Config(args.config) token = c.config["gitlab"]["access"]["token"] @@ -57,7 +57,7 @@ print("Success for %s"%(project)) # Download project to our destination if c.config["backup"]["project_dirs"]: - destination = c.config["backup"]["destination"] + "/" + project + destination = c.config["backup"]["destination"] + "/" + project else: destination = c.config["backup"]["destination"] @@ -97,5 +97,5 @@ # Export for project unsuccessful print("Export failed for project %s" % (project), file=sys.stderr) return_code += 1 - + sys.exit(return_code) diff --git a/gitlab-project-import.py b/gitlab-project-import.py index 3fed725..3e164f4 100755 --- a/gitlab-project-import.py +++ b/gitlab-project-import.py @@ -17,28 +17,28 @@ if __name__ == '__main__': # Parsing arguments parser = argparse.ArgumentParser( - description=""" + description=""" GitLab Project Export is small project using Gitlab API for exporting whole gitlab project with wikis, issues etc. Good for migration or simple backup your gitlab projects. """, epilog='Created by Robert Vojcik ') - + # Arguments parser.add_argument('-c', dest='config', default='config.yaml', - help='config file') + help='config file') parser.add_argument('-f', dest='filepath', default=False, - help='Path to gitlab exported project file') + help='Path to gitlab exported project file') parser.add_argument('-p', dest='project_path', default=False, - help='Project path') + help='Project path') parser.add_argument('-d', dest='debug', default=False, action='store_const', const=True, - help='Debug mode') - + help='Debug mode') + args = parser.parse_args() if not os.path.isfile(args.config): - print("Unable to find config file %s" % (args.config)) + print("Unable to find config file %s" % (args.config)) c = config.Config(args.config) token = c.config["gitlab"]["access"]["token"]