Removed redundant function and added it as a callback.

This commit is contained in:
Anon 2024-07-17 20:33:10 -07:00
parent 6066e872aa
commit 8b8085bc3f

View File

@ -29,8 +29,8 @@ class FediStatusPoster:
self.mastodon_api = self.login(client_id, client_secret, access_token, api_base_url, feature_set) self.mastodon_api = self.login(client_id, client_secret, access_token, api_base_url, feature_set)
# Callback functions # Callback functions
self.status_post = self._status_post_debug if debug_mode else self._status_post
self.media_post = self._media_post_debug if debug_mode else self.mastodon_api.media_post self.media_post = self._media_post_debug if debug_mode else self.mastodon_api.media_post
self.status_post = self._status_post_debug if debug_mode else self.mastodon_api.status_post
def login(self, client_id, client_secret, access_token, api_base_url, feature_set): def login(self, client_id, client_secret, access_token, api_base_url, feature_set):
try: try:
@ -95,15 +95,6 @@ class FediStatusPoster:
print("CONTENT_TYPE:", content_type) print("CONTENT_TYPE:", content_type)
print("[DEBUG_END]") print("[DEBUG_END]")
def _status_post(self, status, media_ids, sensitive, visibility, content_type):
self.mastodon_api.status_post(
status=status,
media_ids=media_ids,
visibility=visibility,
sensitive=sensitive,
content_type=content_type
)
# If the user wants to generate html links to the image file, # If the user wants to generate html links to the image file,
# switch the content type to markdown. I think this is sane # switch the content type to markdown. I think this is sane
# default behavior, since the alternative would be generating # default behavior, since the alternative would be generating