Support multiple paths and filepaths #21

Open
opened 2025-09-27 23:58:28 +02:00 by maciek · 1 comment
Contributor
  • potodo currently doesn't support providing multiple paths to calculate completion
    potodo will take always the last path into account -- in the example below it analyzes only tutorial path ignoring the library path
% uvx potodo -p library -p tutorial


# tutorial (98.24% done)

- appendix.po                     27 /  28 ( 96.0% translated).
- classes.po                     148 / 149 ( 99.0% translated).
- controlflow.po                 220 / 226 ( 97.0% translated).
- datastructures.po              121 / 125 ( 96.0% translated).
- errors.po                       94 /  96 ( 97.0% translated).
- index.po                         7 /   9 ( 77.0% translated).
- interactive.po                   6 /   7 ( 85.0% translated).
- introduction.po                116 / 120 ( 96.0% translated).
- modules.po                     115 / 117 ( 98.0% translated).


# TOTAL (98.24% done)
  • potodo doesn't support paths to files
    potodo breaks with NotADirectoryError while trying to read a cache, when invoked with a filepath, example:
% uvx potodo -p bugs.po            
Traceback (most recent call last):
  File "bin/potodo", line 12, in <module>
    sys.exit(main())
             ~~~~^^
  File "lib/python3.13/site-packages/potodo/potodo.py", line 182, in main
    po_project = scan_path(
        args.path, args.no_cache, args.hide_reserved, args.api_url
    )
  File "lib/python3.13/site-packages/potodo/potodo.py", line 30, in scan_path
    po_project.read_cache()
    ~~~~~~~~~~~~~~~~~~~~~^^
  File "lib/python3.13/site-packages/potodo/po_file.py", line 233, in read_cache
    with open(cache_path, "rb") as handle:
         ~~~~^^^^^^^^^^^^^^^^^^
NotADirectoryError: [Errno 20] Not a directory: 'python-docs-pl/bugs.po/.potodo/cache.pickle'

I would expect it to print something similar to as follows:

% uvx potodo -p bugs.po --show-finished

- bugs.po                         31 /  31 (100.0% translated).

# TOTAL (100.00% done)

With two above features we would be able to track PEP 545 requirements with a single potodo invocation:

% potodo -p bugs.po -p tutorial -p library/functions.po
* potodo currently doesn't support providing multiple paths to calculate completion potodo will take always the last path into account -- in the example below it analyzes only `tutorial` path ignoring the `library` path ```zsh % uvx potodo -p library -p tutorial # tutorial (98.24% done) - appendix.po 27 / 28 ( 96.0% translated). - classes.po 148 / 149 ( 99.0% translated). - controlflow.po 220 / 226 ( 97.0% translated). - datastructures.po 121 / 125 ( 96.0% translated). - errors.po 94 / 96 ( 97.0% translated). - index.po 7 / 9 ( 77.0% translated). - interactive.po 6 / 7 ( 85.0% translated). - introduction.po 116 / 120 ( 96.0% translated). - modules.po 115 / 117 ( 98.0% translated). # TOTAL (98.24% done) ``` * potodo doesn't support paths to files potodo breaks with `NotADirectoryError` while trying to read a cache, when invoked with a filepath, example: ```zsh % uvx potodo -p bugs.po Traceback (most recent call last): File "bin/potodo", line 12, in <module> sys.exit(main()) ~~~~^^ File "lib/python3.13/site-packages/potodo/potodo.py", line 182, in main po_project = scan_path( args.path, args.no_cache, args.hide_reserved, args.api_url ) File "lib/python3.13/site-packages/potodo/potodo.py", line 30, in scan_path po_project.read_cache() ~~~~~~~~~~~~~~~~~~~~~^^ File "lib/python3.13/site-packages/potodo/po_file.py", line 233, in read_cache with open(cache_path, "rb") as handle: ~~~~^^^^^^^^^^^^^^^^^^ NotADirectoryError: [Errno 20] Not a directory: 'python-docs-pl/bugs.po/.potodo/cache.pickle' ``` I would expect it to print something similar to as follows: ```zsh % uvx potodo -p bugs.po --show-finished - bugs.po 31 / 31 (100.0% translated). # TOTAL (100.00% done) ``` With two above features we would be able to track PEP 545 requirements with a single potodo invocation: ```zsh % potodo -p bugs.po -p tutorial -p library/functions.po ```
Owner

So, multiple path is done:

