# The provided path must be to a `text` object.
def statusmap (topic, path):
status = { "@type": "MicroblogPost" }
# The provided path must be to a `text` object.
def statusmap (topic, path):
status = { "@type": "MicroblogPost" }
if version_path and version_path.name != "0=x_status_git_1.0":
warn(f"Unrecognized version for {path}; skipping.")
return None
if topic:
status["subject"] = topic
if version_path and version_path.name != "0=x_status_git_1.0":
warn(f"Unrecognized version for {path}; skipping.")
return None
if topic:
status["subject"] = topic
if author_path:
status["author"] = { "name": author_path.name[2:] }
with author_path.open("r", encoding="utf-8") as text:
status["author"]["@id"] = text.read().strip()
if author_path:
status["author"] = { "name": author_path.name[2:] }
with author_path.open("r", encoding="utf-8") as text:
status["author"]["@id"] = text.read().strip()
if title_path:
with title_path.open("r", encoding="utf-8") as text:
title = text.read().strip()
status["title"] = title
if title_path:
with title_path.open("r", encoding="utf-8") as text:
title = text.read().strip()
status["title"] = title