Manually reloading code

2 views
Skip to first unread message

Clint V

unread,
Jun 1, 2008, 4:39:26 PM6/1/08
to py-livecoding
Is there a function on the CodeManager that will manually reload code?

I would like to stay away from the detect_changes and call the reload
at the bottom of my application loop.

Richard Tew

unread,
Jun 1, 2008, 5:00:59 PM6/1/08
to py-liv...@googlegroups.com

Just call the same function the change detection calls. I think it's
called ProcessChangedFile or something.

Cheers,
Richard.

Clint V

unread,
Jun 7, 2008, 10:37:51 PM6/7/08
to py-livecoding
And one other question. What is the prefered method of dealing with
nested modules? The import statement seems to be barking at me about
blank __init__.py files not contributing to the module.

On Jun 1, 4:00 pm, "Richard Tew" <richard.m....@gmail.com> wrote:

Richard Tew

unread,
Jun 8, 2008, 8:13:27 AM6/8/08
to py-liv...@googlegroups.com
On Sat, Jun 7, 2008 at 10:37 PM, Clint V <yosh...@yahoo.com> wrote:
> And one other question. What is the prefered method of dealing with
> nested modules? The import statement seems to be barking at me about
> blank __init__.py files not contributing to the module.

While the google project hosting site isn't as clear as it could be
about this, I don't think you were able to interpret this from what I
wrote there so I will try and reiterate it in a clearer way.

The livecoding module does not work for the Python module system. It
installs its imported namespaces into the same locations normal Python
modules go, and works with it, but that is all.

The livecoding module implements its own simpler and less cumbersome
code directory structure. It was designed for game scripting.

Let's say we have a directory added to the livecoding system:

directory/file.py

Then in file.py there is one class:

class SomeClass: pass

This means that the namespace created and monitored by the livecoding
system will be like this:

import directory
print directory.SomeClass

There is no need for __init__ files as there are no modules. It is
simply a namespacing system where directory structure builds up to a
namespace path, and the contents of .py files at different points of
the directory structure get placed in the appropriate namespace.

Sorry for any confusion.

Cheers,
Richard.

Reply all
Reply to author
Forward
0 new messages