On Sat, Jan 30, 2010 at 5:06 AM, John McKeon <p3anoman(a)gmail.com> wrote:
I'm sure it is probably not but I couldn't
resist the pun...
.
I wrote a small Gofer script (attached) which does what I need except I was
surprised that class initializations appear to occur in the reverse order in
which the packages are loaded? The script loads PostgresV2, ROE,
Magritte-Roe and, my favorite bit of contributed code, Moe.
The problem is that Magritte-Roe attempts to connect to PostgreSQL before
meaningful connection arguments can be entered, so it bombs out. This causes
all of the remaining initializations not to execute, which leaves PostgresV2
unable to connect at all until PGPacket is manually initialized.
So I added a bit of code to MAConnectionPool's initialization to prompt for
the correct arguments to be entered before MAConnectionPool attempts to
startup. It is a bit ugly, using a half a dozen FillInTheBlankMorphs to get
the required info. Before doing it that way, I added Magritte descriptions
to PGConnectionArgs so as to bring up a nice morphic dialog (see
MAConnectionPool class>>initializeConnectionArgsMorphic), but two problems
with that are:
1) Magritte-Morphic is not loaded in the standard Pharo 1.0 image? (I guess
I could add that to the Gofer script)
No.
2) I can't get an answer from the resulting
dialog
John: have you considered creating your own Metacello configuration for your
project? I will enable you to load very easily all your stuff in a core/dev
image without problems, using stable versions, automatically resolving
dependencies, etc.
I think that maybe, the Metacello pre and post doits may help you. You
should not put your code in your class side initialize methods, but in those
post do its. Then you can have pre and post do its at package and project
level.
There is also a parameter in the Metacello called #loadType: which default
is linear. But maybe the #atomic may help you. I am not sure.
Just in case you are interested in, I suggest you to read the metacello
image based tutorial (no more than an hour) and if you have questions there
is a mailing list where you can ask.
Link:
http://code.google.com/p/metacello/wiki/Tutorial
Good luck.
Mariano
Cheers
All of this is in the latest version of Magritte-Roe
in the repository. If
anyone cares to take a look at my morphic dialog code, I would welcome any
advice.
Thanks in advance
John McKeon
--
http://jmck.seasidehosting.st
_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki