Skip to main content
Build Status

Gather information about Sublime Text

This was built for the Sublime plugin tests framework. It provides a cross-platform way to collect data about Sublime Text without running Sublime Text (necessary for creating a plugin harness to Sublime Text).

Currently, only Linux is supported but OSX and Windows support are planned.

Getting Started

Install the module with: pip install sublime_info

import sublime_info
sublime_info.get_sublime_path()  # /usr/bin/subl
sublime_info.get_sublime_version()  # 3083
sublime_info.get_package_directory()  # /home/todd/.config/sublime-text-2/Packages

Documentation

sublime_info provides 3 top level functions for your consumption.

get_sublime_path

sublime_info.get_sublime_path()
"""Resolve Sublime Text path (e.g. /usr/bin/subl)

If ``SUBLIME_TEXT_PATH`` is provided via environment variables, it will be used.
Otherwise, a ``which``-like resolution will be returned.

:raises STNotFoundError: If Sublime Text cannot be found, an error will be raised.
:returns: ``SUBLIME_TEXT_PATH`` or ``which``-like resolution
:rtype: str
"""

get_sublime_version

sublime_info.get_sublime_version()
"""Resolve Sublime Text version (e.g. 2221, 3083)

Sublime Text is resolved via ``get_sublime_path``

:raises Exception: If the Sublime Text version cannot be parsed, an error will be raised.
:returns: Version of Sublime Text returned by ``sublime_text --version``.
:rtype: int
"""

get_package_directory

sublime_info.get_package_directory()
"""Resolve Sublime Text package directory (e.g. /home/todd/.config/sublime-text-2/Packages)

:raises Exception: If the Sublime Text version is not recognized, an error will be raised.
:returns: Path to Sublime Text's package directory
:rtype: str
"""

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Test via ./test_linux.sh.

Donating

Support this project and others by twolfson via gittip.

Support via Gittip

Unlicense

As of Oct 14 2013, Todd Wolfson has released this repository and its contents to the public domain.

It has been released under the UNLICENSE.

Metadata

Release files for sublime_info 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distributions (sdists)

Source distribution for sublime_info 0.2.0
File Size Uploaded
sublime_info-0.2.0.zip 12.2 kB Details
sublime_info-0.2.0.tar.gz 5.6 kB Details

Release files / sublime_info-0.2.0.zip

Download URL sublime_info-0.2.0.zip
Size 12.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1a0f1bd27b8f64ff37a336f28e300cd9c8961f13b0feb07255a8ddcceb4c1493
BLAKE2b-256 checksum
How to use checksums
e4debdfb9a719990ad85c45c40db30bf3e2a186692c4b6d664ac8a044eea6398
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / sublime_info-0.2.0.tar.gz

Download URL sublime_info-0.2.0.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9f7ea1c1fccc52f02769629fd5a0d8dc984278633297630e5e326f324622c810
BLAKE2b-256 checksum
How to use checksums
78f9230f0f95226682b38bd693a8b006c2ac0149aaead5c943e2f303ad05c956
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page