Home Download Buy Blog Forum Support

Distinguishing python files to load from libraries and utils

Distinguishing python files to load from libraries and utils

Postby SteveCooperOrg on Fri Mar 28, 2008 4:03 pm

I'm writing a python script to build a .sublime-package from a package folder. That script lives in the package folder, eg;

PackageDownloader
PackageDownloaderPlugin.py -- the plugin; has an include for PackageDownloader.py
PackageDownloader.py -- a library file, does not contain sublime commands
Package.py -- a utility to zip up the relevant files

Is there some way that I can mark a file as not being something for Sublime to load? Either a note to Sublime to say 'don't load me', or a statement along the lines of if __name__ == __main__, or some other trick? At the moment, every time I load sublime or edit my utility, Sublime tries to execute it.

Cheers.
Maybe what you're looking for is at the http://www.sublimetextwiki.com
SteveCooperOrg
 
Posts: 193
Joined: Thu Mar 20, 2008 9:53 am

Re: Distinguishing python files to load from libraries and utils

Postby jps on Sat Mar 29, 2008 12:20 am

It does simply attempt to load all python modules, and then inspect the classes within them... It sounds like if __name__ == __main__ is what you want here, does that not work?
jps
Site Admin
 
Posts: 3071
Joined: Wed Mar 19, 2008 12:33 pm

Re: Distinguishing python files to load from libraries and utils

Postby SteveCooperOrg on Sat Mar 29, 2008 12:35 am

uh, yeah, it does work ;)
Maybe what you're looking for is at the http://www.sublimetextwiki.com
SteveCooperOrg
 
Posts: 193
Joined: Thu Mar 20, 2008 9:53 am


Return to Plugin Announcements

Who is online

Users browsing this forum: Yahoo [Bot] and 8 guests