Run lints through black

This commit is contained in:
Dpeta 2023-02-13 01:34:13 +01:00
parent 4ff69b300c
commit 7e782fd5b2
No known key found for this signature in database
GPG key ID: 51227517CEA0030C
6 changed files with 18 additions and 7 deletions

View file

@ -464,9 +464,11 @@ class PesterProfile:
PchumLog.exception("")
initials = self.initials()
if opchum.handle == reason:
return (
"<c=%s>%s</c> banned <c=%s>%s</c> from responding to memo."
% (opchum.colorhtml(), opinit, self.colorhtml(), initials)
return "<c=%s>%s</c> banned <c=%s>%s</c> from responding to memo." % (
opchum.colorhtml(),
opinit,
self.colorhtml(),
initials,
)
else:
return (

View file

@ -168,12 +168,14 @@ _ARGUMENTS = parser.parse_args()
try:
# PyQt6, QtMultimedia is prefered.
from PyQt6 import QtMultimedia
print("Audio module is PyQt6 QtMultimedia.")
except ImportError:
if ostools.isWin32() or ostools.isOSX():
# PyQt5 QtMultimedia has native backends for MacOS and Windows
try:
from PyQt5 import QtMultimedia
print(
"Using PyQt5 QtMultimedia as sound module. (fallback, PyQt6 QtMultimedia not availible)"
)
@ -194,12 +196,14 @@ except ImportError:
# PyQt5 QtMultimedia needs gstreamer on linux, so pygame is prefered.
try:
import pygame
print(
"Using pygame as sound module. (fallback, PyQt6 QtMultimedia not availible)"
)
except ImportError:
try:
from PyQt5 import QtMultimedia
print(
"Using PyQt5 QtMultimedia as sound module. (fallback, PyQt6 QtMultimedia and pygame not availible)"
)

View file

@ -49,7 +49,7 @@ class Lexeme:
raise NotImplementedError
#class Message(Lexeme):
# class Message(Lexeme):
# """An object designed to represent a message, possibly containing Lexeme
# objects in their native form as well. Intended to be a combination of a
# list and a string, combining the former with the latter's methods."""

View file

@ -30,6 +30,7 @@ def confExists():
except:
return False
def init(host="127.0.0.1", port=None):
if not port:
port = 9797

View file

@ -52,7 +52,9 @@ class ScriptQuirks:
try:
extension = self.getExtension()
except AttributeError:
PchumLog.exception("No self.getExtension(), does ScriptQuirks need to be subclassed?")
PchumLog.exception(
"No self.getExtension(), does ScriptQuirks need to be subclassed?"
)
return
filenames = []
if not os.path.exists(os.path.join(self.home, "quirks")):
@ -72,7 +74,9 @@ class ScriptQuirks:
try:
extension_length = len(self.getExtension())
except AttributeError:
PchumLog.exception("No self.getExtension(), does ScriptQuirks need to be subclassed?")
PchumLog.exception(
"No self.getExtension(), does ScriptQuirks need to be subclassed?"
)
return
name = os.path.basename(filename)[:-extension_length]
try:

View file

@ -202,7 +202,7 @@ class ToastMachine:
try:
pytwmn.init()
except Exception :
except Exception:
PchumLog.exception("Problem initilizing pytwmn.")
return
# self.type = type = "default"