A cross-platform Python utility that gets Unicode arguments to launch an EDITOR, using user input, environment variables, and platform-specific fallbacks.
Project description
get-unicode-arguments-to-launch-editor
A cross-platform Python utility that gets Unicode arguments to launch an EDITOR, using user input, environment variables, and platform-specific fallbacks.
Features
- Gets arguments to launch an EDITOR using (in order of precedence):
- User-supplied command (
editorparameter) $VISUALenvironment variable$EDITORenvironment variable- Platform-specific fallbacks:
- NT:
notepad - POSIX:
nano,vi
- NT:
- User-supplied command (
- Verifies that the editor executable exists on the system.
- Canonicalizes the returned command as a list suitable for
os.execvp()orsubprocesscalls. - Command-line splitting and executable resolution is platform-aware.
Installation
pip install get-unicode-arguments-to-launch-editor
Usage
# coding=utf-8
from __future__ import print_function
from get_unicode_arguments_to_launch_editor import get_unicode_arguments_to_launch_editor
# Example output on Linux:
# [u'/usr/bin/nano']
print(get_unicode_arguments_to_launch_editor())
# Example output on Linux:
# [u'/usr/bin/vim.basic', u'-R']
print(get_unicode_arguments_to_launch_editor(u'vim -R'))
Contributing
Contributions welcome! Please open issues or pull requests on GitHub.
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file get_unicode_arguments_to_launch_editor-0.1.0a0.tar.gz.
File metadata
- Download URL: get_unicode_arguments_to_launch_editor-0.1.0a0.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a96fe57a2737483741bf88141760f10ea9dabd4307fa2dc12a7659100600d9ad
|
|
| MD5 |
6c82b413e67c14c9c62144df6daf10e7
|
|
| BLAKE2b-256 |
481431a3205d21d894f4102ca060b7d8ed4a497059a09c880f42737441b93b28
|
File details
Details for the file get_unicode_arguments_to_launch_editor-0.1.0a0-py2.py3-none-any.whl.
File metadata
- Download URL: get_unicode_arguments_to_launch_editor-0.1.0a0-py2.py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9932ed15d31afbcf167cec7123e18599781ddf4137199ddbc9cecb3556acd548
|
|
| MD5 |
82027a2b8f7d5251f3da073d518a5294
|
|
| BLAKE2b-256 |
c08050be5ef48158b5aea0c06f1d99f2d7120c427f1432ef5bd8e97d95b1e136
|