Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/artnc/sublime-file-locking

File locking plugin for Sublime Text
https://github.com/artnc/sublime-file-locking

sublime-text

Last synced: about 1 month ago
JSON representation

File locking plugin for Sublime Text

Awesome Lists containing this project

README

        

Sublime Text 2 File Locking
====================

This is a quick plugin I wrote for a team project I'm working on that's contained entirely in a shared Dropbox folder.

Files are locked when opened and unlocked when closed. Due to the lack of a listener in the API for detecting operations that read files but don't actually open an editing buffer (e.g. file previews), this plugin works best when those features are avoided. Otherwise you'll run into issues with files that are locked even though nobody's editing them.

Use at your own risk and hack as needed. Released under the MIT license.

Getting started
---------------
1. Have all team members go to "Tools > New Plugin..." and paste in the contents of FileLocking.py.
2. In the "Settings" block, all members must set the 'project' and 'lockext' variables to the same string. The 'me' variable may optionally be given a custom value per member (the default value is the name of the currently logged in user).
3. Have everyone save the plugin file to the default Packages/User directory, ideally in unison.
4. Add viewlocks.py to the project's root directory.

Viewing locks
------------
Display all currently existing locks, their owners, and their creation times:

python viewlocks.py

Display all locks set by the team member who has their 'me' variable set to 'john':

python viewlocks.py john

Manually remove all locks set by john:

python viewlocks.py john -r