Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new application context for files #2951

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

NoSuck
Copy link
Contributor

@NoSuck NoSuck commented Feb 20, 2024

ISSUE TYPE

  • Improvement/feature implementation

RUNTIME ENVIRONMENT

  • Operating system and version: Linux 6.6.8-100.fc38.x86_64 Test #1 SMP PREEMPT_DYNAMIC Thu Dec 21 04:01:45 UTC 2023 x86_64 GNU/Linux
  • Terminal emulator and version: XTerm(388)
  • Python version: Python 3.11.6
  • Ranger version/commit: 136416c ← Is this not a redundant question to ask?
  • Locale: ja_JP.utf8

CHECKLIST

  • The CONTRIBUTING document has been read [REQUIRED]
  • All changes follow the code style [REQUIRED]
  • All new and existing tests pass [REQUIRED]
  • Changes require config files to be updated
    • Config files have been updated
  • Changes require documentation to be updated
    • Documentation has been updated
  • Changes require tests to be updated
    • Tests have been updated

DESCRIPTION

This adds an “application” context for file MIME types, joining the likes of “audio”, “video”, etc--because I found it useful and hope that others might, too. Example MIME types this covers:

⋅ application/json
⋅ application/x-bytecode.python
⋅ application/x-object

This also changes MIME checks to be more watertight/pedantic, because “textiles” are not the same thing as “text”.

MOTIVATION AND CONTEXT

Differentiation of files based on type helps aid in navigation.

TESTING

⬛ add-new-application-context make test_py
Running pylint...
pylint ./ranger/api ./ranger/colorschemes ./ranger/container ./ranger/core ./ranger/ext ./ranger/gui ./ranger/__init__.py ./doc/tools/performance_test.py ./doc/tools/print_colors.py ./doc/tools/print_keys.py ./doc/tools/convert_papermode_to_metadata.py ./examples/plugin_avfs.py ./examples/plugin_chmod_keybindings.py ./examples/plugin_fasd_add.py ./examples/plugin_file_filter.py ./examples/plugin_hello_world.py ./examples/plugin_linemode.py ./examples/plugin_new_macro.py ./examples/plugin_new_sorting_method.py ./examples/plugin_pmount.py ./examples/plugin_pmount_dynamic.py ./examples/plugin_ipc.py ./ranger.py ./setup.py ./tests

--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)

pylint --rcfile=./ranger/config/.pylintrc ./ranger/config

--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)

Running flake8...
flake8 ./ranger/api ./ranger/colorschemes ./ranger/container ./ranger/core ./ranger/ext ./ranger/gui ./ranger/__init__.py ./doc/tools/performance_test.py ./doc/tools/print_colors.py ./doc/tools/print_keys.py ./doc/tools/convert_papermode_to_metadata.py ./examples/plugin_avfs.py ./examples/plugin_chmod_keybindings.py ./examples/plugin_fasd_add.py ./examples/plugin_file_filter.py ./examples/plugin_hello_world.py ./examples/plugin_linemode.py ./examples/plugin_new_macro.py ./examples/plugin_new_sorting_method.py ./examples/plugin_pmount.py ./examples/plugin_pmount_dynamic.py ./examples/plugin_ipc.py ./ranger.py ./setup.py ./tests ./ranger/config

Running doctests...
Testing ranger/api/commands.py...
Testing ranger/ext/direction.py...
Testing ranger/ext/iter_tools.py...
Testing ranger/ext/lazy_property.py...
Testing ranger/ext/macrodict.py...
Testing ranger/ext/human_readable.py...
Testing ranger/ext/keybinding_parser.py...
Testing ranger/ext/rifle.py...
Testing ranger/ext/signals.py...
Testing ranger/ext/widestring.py...
Testing ranger/gui/ansi.py...
Testing ranger/gui/widgets/console.py...

Running py.test tests...
py.test tests
=============================================== test session starts ================================================
platform linux -- Python 3.11.6, pytest-7.2.2, pluggy-1.0.0
rootdir: /home/user/.local/git/ranger
plugins: anyio-3.5.0
collected 15 items

tests/pylint/test_py2_compat.py ........                                                                     [ 53%]
tests/ranger/container/test_bookmarks.py ..                                                                  [ 66%]
tests/ranger/container/test_container.py ..                                                                  [ 80%]
tests/ranger/container/test_fsobject.py ..                                                                   [ 93%]
tests/ranger/core/test_main.py .                                                                             [100%]

================================================ 15 passed in 0.36s ================================================

Checking completeness of man page...

Finished python and documentation tests!

This adds an “application” context for file MIME types, joining the likes of “audio”, “video”, etc--because I found it useful and hope that others might, too.  Example MIME types this covers:

⋅ application/json
⋅ application/x-bytecode.python
⋅ application/x-object

This also changes MIME checks to be more watertight/pedantic, because “textiles” are not the same thing as “text”.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant