Skip to content

Commit

Permalink
Fix all linting in view/mix
Browse files Browse the repository at this point in the history
  • Loading branch information
JOJ0 committed Nov 2, 2024
1 parent da355b8 commit 2adc908
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion discodos/view/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ def duration_stats(self, start_time, msg):
log.info('CTRLS: {}'.format(msg_took))
print(msg_took)

def edit_ask_details(self, orig_data, edit_questions):
def edit_ask_details(self, orig_data, edit_questions): # pylint: disable=R0912,R0915
# collect answers from user input
answers = {}
for db_field, question in edit_questions:
Expand Down
28 changes: 14 additions & 14 deletions discodos/view/mix.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

log = logging.getLogger('discodos')

class MixViewCommon():
class MixViewCommon(ViewCommonCommandline):
''' Constants and utils used for viewing Mixes. Usable in CLI and GUI.
Lists of questions. Used in CLI:
Expand Down Expand Up @@ -36,8 +36,8 @@ def __init__(self):
def shorten_mixes_timestamps(self, mixes):
''' Reformats timestamps in a list of mixes.
Argument mixes, usually an sqlite tuples list, will be translated into a
list of mutable dicts. If it's one already, it's done anyway.
Argument mixes, usually an sqlite tuples list, will be translated into
a list of mutable dicts. If it's one already, it's done anyway.
'''
mixes = [dict(row) for row in mixes]
for i, mix in enumerate(mixes):
Expand All @@ -59,8 +59,8 @@ def shorten_mixes_timestamps(self, mixes):
class MixViewCommandline(MixViewCommon, ViewCommonCommandline, ViewCommon):
""" Viewing mixes outputs on CLI.
"""
def __init__(self):
super(MixViewCommandline, self).__init__()
def __init__(self): # pylint: disable=useless-parent-delegation
super().__init__()

def tab_mixes_list(self, mixes_data):
mixes_short_timestamps = self.shorten_mixes_timestamps(mixes_data)
Expand All @@ -80,25 +80,25 @@ def tab_mix_info_header(self, mix_info):

def really_add_track(self, track_to_add, release_name, mix_id, pos):
_answ = self.ask(
'Add "{}" on "{}" to mix #{}, at position {}? (Y/n) '.format(
track_to_add.upper(),
release_name,
int(mix_id), pos)
f'Add "{track_to_add.upper()}" on "{release_name}" to '
f'mix #{mix_id}, at position {pos}? (Y/n) '
)
if _answ.lower() == "y" or _answ == "":
return True
return False

def really_delete_track(self, track_pos, mix_name):
really_del = self.ask('Delete Track {} from mix "{}"? (y/N) '.format(
track_pos, mix_name))
really_del = self.ask(f'Delete Track {track_pos} '
f'from mix "{mix_name}"? (y/N) ')
if really_del.lower() == "y":
return True
return False

def really_delete_mix(self, mix_id, mix_name):
really_delete = self.ask(
'Are you sure you want to delete mix "{} - {}" and all its containing tracks? '.format(
mix_id, mix_name))
f'Are you sure you want to delete mix "{mix_id} - {mix_name} "'
'and all its containing tracks?'
)
if really_delete.lower() == "y":
return True
return False
return False

0 comments on commit 2adc908

Please sign in to comment.