Skip to main content

Gather information about Sublime Text

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

sublime_info-0.2.0.zip (12.2 kB view details)

Uploaded Source

sublime_info-0.2.0.tar.gz (5.6 kB view details)

Uploaded Source

File details

Details for the file sublime_info-0.2.0.zip.

File metadata

  • Download URL: sublime_info-0.2.0.zip
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for sublime_info-0.2.0.zip
Algorithm Hash digest
SHA256 1a0f1bd27b8f64ff37a336f28e300cd9c8961f13b0feb07255a8ddcceb4c1493
MD5 e6978d3e4af152d00d1e9db740325a56
BLAKE2b-256 e4debdfb9a719990ad85c45c40db30bf3e2a186692c4b6d664ac8a044eea6398

See more details on using hashes here.

File details

Details for the file sublime_info-0.2.0.tar.gz.

File metadata

  • Download URL: sublime_info-0.2.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for sublime_info-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9f7ea1c1fccc52f02769629fd5a0d8dc984278633297630e5e326f324622c810
MD5 9fd36b81dc31ac916393ff67bc4b7d10
BLAKE2b-256 78f9230f0f95226682b38bd693a8b006c2ac0149aaead5c943e2f303ad05c956

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