Commit Graph
29 Commits
Author SHA1 Message Date
Šarūnas Nejus 6241139600 typing: define explicit optparse.Values for each command 2026-08-19 23:57:05 +01:00
Šarūnas Nejus 14eabc6060 typing: add types to command handlers 2026-08-19 23:57:01 +01:00
Sebastian Mohr 54a2bd20e1 Removed This file is part of beets... headers. 2026-06-29 11:20:15 +02:00
Aidan Epstein db4f30b230 Cast keys to list to avoid exception in optparse
In #6695, the Item and Album all_keys methods return sets now. This
causes an error when used in optparse for choices as it doesn't accept
sets:
Traceback (most recent call last):
  File "/home/user/.local/bin/beet", line 10, in <module>
    sys.exit(main())
             ~~~~^^
  File "/home/user/.local/lib/beets/beets/ui/__init__.py", line 964, in main
    _raw_main(args)
    ~~~~~~~~~^^^^^^
  File "/home/user/.local/lib/beets/beets/ui/__init__.py", line 940, in _raw_main
    subcommands, lib = _setup(options)
                       ~~~~~~^^^^^^^^^
  File "/home/user/.local/lib/beets/beets/ui/__init__.py", line 781, in _setup
    subcommands.extend(plugins.commands())
                       ~~~~~~~~~~~~~~~~^^
  File "/home/user/.local/lib/beets/beets/plugins.py", line 508, in commands
    out += plugin.commands()
           ~~~~~~~~~~~~~~~^^
  File "/home/user/.local/lib/beets/beetsplug/fish.py", line 80, in commands
    cmd.parser.add_option(
    ~~~~~~~~~~~~~~~~~~~~~^
        "-e",
        ^^^^^
    ...<4 lines>...
        help="include specified field *values* in completions",
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/lib/python3.14/optparse.py", line 990, in add_option
    option = self.option_class(*args, **kwargs)
  File "/usr/lib/python3.14/optparse.py", line 571, in __init__
    checker(self)
    ~~~~~~~^^^^^^
  File "/usr/lib/python3.14/optparse.py", line 658, in _check_choice
    raise OptionError(
        "choices must be a list of strings ('%s' supplied)"
        % str(type(self.choices)).split("'")[1], self)
optparse.OptionError: option -e/--extravalues: choices must be a list of strings ('set' supplied)
2026-06-11 01:03:13 +01:00
Šarūnas Nejus d53ee774a9 Enable and fix flake8-return 2026-06-09 00:14:06 +01:00
Šarūnas Nejus d62e0952c0 Return KeysView from every keys method 2026-06-06 06:53:25 +01:00
Sebastian Mohr adfb73b66d Run ruff format 2026-05-20 16:53:06 +02:00
Konstantin b64bda86ff try to fix fish plugin 2026-03-08 13:57:42 +01:00
Šarūnas Nejus a8d53f78de Fix the rest of the tests 2026-02-27 18:34:26 +00:00
Rebecca Turner 958b36b298 fish: complete files in more places 2026-01-20 13:07:03 -08:00
Šarūnas Nejus 1c16b2b308 Replace string concatenation (' + ')
- Join hardcoded strings
- Replace concatenated variables with f-strings
2025-08-30 23:10:15 +01:00
Šarūnas Nejus 4a361bd501 Replace format calls with f-strings 2025-08-30 18:42:26 +01:00
Šarūnas Nejus 85a17ee503 Reformat the codebase 2024-09-21 11:57:48 +01:00
Serene-Arc a6e5201ff3 Apply formatting tools to all files
This is 'the big one', which touches every file so that it all conforms
to the given standard.
2023-10-22 09:53:18 +10:00
Adrian Sampson 5f45e9e108 Tiny wording tweaks for #4281 2022-02-16 16:34:38 -05:00
Jaime Marquínez Ferrándiz fedb8b0b8f fish plugin: Assign the default output path to the option instead of using None 2022-02-16 21:42:08 +01:00
Jaime Marquínez Ferrándiz b46b4d2045 fish plugin: Simplify directory creation 2022-02-16 21:34:24 +01:00
Jaime Marquínez Ferrándiz 40fcb25221 fish plugin: Split long line 2022-02-16 08:15:30 +01:00
Jaime Marquínez Ferrándiz 8e5156d01c fish plugin: Add --output option 2022-02-15 23:11:30 +01:00
Andrew Rogl 1ec87a3bdd pyupgrade beetsplug and tests
All tests working
More tidy up to be done
2021-08-26 19:12:51 +10:00
Aksh Gupta 79858975a9 chore: refactor code quality issues 2021-03-11 08:45:42 +05:30
Billy Janitsch c94809f6da Fix escape helper in fish completion plugin 2020-12-16 02:15:26 -05:00
Benedikt Tissot 020c082f3f make CI happy 2020-11-09 17:12:44 +01:00
Benedikt Tissot 57a1b3aca8 escape using helper function 2020-11-09 17:07:00 +01:00
Benedikt Tissot 8f8fd4231a escape ? in fish completion 2020-11-09 15:55:21 +01:00
Justin Mayer f465c90e78 Enforce PEP-8 compliance on Fish completion plugin 2020-03-04 07:15:46 +01:00
Justin Mayer 05db0d18eb Don't escape question marks in Fish completions
Fish shell previously interpreted question marks as glob characters, but
that behavior has been deprecated and will soon be removed. Plus, the
completion for `help` and its alias `?` does not currently seem to behave
as expected anyway and is thus, at present, of limited utility.
2020-03-04 07:15:46 +01:00
Justin Mayer 82c3867fc0 Rewrite Fish completion plugin docs & code comments 2020-03-04 07:15:46 +01:00
jmwatte d2d2b646c1 Add plugin for Fish shell tab completion 2020-03-02 09:51:36 +01:00