Changeset - 80daf6dd0f86
[Not reviewed]
default
0 1 0
Dennis Fink - 6 years ago 2018-12-26 19:29:47
dennis.fink@c3l.lu
Change toot to unlisted
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
spaceapi/utils.py
Show inline comments
 
@@ -63,25 +63,25 @@ def post_tweet(tweet, spaceapi=None):
 
            api.update_status(tweet)
 
        else:
 
            api.update_status(tweet, lat=spaceapi['location']['lat'], lon=spaceapi['location']['lon'])
 

	
 

	
 
def post_toot(toot):
 
    if 'MASTODON_USERCRED_FILE' in current_app.config:
 
        api = mastodon.Mastodon(
 
            client_id='c3l_spaceapi_clientcred.secret',
 
            access_token=current_app.config['MASTODON_USERCRED_FILE'],
 
            api_base_url='https://chaos.social'
 
        )
 
        api.status_post(toot, visibility='public')
 
        api.status_post(toot, visibility='unlisted')
 

	
 

	
 
class Singleton:
 

	
 
    def __new__(cls, *args, **kwargs):
 
        key = str(hash(cls))
 

	
 
        if not hasattr(cls, '_instance_dict'):
 
            cls._instance_dict = {}
 

	
 
        if key not in cls._instance_dict:
 
            cls._instance_dict[key] = super().__new__(cls, *args, **kwargs)
0 comments (0 inline, 0 general)