Home Download Buy Blog Forum Support

Module organisation & importing

Module organisation & importing

Postby dve on Wed May 23, 2012 7:17 am

I am building a sublime plugin and am trying to organise my code into folders. Each folder has an __init__.py.

My problem is that as soon as I move any py files out of the root folder they are no longer re-compiled, even though (as far as I can tell) the import statements are correct.
Even if I have all the .py files in the root I have to save each one in turn down the import chain e.g. If A imports B and B imports C, I have to save C then, B and then A even if there are no changes to B or A.

I am doing something dumb!? Im fairly new to python so maybe missing something
dve
 
Posts: 4
Joined: Tue May 22, 2012 3:56 pm

Re: Module organisation & importing

Postby quarnster on Wed May 23, 2012 7:25 am

Sublime only reloads the first level. For submodules, you'll have to manually reload by calling the reload function.
quarnster
 
Posts: 389
Joined: Tue Nov 29, 2011 11:34 am

Re: Module organisation & importing

Postby dve on Wed May 23, 2012 8:13 am

Perfect.. thanks :)
dve
 
Posts: 4
Joined: Tue May 22, 2012 3:56 pm


Return to Plugin Development

Who is online

Users browsing this forum: Exabot [Bot] and 3 guests