Removed redundant function and added it as a callback.
This commit is contained in:
parent
6066e872aa
commit
8b8085bc3f
@ -29,8 +29,8 @@ class FediStatusPoster:
|
||||
self.mastodon_api = self.login(client_id, client_secret, access_token, api_base_url, feature_set)
|
||||
|
||||
# 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.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):
|
||||
try:
|
||||
@ -95,15 +95,6 @@ class FediStatusPoster:
|
||||
print("CONTENT_TYPE:", content_type)
|
||||
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,
|
||||
# switch the content type to markdown. I think this is sane
|
||||
# default behavior, since the alternative would be generating
|
||||
|
Loading…
Reference in New Issue
Block a user