Skip to content

Commit

Permalink
DebugOpt.name -> optname
Browse files Browse the repository at this point in the history
  • Loading branch information
zas committed Apr 8, 2024
1 parent 75f3f64 commit 269cb2a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions picard/debug_opts.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class DebugOpt(IntEnum):
WS_REPLIES = 1

@property
def name(self):
return _debug_opts_descriptions[self].name
def optname(self):
return _debug_opts_descriptions[self].optname

@property
def title(self):
Expand All @@ -49,11 +49,11 @@ def enabled(self, enable):
_debug_opts.remove(self)


DebugOptDesc = namedtuple('DebugOptDesc', ('name', 'title', 'description'))
DebugOptDesc = namedtuple('DebugOptDesc', ('optname', 'title', 'description'))

_debug_opts_descriptions = {
DebugOpt.WS_REPLIES: DebugOptDesc(
name='ws_replies',
optname='ws_replies',
title=N_('WS Replies'),
description=N_('Log web service replies'),
),
Expand All @@ -65,12 +65,12 @@ def enabled(self, enable):

def debug_opts_names():
"""Returns a sorted list of all valid names for debug options"""
return sorted(o.name for o in DebugOpt)
return sorted(o.optname for o in DebugOpt)


def parse_command_line_debug_opts(string):
"""Parse command line argument, a string with comma-separated values,
and enable corresponding debug options"""
opts = {str(o).strip().lower() for o in string.split(',')}
for o in DebugOpt:
o.enabled = o.name in opts
o.enabled = o.optname in opts

0 comments on commit 269cb2a

Please sign in to comment.