mirror of
https://github.com/nova-r/fediplug.git
synced 2025-03-10 15:49:00 +01:00
lint
This commit is contained in:
parent
323a1660f0
commit
7bbac451bc
5 changed files with 9 additions and 4 deletions
|
@ -1,2 +1,3 @@
|
|||
from fediplay.cli import cli
|
||||
'''A Mastodon client for playing your friends' music.'''
|
||||
|
||||
from fediplay.cli import cli
|
||||
|
|
|
@ -3,4 +3,3 @@
|
|||
from fediplay.cli import cli
|
||||
|
||||
cli()
|
||||
|
||||
|
|
|
@ -6,10 +6,11 @@ import sys
|
|||
import click
|
||||
from mastodon import Mastodon
|
||||
|
||||
import fediplay.env as env
|
||||
import fediplay.mastodon as mastodon
|
||||
|
||||
def api_base_url_from_instance(instance):
|
||||
'''Create an API base url from an instance name.'''
|
||||
|
||||
return 'https://' + instance
|
||||
|
||||
@click.group()
|
||||
|
|
|
@ -5,9 +5,13 @@ from os import getenv
|
|||
from dotenv import load_dotenv, find_dotenv
|
||||
|
||||
def no_check_certificate():
|
||||
'''Returns whether fediplay should check TLS certificates.'''
|
||||
|
||||
return bool(getenv('FEDIPLAY_NO_CHECK_CERTIFICATE'))
|
||||
|
||||
def play_command():
|
||||
'''Returns the play command fediplay should use to play a file.'''
|
||||
|
||||
return (getenv('FEDIPLAY_PLAY_COMMAND') or
|
||||
'ffplay -v 0 -nostats -hide_banner -autoexit -nodisp {filename}')
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ def login(client, grant_code):
|
|||
def stream(api_base_url):
|
||||
'''Stream statuses and add them to a queue.'''
|
||||
|
||||
client = Mastodon(client_id='clientcred.secret',
|
||||
client = Mastodon(client_id='clientcred.secret',
|
||||
access_token='usercred.secret',
|
||||
api_base_url=api_base_url)
|
||||
listener = StreamListener(Queue())
|
||||
|
|
Loading…
Reference in a new issue