$ potodo whatsnew/ using/
2 directories  10.24% done
├── using/  34.47% done
│   ├── android.po                         0.0% translated    0/27
│   ├── cmdline.po                        64.0% translated 165/256, 45 fuzzy
│   ├── configure.po                      17.0% translated  76/423, 25 fuzzy
│   ├── editors.po                        66.0% translated     4/6
│   ├── ios.po                             0.0% translated    0/86
│   ├── mac.po                             8.0% translated    7/87, 11 fuzzy
│   ├── unix.po                           87.0% translated   43/49,  2 fuzzy
│   └── windows.po                        51.0% translated 253/494, 47 fuzzy
└── whatsnew/  7.50% done
    ├── 2.0.po                            28.0% translated  53/183,  7 fuzzy
    ├── 2.1.po                            17.0% translated  24/139,  6 fuzzy
    ├── 2.2.po                             8.0% translated  17/191,  3 fuzzy
    ├── 2.3.po                             4.0% translated  15/324,  4 fuzzy
    ├── 2.4.po                             6.0% translated  18/266,  4 fuzzy
    ├── 2.5.po                            12.0% translated  49/386, 12 fuzzy
    ├── 2.6.po                             6.0% translated  38/545,  5 fuzzy
    ├── 2.7.po                             3.0% translated  14/453,  3 fuzzy
    ├── 3.0.po                             6.0% translated  13/205
    ├── 3.1.po                            28.0% translated  33/114,  1 fuzzy
    ├── 3.10.po                           79.0% translated 404/506, 85 fuzzy
    ├── 3.11.po                           14.0% translated 112/756, 25 fuzzy
    ├── 3.12.po                            8.0% translated  73/853
    ├── 3.13.po                            6.0% translated  63/921
    ├── 3.14.po                            5.0% translated 60/1017
    ├── 3.2.po                            16.0% translated  84/518,  8 fuzzy
    ├── 3.3.po                            18.0% translated 122/660, 37 fuzzy
    ├── 3.4.po                            13.0% translated  71/510,  1 fuzzy
    ├── 3.5.po                            18.0% translated  98/541,  7 fuzzy
    ├── 3.6.po                            12.0% translated  66/524, 10 fuzzy
    ├── 3.7.po                            12.0% translated  72/563,  9 fuzzy
    ├── 3.8.po                            14.0% translated  66/469, 22 fuzzy
    └── 3.9.po                            78.0% translated 291/372, 66 fuzzy

but multiple files is not.

So, multiple path is done: ```bash $ potodo whatsnew/ using/ 2 directories 10.24% done ├── using/ 34.47% done │ ├── android.po 0.0% translated 0/27 │ ├── cmdline.po 64.0% translated 165/256, 45 fuzzy │ ├── configure.po 17.0% translated 76/423, 25 fuzzy │ ├── editors.po 66.0% translated 4/6 │ ├── ios.po 0.0% translated 0/86 │ ├── mac.po 8.0% translated 7/87, 11 fuzzy │ ├── unix.po 87.0% translated 43/49, 2 fuzzy │ └── windows.po 51.0% translated 253/494, 47 fuzzy └── whatsnew/ 7.50% done ├── 2.0.po 28.0% translated 53/183, 7 fuzzy ├── 2.1.po 17.0% translated 24/139, 6 fuzzy ├── 2.2.po 8.0% translated 17/191, 3 fuzzy ├── 2.3.po 4.0% translated 15/324, 4 fuzzy ├── 2.4.po 6.0% translated 18/266, 4 fuzzy ├── 2.5.po 12.0% translated 49/386, 12 fuzzy ├── 2.6.po 6.0% translated 38/545, 5 fuzzy ├── 2.7.po 3.0% translated 14/453, 3 fuzzy ├── 3.0.po 6.0% translated 13/205 ├── 3.1.po 28.0% translated 33/114, 1 fuzzy ├── 3.10.po 79.0% translated 404/506, 85 fuzzy ├── 3.11.po 14.0% translated 112/756, 25 fuzzy ├── 3.12.po 8.0% translated 73/853 ├── 3.13.po 6.0% translated 63/921 ├── 3.14.po 5.0% translated 60/1017 ├── 3.2.po 16.0% translated 84/518, 8 fuzzy ├── 3.3.po 18.0% translated 122/660, 37 fuzzy ├── 3.4.po 13.0% translated 71/510, 1 fuzzy ├── 3.5.po 18.0% translated 98/541, 7 fuzzy ├── 3.6.po 12.0% translated 66/524, 10 fuzzy ├── 3.7.po 12.0% translated 72/563, 9 fuzzy ├── 3.8.po 14.0% translated 66/469, 22 fuzzy └── 3.9.po 78.0% translated 291/372, 66 fuzzy ``` but multiple files is not.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AFPy/potodo#21
No description provided.