Home Download Buy Blog Forum Support

def on_project_load

def on_project_load

Postby feincode on Mon Apr 15, 2013 4:54 pm

Hi folks,

I am trying to develop a plugin for sublime text 2. I want to use the onProjectLoad event (I think now it is the on_project_load event)

But I cant get it. The documentation I have found is out of date?

Here one of my tries:

Code: Select all
import sublime, sublime_plugin
from pprint import pprint


class CreateCompassProjectCommand(sublime_plugin.WindowCommand):
   def run(self):
      print dir(self)

    def on_project_load(window):
       print "hi"
       print window.project().fileName()


What I have to do? Sorry, if it is obvious, but I cant find it!
feincode
 
Posts: 2
Joined: Mon Apr 15, 2013 4:43 pm

Re: def on_project_load

Postby sapphirehamster on Tue Apr 16, 2013 8:08 pm

I don't see any way to catch an event when a project is loaded in the docs:
http://www.sublimetext.com/docs/2/api_reference.html
or for ST3:
http://www.sublimetext.com/docs/3/api_reference.html

(It looks like you were looking at the docs for ST1.)
sapphirehamster
 
Posts: 90
Joined: Sun Jul 01, 2012 11:19 pm

Re: def on_project_load

Postby feincode on Wed Apr 17, 2013 6:55 am

Me too, but I found it on this page:

http://www.sublimetext.com/docs/api-reference

is this for ST1? So there is no possibility for checking the onProjectLoad event? So I have to use one which will be fired more often.

Thanks
feincode
 
Posts: 2
Joined: Mon Apr 15, 2013 4:43 pm

Re: def on_project_load

Postby NeilJ on Sat May 18, 2013 5:02 pm

I would also be interested if there was a way a plugin can detect that a project is/has being loaded?
NeilJ
 
Posts: 3
Joined: Sat May 18, 2013 4:56 pm

Re: def on_project_load

Postby FichteFoll on Thu May 30, 2013 11:44 pm

FichteFoll
 
Posts: 388
Joined: Fri Mar 16, 2012 11:49 pm
Location: Germany

Re: def on_project_load

Postby NeilJ on Sun Jul 14, 2013 11:21 pm

Is there any possibility this can be added to ST2? It would be very useful for developing plugins which help users manage their projects within ST2. I was hoping to use this for a plugin I created which mounts to remote servers with the intent that when you open a project it will attempt to mount to the remote server based on pre-defined settings.
NeilJ
 
Posts: 3
Joined: Sat May 18, 2013 4:56 pm


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 6 guests