Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
thombashi committed Sep 17, 2023
1 parent b95d706 commit 6161773
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/pages/examples/argparse_validator.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
filename: eg
$ ./examples/argparse_validate.py --filename e?g
usage: argparse_validate.py [-h] [--filename FILENAME] [--filepath FILEPATH]
argparse_validate.py: error: argument --filename: [PV1100] invalid characters found: invalids=(':'), value='e:g', target-platform=Windows
argparse_validate.py: error: argument --filename: [PV1100] invalid characters found: invalids=(':'), value='e:g', platform=Windows

.. note::
``validate_filepath_arg`` consider ``platform`` as of ``"auto"`` if the input is an absolute file path.
2 changes: 1 addition & 1 deletion docs/pages/examples/click_validator.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
Usage: click_validate.py [OPTIONS]
Try 'click_validate.py --help' for help.

Error: Invalid value for '--filename': [PV1100] invalid characters found: invalids=('?'), value='e?g', target-platform=Windows
Error: Invalid value for '--filename': [PV1100] invalid characters found: invalids=('?'), value='e?g', platform=Windows
4 changes: 2 additions & 2 deletions docs/pages/examples/validate_filename_code.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
:Output:
.. code-block:: none

[PV1100] invalid characters found: target-platform=universal, description=invalids=('/'), value='fi:l*e/p"a?t>h|.t<xt'
[PV1100] invalid characters found: platform=universal, description=invalids=('/'), value='fi:l*e/p"a?t>h|.t<xt'

[PV1002] found a reserved name by a platform: 'COM1' is a reserved name, target-platform=universal, reusable_name=False
[PV1002] found a reserved name by a platform: 'COM1' is a reserved name, platform=universal, reusable_name=False
2 changes: 1 addition & 1 deletion docs/pages/examples/validate_filepath_code.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
:Output:
.. code-block:: none

[PV1100] invalid characters found: invalids=(':', '*', '"', '?', '>', '|', '<'), value='fi:l*e/p"a?t>h|.t<xt', target-platform=Windows
[PV1100] invalid characters found: invalids=(':', '*', '"', '?', '>', '|', '<'), value='fi:l*e/p"a?t>h|.t<xt', platform=Windows
13 changes: 11 additions & 2 deletions docs/pages/introduction/feature.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@ Features
- Sanitize/Validate a string as a:
- file name
- file path
- file name/path argument validator/sanitizer for ``argparse`` and ``click``
- Sanitize will do:
- Remove invalid characters for a target platform
- Replace reserved names for a target platform
- Normalize
- Remove unprintable characters
- Argument validator/sanitizer for ``argparse`` and ``click``
- Multi platform support:
- sanitize/validate file names/paths for a specific platform (``Linux``/``Windows``/``macOS``/``POSIX``) or ``universal`` (platform independent)
- ``Linux``
- ``Windows``
- ``macOS``
- ``POSIX``
- ``universal`` (platform independent)
- Multibyte character support
19 changes: 19 additions & 0 deletions docs/pages/reference/handler.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Handlers
---------------

Reserved name handlers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: pathvalidate.handler.ReservedNameHandler
:members:

Null value handlers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: pathvalidate.handler.NullValueHandler
:members:

Other handlers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autofunction:: pathvalidate.handler.raise_error
1 change: 1 addition & 0 deletions docs/pages/reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ Reference
error
function
types
handler

0 comments on commit 6161773

Please sign in to comment.