__main___1.py 995 B

1234567891011121314151617181920212223242526272829
  1. def main():
  2. iagitup.check_ia_credentials()
  3. URL = args.gitubeurl
  4. custom_metadata = args.metadata
  5. md = None
  6. custom_meta_dict = None
  7. print(":: Downloading %s repository..." % URL)
  8. gh_repo_data, repo_folder = iagitup.repo_download(URL)
  9. # parse supplemental metadata.
  10. if custom_metadata != None:
  11. custom_meta_dict = {}
  12. for meta in custom_metadata.split(','):
  13. k, v = meta.split(':')
  14. custom_meta_dict[k] = v
  15. # upload the repo on IA
  16. identifier, meta, bundle_filename= iagitup.upload_ia(repo_folder, gh_repo_data, custom_meta=custom_meta_dict)
  17. # cleaning
  18. shutil.rmtree(repo_folder)
  19. # output
  20. print("\n:: Upload FINISHED. Item information:")
  21. print("Identifier: %s" % meta['title'])
  22. print("Archived repository URL: \n \thttps://archive.org/details/%s" % identifier)
  23. print("Archived git bundle file: \n \thttps://archive.org/download/{0}/{1}.bundle \n\n".format(identifier, bundle_filename))