On Fri, 2002-10-25 at 01:40, Ian Bicking wrote:
> Looks good.  I changed it a bit so it would also monitor modules that
> were loaded before ImportSpy was started up (e.g., Application.py).  It
> would be good to also add any configuration files -- I suppose a hook 
> could be added to Configurable.  

Good idea!

> To do that ImportSpy should probably
> not auto-install itself, since Configurable would have to check if
> ImportSpy was on.

Well right now ImportSpy hooks itself in regardless of whether
AutoReload is activated or not.  I would have preferred to have
AutoReloadingAppServer install the ImportSpy hook, but I also wanted
ImportSpy to get hooked in as soon as possible, so that most modules get
monitored.  Do you see a better way of doing this?
 
> Another feature that would be nice would be adding checking Python
> standard libraries.  On Unix that will generally be files starting in
> /usr/lib/pythonX.X -- but that's obviously not general, even on Unix. 
> I'm not sure how to identify that directory.  It might be
> os.path.join(sys.prefix, 'lib/python%i.%i' % (sys.version_info[0],
> sys.version_info[1])).

Could we use access() to check for write permissions?  Standard python
modules would be installed without write permissions for most users. 
But then again, people might run their appservers under a user which
doesn't have write permissions on any of their servlets, for security
reasons.  I don't see a good general way of solving this.

> I did have a problem with the actual restart, though.  It shuts down and
> I get:
>   /usr/bin/python: can't open file 'Launch.py'
> 
> I don't get it -- I'm starting it up from ./AppServer (in the WebKit
> directory).  $PWD is the WebKit directory.  Launch.py is in the WebKit
> directory.  So I don't know why it isn't working.

Hmm... Launch.py changes the working directory to the Webware directory
(one level up from WebKit), so that's probably why autoreload doesn't
work in this case.  If you called AppServer with the full path it would
likely work.  Is there a good way to fix this?  I guess we could
translate the value of sys.argv[0] to take the chdir into account when
the appserver is called with a relative pathname.

> On a stylistic note: it's best to use """ instead of ''' for docstrings
> -- Emacs sometimes is confused with '''.  Also please be sure to put
> whitespace after all commas.

Thanks for the tips.  I remembered seeing something about """ vs ''',
but couldn't rememebr which was preferred.  A grep of the code in CVS
wasn't conclusive. :)

-- 
Jason D. Hildebrand
[EMAIL PROTECTED]



-------------------------------------------------------
This sf.net email is sponsored by: Influence the future 
of Java(TM) technology. Join the Java Community 
Process(SM) (JCP(SM)) program now. 
http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0004en
_______________________________________________
Webware-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-devel

Reply via email to