Home Download Buy Blog Forum Support

Check-in/check-out system

Check-in/check-out system

Postby jamonholmgren on Tue Nov 01, 2011 4:52 pm

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
jamonholmgren
 
Posts: 7
Joined: Tue Nov 01, 2011 4:01 pm

Re: Check-in/check-out system

Postby jamonholmgren on Sun Nov 06, 2011 8:45 pm

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

- Jamon
jamonholmgren
 
Posts: 7
Joined: Tue Nov 01, 2011 4:01 pm

Re: Check-in/check-out system

Postby ask on Sun Nov 06, 2011 9:24 pm

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.
ask
 
Posts: 26
Joined: Wed Sep 14, 2011 12:40 pm

Re: Check-in/check-out system

Postby jamonholmgren on Mon Nov 14, 2011 5:06 pm

Thanks, ask! I'll give it a whirl. :)
jamonholmgren
 
Posts: 7
Joined: Tue Nov 01, 2011 4:01 pm

Re: Check-in/check-out system

Postby jamonholmgren on Mon Nov 14, 2011 5:46 pm

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!
jamonholmgren
 
Posts: 7
Joined: Tue Nov 01, 2011 4:01 pm

Re: Check-in/check-out system

Postby slestak989 on Mon Nov 14, 2011 7:23 pm

You might be able to leverage the logic that reloads the file on change. I don't know.
Using ST2 on: Win7 Pro 64 || Win7 32|| Fedora 16
slestak989
 
Posts: 31
Joined: Tue Oct 04, 2011 3:40 am

Re: Check-in/check-out system

Postby hoomanb on Fri Sep 07, 2012 4:58 pm

Did you manage to write/find such plugin?
hoomanb
 
Posts: 1
Joined: Fri Sep 07, 2012 4:58 pm

Re: Check-in/check-out system

Postby RobinKanters on Wed Dec 05, 2012 8:56 pm

I know, I'm a horrible person for digging up this thread. It is still relevant though, has anyone yet built such a plugin?
RobinKanters
 
Posts: 1
Joined: Wed Dec 05, 2012 8:55 pm


Return to Plugin Development

Who is online

Users browsing this forum: Google [Bot] and 4 guests