![]() |
Qucs-S S-parameter Viewer & RF Synthesis Tools
|


Public Member Functions | |
| __init__ (self, bool exists=False, bool file_okay=True, bool dir_okay=True, bool writable=False, bool readable=True, bool resolve_path=False, bool allow_dash=False, type[t.Any]|None path_type=None, bool executable=False) | |
| dict[str, t.Any] | to_info_dict (self) |
| str|bytes|os.PathLike[str] | coerce_path_result (self, str|os.PathLike[str] value) |
| str|bytes|os.PathLike[str] | convert (self, str|os.PathLike[str] value, Parameter|None param, Context|None ctx) |
| list[CompletionItem] | shell_complete (self, Context ctx, Parameter param, str incomplete) |
Public Member Functions inherited from click.types.ParamType | |
| t.Any | __call__ (self, t.Any value, Parameter|None param=None, Context|None ctx=None) |
| str|None | get_metavar (self, Parameter param, Context ctx) |
| str|None | get_missing_message (self, Parameter param, Context|None ctx) |
| cabc.Sequence[str] | split_envvar_value (self, str rv) |
| t.NoReturn | fail (self, str message, Parameter|None param=None, Context|None ctx=None) |
Public Attributes | |
| exists | |
| file_okay | |
| dir_okay | |
| readable | |
| writable | |
| executable | |
| resolve_path | |
| allow_dash | |
| type | |
| name | |
Public Attributes inherited from click.types.ParamType | |
| envvar_list_splitter | |
Static Public Attributes | |
| t | envvar_list_splitter = os.path.pathsep |
Static Public Attributes inherited from click.types.ParamType | |
| t | is_composite = False |
| t | arity = 1 |
| str | name |
| t | envvar_list_splitter = None |
The ``Path`` type is similar to the :class:`File` type, but
returns the filename instead of an open file. Various checks can be
enabled to validate the type of file and permissions.
:param exists: The file or directory needs to exist for the value to
be valid. If this is not set to ``True``, and the file does not
exist, then all further checks are silently skipped.
:param file_okay: Allow a file as a value.
:param dir_okay: Allow a directory as a value.
:param readable: if true, a readable check is performed.
:param writable: if true, a writable check is performed.
:param executable: if true, an executable check is performed.
:param resolve_path: Make the value absolute and resolve any
symlinks. A ``~`` is not expanded, as this is supposed to be
done by the shell only.
:param allow_dash: Allow a single dash as a value, which indicates
a standard stream (but does not open it). Use
:func:`~click.open_file` to handle opening this value.
:param path_type: Convert the incoming path value to this type. If
``None``, keep Python's default, which is ``str``. Useful to
convert to :class:`pathlib.Path`.
.. versionchanged:: 8.1
Added the ``executable`` parameter.
.. versionchanged:: 8.0
Allow passing ``path_type=pathlib.Path``.
.. versionchanged:: 6.0
Added the ``allow_dash`` parameter.
| str | bytes | os.PathLike[str] click.types.Path.convert | ( | self, | |
| str | os.PathLike[str] | value, | ||
| Parameter | None | param, | ||
| Context | None | ctx | ||
| ) |
Convert the value to the correct type. This is not called if
the value is ``None`` (the missing value).
This must accept string values from the command line, as well as
values that are already the correct type. It may also convert
other compatible types.
The ``param`` and ``ctx`` arguments may be ``None`` in certain
situations, such as when converting prompt input.
If the value cannot be converted, call :meth:`fail` with a
descriptive message.
:param value: The value to convert.
:param param: The parameter that is using this type to convert
its value. May be ``None``.
:param ctx: The current context that arrived at this value. May
be ``None``.
Reimplemented from click.types.ParamType.
| list[CompletionItem] click.types.Path.shell_complete | ( | self, | |
| Context | ctx, | ||
| Parameter | param, | ||
| str | incomplete | ||
| ) |
Return a special completion marker that tells the completion system to use the shell to provide path completions for only directories or any paths. :param ctx: Invocation context for this command. :param param: The parameter that is requesting completion. :param incomplete: Value being completed. May be empty. .. versionadded:: 8.0
Reimplemented from click.types.ParamType.
| dict[str, t.Any] click.types.Path.to_info_dict | ( | self | ) |
Gather information that could be useful for a tool generating user-facing documentation. Use :meth:`click.Context.to_info_dict` to traverse the entire CLI structure. .. versionadded:: 8.0
Reimplemented from click.types.ParamType.