[Twisted-web] Obvious stuff... just not to me,
re: Failure to Install...
Dav Clark
dav at securme.net
Mon Jun 18 23:17:12 EDT 2007
First off, thanks for answering my e-mail so thoroughly! I even had
a lightbulb moment with your "nevow/plugins is just a directory"
comment (though now I'm thinking "but why does it use an __init__.py
then?" - but I'm letting it go for now). As for your questions, I
attempt to answer below.
On Jun 18, 2007, at 12:00 PM, Jean-Paul Calderone wrote:
> setup.py is basically fully supported. If you find bugs in it, we
> will do
> our best to fix them. easy_install isn't really supported at all;
> please
> don't suggest it or anything related to setuptools.
Got it - I guess the failure to install javascripts really is a
"real" bug then... but I've reported it already.
>> 3a) So, for example, after getting the thing working with the stock
>> nevow/plugins directory, I standardized on having a local nevow/
>> plugins
>> directory as a sibling of my tac file. I would suggest this be the
>> recommended (or at least an alternative) method described in the
>> wiki -
>> this keeps all example files bundled under the same root dir.
>> This also
>> allows the possibility of bundling a tar or zip of an athena
>> package, you
>> un-archive it, and the example just works with twistd -ny
>> example.tac from
>> where it sits. (well, you need to alter the /path/to/your/file to
>> sibpath(__file__, 'mymodule.js')).
>
> I'm not totally clear on what you're suggesting here. As described
> on the
> wiki, the plugin system does let you keep all of your source files
> beneath
> one directory. Maybe I'm not understanding your concern, or maybe
> you're
> still missing something about how plugins work. Could you describe
> this
> issue further?
An example is probably more useful. I've put something here for you:
http://www.keepopen.com/files/athena-example.tar.bz2
You can just un-archive that and immediately run `twistd -ny
myelement.tac` (and you can check those files with a quick diff
against the default Athena tutorial files to see the very few changes
- basically those described above).
Anyway, I'll admit that you're not forced to learn as much my way!
>> 3b) I would go a step further and suggest that, as in zope, a way to
>> create "instances" be created. This would just mean populating a
>> directory
>> with things like a plugins direcotry, a js dir for
>> nevow.athena.autoJSPackage to load and other stuff I haven't
>> learned about
>> yet. A set of scripts localized for that instance would add the
>> appropriate root to the python path before running. Or, you
>> could just
>> require people to run twistd from the root dir of the bundle.
>> This would
>> be remarkably similar to the "solution" for 3a.
>
> Requiring extra programs in order to run the actually interesting
> program
> doesn't interest me very much. Beyond this, I'm not really sure
> how this
> suggestion differs much from the current system, except that it
> explicitly
> makes environment setup something that goes into a helper script,
> rather
> than relying on each user to have an environment which is "correctly"
> configured. Perhaps the documentation should go into more detail
> about
> what Nevow considers a "correct" environment?
Agreed - maybe some of the "agreed" changes to the wiki will go some
way towards this. I was thinking of something more like a helper
script. But I'm beginning to understand that if you're using
twisted, you're probably doing something complicated... so you should
probably think about things before you do them :)
Maybe an environment recipe collection would be nice.
>> 3d) Speaking of strange .js includes, some system (correctly?)
>> associates
>> the nevow/empty.js file with most Nevow classes. But for root
>> classes, you
>> also get these __init__.js associations, which are non-existent
>> *.js files.
>> Is this a bug?
>
> Hmm, could be. Can you describe this further?
--
import nevow.athena
jsd.getModuleForName('MyModule') # or whatever
print jsd.mapping
--
yeilds (among many other things):
{ ......
u'Divmod': '/Users/dav/Desktop/SecurMe/dev/Nevow/nevow/js/Divmod/
__init__.js',
u'Divmod..svn': '/Users/dav/Desktop/SecurMe/dev/Nevow/nevow/empty.js',
u'Divmod..svn.prop-base': '/Users/dav/Desktop/SecurMe/dev/Nevow/nevow/
empty.js'
.....}
These "empty.js" files occur if and only if we're mapping to a .svn
directory. So, I guess this is just a side-effect of my using a svn
checkout. But it's still weird. That emtpy.js file does exist -
it's empty.
The __init__.js entries refer to non-existent files.
>> 5) Why do all examples have twistd -noy, when -y implies -o?
>>
>
> Historic reasons. The people writing these wiki pages probably
> still have
> finger memory from before -y implied -o. :) Feel free to fix this.
I see no need to remove history!
Thanks again,
Dav
More information about the Twisted-web
mailing list