On 7/5/07, Leandro Lucarella <[EMAIL PROTECTED]> wrote: > > Ian Bicking, el 2 de julio a las 15:48 me escribiste: > > > 2- paster, paste script to be exact is way too complicated for > > > "normal" tg commands, paster is build on top of optparse which at > > > least in TG case will maintain the huge set of switches, most TG > > > commands could be ran with a simpler structure of "tg2-admin cmd > > > subcommand" this is due to some things being set by default like the > > > project, model,etc. Second the fact that paster commands are classes > > > goes against how TG-cli is implemented which is sets of commads, > > > (please correct me if I'm wrong here) the only way I see we can > > > implement sets of commands on pastescript is to have one class > > > implement the command and in it's run method parse to get the > > > "subcommand" part which makes it esencially imposible to add new > > > subcommands to already existing commands. > > > > Why do you need these three-level commands? > > this is normally the way TG works, commands are really groups of commands and you run them like that. tg-admin sql create tg-admin sql delete tg-admin i18n collect etc.
> > If you want, you could create a subclass of paster's Command class that > > does more dispatching. You could even just look for an entry point of > > "%s %s" % (self.name, self.args[0]), same entry point type as Paster's > > current commands (since it's basically the same interface). > > I don't know anything about paster nor TG current CLI, but have you > considered going the git[1] way? What git does is just to call 'git-cmd > arguments' when you call 'git cmd arguments'. The simplicity behind this > model is just beautiful, and you don't need entry points or any other > weird stuff. If you want to add a tg-admin subcommand just install a new > command line utility called tg-admin-subcommand. > that is exactly the structure I got in mind, my first attachment had a mock of it I have the equivalent of "tg-admin info" working on my machine, I just haven't got around to find out how to make sql (for sa or so) work. Also I don't know how to get config info from the current trunk like the dburi. As an added bonus my soon-to-be-program exposed all commands so you can create your own just by calling them as functions. for example commands.sa.create() PS: if someone knows ways to call the create/delete/etc. for sa please drop me an email. > Just a thought... > > [1] http://git.or.cz/ > > -- > LUCA - Leandro Lucarella - Usando Debian GNU/Linux Sid - GNU Generation > ------------------------------------------------------------------------ > E-Mail / JID: [EMAIL PROTECTED] > GPG Fingerprint: D9E1 4545 0F4B 7928 E82C 375D 4B02 0FE0 B08B 4FB2 > GPG Key: gpg --keyserver pks.lugmen.org.ar --recv-keys B08B4FB2 > ------------------------------------------------------------------------ > Parece McGuevara's o CheDonald's > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en -~----------~----~----~----~------~----~------~--~---
