Sublime Forum

Check-in/check-out system

#1

We use Dreamweaver on our WIndows workstations for PHP/Javascript development. We’re evaluating Sublime as a replacement, first on the Macs, and secondly possibly on the Windows machines too. However, one thing that we like is the check-in/check-out feature of Dreamweaver. It’s very simple; Dreamweaver simply places a .LCK file with the same filename on the server when you open a file and then removes it when you “check in.” The .LCK file contains the name of the person who is working on the file.

By the way: this isn’t our version control system (we already use Git and some other things for version control) but it’s a very simple way to avoid overwriting changes on small websites. Creating a branch and merging it back in is too cumbersome for a small website. The check-in/check-out system has worked fantastically for years for those small projects.

So I’d like to create a plugin for Sublime 2 that allows me to place the .LCK file on the server (via FTP) and remove it. I have some basic knowledge of Python and can learn it fairly quickly (I know many other programming languages quite fluently). I’d like some direction as to which hooks I will need to tap into and some ideas as to the best way to go about this.

If it works well for us, we’ll release it so others can use it as well. But I look forward to your thoughts.

Thanks in advance!

  • Jamon
0 Likes

#2

Anybody have somewhere to start? The API docs are pretty limited, so I’m not sure where to start.

  • Jamon
0 Likes

#3
  1. To upload and remove remote file via ftp you can use ftplib

  2. To check if file is already exists:
    sublime_plugin.EventListener -> on_load(view)

  3. To create nef file:
    sublime_plugin.WindowCommand -> new_file()

  4. And you can assign created command through “.sublime-keymap” settings file.

  5. So you just have to mix it all together.

0 Likes

#4

Thanks, ask! I’ll give it a whirl. :smile:

0 Likes

#5

Unfortunately, the ftp plugin won’t work totally. I don’t want to have to build a whole project file manager – instead, I’d like to hook into the existing one and perform additional functions. I’ll keep looking into it – thanks for the help though!

0 Likes

#6

You might be able to leverage the logic that reloads the file on change. I don’t know.

0 Likes

#7

Did you manage to write/find such plugin?

0 Likes

#8

I know, I’m a horrible person for digging up this thread. It is still relevant though, has anyone yet built such a plugin?

0 Likes