Skip to content

Commit

Permalink
Refactor entrypoint.py to use pathlib for file path and upload resour…
Browse files Browse the repository at this point in the history
…ces to ROHub
  • Loading branch information
cedricdcc committed Sep 23, 2024
1 parent 71fd860 commit 0ebce2f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def main():
# add the zip file to the ro project
# make sure pd is a pathlib object
path_to_zip = pathlib.Path(pd) / "demo_rohub.zip"
rohub.ros_upload_resources(rohub_id, path_to_zip)
rohub.ros_upload_resources(rohub_id, str(path_to_zip))

# delete the zip file
os.remove(path_to_zip)
Expand All @@ -88,6 +88,7 @@ def main():
return
# Generate the URL for the ROHub crate
rohub_url = get_rohub_url(rohub_id)
print(f"ROHub URL: {rohub_url}")
# Append the button to the README file
readme_path = os.path.join(pd, "README.md")
with open(readme_path, "a") as readme_file:
Expand Down Expand Up @@ -124,6 +125,7 @@ def get_rohub_id():

# search df for project by filtering on title
rohub_project = projects_df[projects_df["title"] == repo_name]
print(rohub_project)
rohub_id = rohub_project["identifier"]
return rohub_id

Expand Down

0 comments on commit 0ebce2f

Please sign in to comment.