hmm needs some work how close does it come to working? i get this File "win32serviceutil.pyo", line 670, in SvcRun File "__service__.pyo", line 44, in SvcDoRun File "twisted\application\service.pyo", line 293, in loadApplication File "twisted\persisted\sob.pyo", line 182, in load File "imputil.pyo", line 103, in _import_hook File "", line 52, in _import_top_module File "imputil.pyo", line 216, in import_top File "imputil.pyo", line 271, in _import_one File "", line 128, in _process_result F ile "atop\__init__.pyo", line 10, in ? File "atop\regadapt.pyo", line 30, in justDoIt File "twisted\python\plugin.pyo", line 305, in getPlugIns File "twisted\python\plugin.pyo", line 191, in getPluginFileList exceptions.IOError Couldn't find a plugins file! ahh i've been mostly working with tacs so far i need to figure out how to automatically add the mktap plugin parts MFen: have you tap2ntsvc-ed anything that uses plugins? however MFen: those aren't tap plugins well, rather the fact that mktap quotient has side effects worries me atop isn't trying to get tap plugins hmm, ok it's trying to get plugins that are used elsewhere in the system not that it matters; the important bit is that you need to support inclusion of the plugins.tml is this something that tap2deb understands? MFen: well, tap2deb assumes that the python package is installed already tap2deb doesn't package python source code the plugins.tml has to be in sys.path, is that correct? MFen: no MFen: it has to be in a top-level python package um MFen: which means it has to be in a directory inside a directory in sys.path as long as it has an __init__.* i hope it doesn't have to be in the same python package that i'm running, because i can't stick it into the exe i.e. inside folder /foo/bar where /foo is in sys.path and there's a /foo/bar/__init__.py ok so if i sys.path.insert(0, sibpath(sys.executable, '')) and make a foobar/{__init__.py,plugins.tml} it should work? MFen: hrm, something like that MFen: while that would work, fixing it at a higher level might be nicer ooh, an email from Pavel MFen: just so you know, btw, quotient has three top-level packages and they all have plugins.tml files :) oh good grief oh wait, only two of them have plugins.tml there's no way in hell i'm going to be able to figure this all out programmatically MFen: If you can find all the plugins.tml files at tap2ntsvc time, then you *know* what files getPlugIns() should be examining there ought to be code in twisted.python.plugins that returns list of plugisn files may need a bit refactoring MFen: you don't have to monkey the filesystem at all itamar: There is. itamar: i think that's already how it works in fact, i think i'm the one that refactored it to be so!! because I am a genius so.. in order to get the list i have to basically start the application eh you don't want to use that function to do what exarkun said because you will get all the plugins.tml everywhere on the system you should search all the top-level packages that are being packaged and grab their plugins.tmls no! wrong! what you want to do both. exarkun: why? unless you want to utterly cripple the plugin system and make it completely worthless. radix: repeat after me radix: "plugin" yes! exarkun: please explain coherently radix: "plug" radix: "in" however, that still won't help with packaging thosepackages radix: "pluuuuuuggg iiiinnnnn" it doesn't matter. i can't search anything. as it is, you have to manually inject modules to be packaged, and after that point it's out of my hands. if py2exe can't figure it out, i can't either it's Zombie Jean-Paul MFen: you have to specify all modules, not just packages? MFen: so you can't package plugins.tml? oh, you use py2exe for figuring out what modules to take? radix: no. for example, with quotient, all it seems to need is -i atop or rather, i guess you just use py2exe :) MFen: that's a py2exe parameter, or a tap2ntsvc parameter? tap2ntsvc, but it gets passed on to py2exe inchanged un MFen: right MFen: so look in the packages that are passed to -i for plugins.tml files ? and do what with them? that's the question MFen: well, make sure getPlugins will search them at runtime :) loading a plugin implies loading a bunch of modules i have to include those modules somehow MFen: those are already in the packages that py2exe grabbed MFen: at least, that's what you can assume reasonably i don't know that i can MFen: why not? py2exe grabs whatever the script depends on MFen: well it's up to the user to make sure all their modules are included essentially, that's win32 stuff, some twisted stuff and whatever the -i requires same as if they were using py2exe itself of course, if you want to parse the .tml file yourself and make sure the modules it references are included, that would be nice :) yucky well that would be a minimum but i wouldn't bother ok! heh MFen: Can't you pass it to modulefinder? so you're trying to be nicer than py2exe is :) It's just Python source modulefinder finds modules that are in strings? modulefinder isn't that smart modulefinder sucks .tml just does register('module.name') just rewrite it w/ AST AST? radix: often. radix: sometimes not. there's no reason that should reasonably include the module MFen: compiler.compile(file("foo.tml")) MFen: then walk the tree and look for imports it shouldn't be very hard ?? the .tml file doesn't actually do imports! radix: it is a python source file radix: it does whatever it bloody wants exarkun: the whole _point_ of the .tml mechanism is to avoid imports no it isn't the point is to avoid _some_ imports exarkun: so you need better support than that most look at twisted/plugins.tml ok, you're talking about different modules than I am in this case, just load it how many imports do you see there? it *tells* you what modules it wants it couldn't possibly be any easier yes. hell, it'd be easier to just walk the filesystem looking for .py and include all of it you'll have to actually have special support for the .tml, not using basic introspection MFen: heh hardly special just load it and look .module attributes that's support that is specific to the twisted plugin system :) i.e., "special" ok so why does he need to call getPlugins at package-time? So he knows what modules to include sorry, "loadPlugin" s exarkun: oh, you mean, passing the list of plugins.tml files that we've found explicitly yes ok, so i load the plugin, *implement modulefinder*, and use my new modulefinder to collect all the .py that the plugin needs MFen: nah MFen: it's trivial it's nothing like modulefinder hrm if it's so trivial why doesn't modulefinder do it? MFen: modulefinder doesn't know about twisted :) it only applies to .tml files it has nothing to do with .tml files actually, loadPlugins isn't quite sufficient.... MFen: yes, it does. at some point in the future, the runtime needs a bunch of modules that aren't directly referenced by the script you know which modules to include by looking at the .tml files no! you don't. you only know at best which modules the .tml file loads directly what about all the modules that get loaded indirectly MFen: this is what we have been talking about MFen: it will be easy to write support for .tml files to *know which files they load indirectly* well, apart from the fact that loadPlugins requiresa "pluginType" argument :-( and that there's no catch-all Yes there is unless you want to implement an object that has a special __eq__ that always returns True ok, i don't want to know about what pluginType means.. i want to know why you think a plugin can ever know what modules it loads indirectly MFen: because plugins.tml tells you register("Lore Slides", "twisted.lore.slides", description="Lore for slides", type="lore", tapname="lore-slides") see the second argument? that's not what i mean MFen: just import it MFen: and use modulefinder on it i mean the files that twisted.lore.slides imports exarkun: you'd think that would work. in fact, it doesn't. py2exe does load the scripts it's finding modules on, and it still doesn't find stuff like that wait, wait it's not looking for import opcodes or anything smart like that, it's doing something much weirder MFen: py2exe takes arguments for this, doesn't it? yes MFen: you will pass "twisted.lore.slides" to py2exe as a module to require hmm all right, now look at nevow/plugins.tml Right, that's why I was talking about walking the AST. hurrk evil well this is what I suggested before, I'll suggest it again personally I'd just rely oh passing lists of package names to package forget the whole thing and let people worry about what modules they want to include themselves :) and just make sure the plugins.tml files are there