Skip to content

Add method to know if you are in a script #779

@kmvanbrunt

Description

@kmvanbrunt

I frequently use command finalization hooks to print something just before returning to the prompt. I don't want the output to occur after each command running in a Python or text script though.

Currently I do the following to know if I'm in a script:

if self._in_py or self._current_script_dir is not None:
    # In script

It would be better to provide developers with a method so they don't have to reference protected members.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions