mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-05 17:36:15 +00:00
Reformat entire project with ruff instead of black
This commit is contained in:
@ -21,6 +21,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import threading
|
||||
@ -163,7 +164,7 @@ class FFmpegAudio(AudioSource):
|
||||
stderr: Optional[IO[bytes]] = subprocess_kwargs.pop('stderr', None)
|
||||
|
||||
if stderr == subprocess.PIPE:
|
||||
warnings.warn("Passing subprocess.PIPE does nothing", DeprecationWarning, stacklevel=3)
|
||||
warnings.warn('Passing subprocess.PIPE does nothing', DeprecationWarning, stacklevel=3)
|
||||
stderr = None
|
||||
|
||||
piping_stderr = False
|
||||
@ -573,7 +574,7 @@ class FFmpegOpusAudio(FFmpegAudio):
|
||||
if isinstance(method, str):
|
||||
probefunc = getattr(cls, '_probe_codec_' + method, None)
|
||||
if probefunc is None:
|
||||
raise AttributeError(f"Invalid probe method {method!r}")
|
||||
raise AttributeError(f'Invalid probe method {method!r}')
|
||||
|
||||
if probefunc is cls._probe_codec_native:
|
||||
fallback = cls._probe_codec_fallback
|
||||
@ -603,9 +604,9 @@ class FFmpegOpusAudio(FFmpegAudio):
|
||||
except BaseException:
|
||||
_log.exception("Fallback probe using '%s' failed", executable)
|
||||
else:
|
||||
_log.debug("Fallback probe found codec=%s, bitrate=%s", codec, bitrate)
|
||||
_log.debug('Fallback probe found codec=%s, bitrate=%s', codec, bitrate)
|
||||
else:
|
||||
_log.debug("Probe found codec=%s, bitrate=%s", codec, bitrate)
|
||||
_log.debug('Probe found codec=%s, bitrate=%s', codec, bitrate)
|
||||
|
||||
return codec, bitrate
|
||||
|
||||
@ -634,11 +635,11 @@ class FFmpegOpusAudio(FFmpegAudio):
|
||||
output = out.decode('utf8')
|
||||
codec = bitrate = None
|
||||
|
||||
codec_match = re.search(r"Stream #0.*?Audio: (\w+)", output)
|
||||
codec_match = re.search(r'Stream #0.*?Audio: (\w+)', output)
|
||||
if codec_match:
|
||||
codec = codec_match.group(1)
|
||||
|
||||
br_match = re.search(r"(\d+) [kK]b/s", output)
|
||||
br_match = re.search(r'(\d+) [kK]b/s', output)
|
||||
if br_match:
|
||||
bitrate = max(int(br_match.group(1)), 512)
|
||||
|
||||
@ -825,7 +826,7 @@ class AudioPlayer(threading.Thread):
|
||||
try:
|
||||
asyncio.run_coroutine_threadsafe(self.client.ws.speak(speaking), self.client.client.loop)
|
||||
except Exception:
|
||||
_log.exception("Speaking call in player failed")
|
||||
_log.exception('Speaking call in player failed')
|
||||
|
||||
def send_silence(self, count: int = 5) -> None:
|
||||
try:
|
||||
|
Reference in New Issue
Block a user