Skip to content

Commit

Permalink
Merge pull request #41 from usegalaxy-eu/arash-refactor-comment-text
Browse files Browse the repository at this point in the history
Update social media assistant message
  • Loading branch information
bgruening authored Jun 13, 2024
2 parents 5f5fdeb + adb9919 commit 61394a8
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/galaxy_social.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def process_markdown_file(self, file_path, processed_files):
except Exception as e:
raise Exception(f"Failed to format post for {file_path}.\n{e}")
if self.preview:
message = f'Hi, I\'m your friendly social media assistant. In the following, you will see a preview of this post "{file_path}"'
message = f"👋 Hello! I'm your friendly social media assistant. Below are the previews of this post:\n`{file_path}`"
for media in metadata["media"]:
formatted_content, preview, warning = formatting_results[media]
message += f"\n\n## {media}\n\n"
Expand All @@ -130,10 +130,8 @@ def process_markdown_file(self, file_path, processed_files):
message += f"\nWARNING: {warning}"
return processed_files, message.strip()

stats = {}
url = {}
if file_path in processed_files:
stats = processed_files[file_path]
stats = processed_files[file_path] if file_path in processed_files else {}
for media in metadata["media"]:
if stats.get(media):
print("Skipping previous post to", media)
Expand All @@ -149,7 +147,11 @@ def process_markdown_file(self, file_path, processed_files):
if stats[media]
]
)
message = f"Posted to:\n\n{url_text}" if url_text else "No posts created."
message = (
f"Below are the links of this post:\n`{file_path}`\n\n{url_text}"
if url_text
else f"Nothing created for this post:\n`{file_path}`"
)

processed_files[file_path] = stats
print(f"Processed {file_path}: {stats}")
Expand Down

0 comments on commit 61394a8

Please sign in to comment.