Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Gather information about Sublime Text

Project Description

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.

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.

Release History

Release History

This version
History Node

0.2.0

History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

History Node

0.1.0

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
sublime_info-0.2.0.tar.gz (5.6 kB) Copy SHA256 Checksum SHA256 Source Dec 24, 2015
sublime_info-0.2.0.zip (12.2 kB) Copy SHA256 Checksum SHA256 Source Dec 24, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting