Skip to content

error with dctap init #111

@need47

Description

@need47

Hi,

I'm trying to use the dctap init command to initialize a config. I got the following error:

TypeError: init() missing 1 required positional argument: 'hidden'

I'm using click 8.1.8 (installed by dctap via pip install dctap)

$ pip show click
Name: click
Version: 8.1.8
Summary: Composable command line interface toolkit
Home-page: 
Author: 
Author-email: 
License: 
Location: /home/yux/.local/python-3.13.1/lib/python3.13/site-packages
Requires: 
Required-by: dctap

There might be two issues in the init() function:

@cli.command()
@click.help_option(help="Show help and exit")
@click.pass_context
def init(context, hidden):
    """Write config file: 'dctap.yaml'."""
    configfile = CONFIGFILE
    write_configfile(configfile)
  1. the hidden parameter is not used
  2. the call to write_configfile() does not match its sigature:
def write_configfile(
    nondefault_configyaml_str=None,
    default_configfile_name=CONFIGFILE,
    default_configyaml_str=CONFIGYAML,
):

So a fix to init() might be:

@cli.command()
@click.help_option(help="Show help and exit")
@click.pass_context
def init(context):
    """Write config file: 'dctap.yaml'."""
    configfile = CONFIGFILE
    write_configfile(default_configfile_name=configfile)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions