Skip to main content

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):
    1. User-supplied command (editor parameter)
    2. $VISUAL environment variable
    3. $EDITOR environment variable
    4. Platform-specific fallbacks:
      • NT: notepad
      • POSIX: nano, vi
  • Verifies that the editor executable exists on the system.
  • Canonicalizes the returned command as a list suitable for os.execvp() or subprocess calls.
  • 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


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

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file get_unicode_arguments_to_launch_editor-0.1.0a0.tar.gz.

File metadata

File hashes

Hashes for get_unicode_arguments_to_launch_editor-0.1.0a0.tar.gz
Algorithm Hash digest
SHA256 a96fe57a2737483741bf88141760f10ea9dabd4307fa2dc12a7659100600d9ad
MD5 6c82b413e67c14c9c62144df6daf10e7
BLAKE2b-256 481431a3205d21d894f4102ca060b7d8ed4a497059a09c880f42737441b93b28

See more details on using hashes here.

File details

Details for the file get_unicode_arguments_to_launch_editor-0.1.0a0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for get_unicode_arguments_to_launch_editor-0.1.0a0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9932ed15d31afbcf167cec7123e18599781ddf4137199ddbc9cecb3556acd548
MD5 82027a2b8f7d5251f3da073d518a5294
BLAKE2b-256 c08050be5ef48158b5aea0c06f1d99f2d7120c427f1432ef5bd8e97d95b1e136

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page