Hi all,

this is based on an e-mail I sent to Andreas earlier.
I got commit bit, so I try to outline my plans:

I am trying to add a GUI front-end to CPAN.pm
using wxPerl and looked at how can I interact with it.

It will probably be a stand-alone CPAN client that will also
be integrated in Padre.


1) I see that many of the sub packages are actually within CPAN.pm.
I thought I'll move them into separate .pm file but looking again
I am not sure all of them should be moved.
CPAN::Shell is big so I am moving it right now but there are several
very small ones that might just create unnecessary overhead
in maintenance if we put them in separate files. What do you think?


2) As I understand the printing is done by CPAN::Shell::myprint()
In my code I have overriden that but there are several difficulties.
Actually after discussing with Andreas I think I'll reuse the
$CPAN::Frontend variable.

Anyway, I ran the following code:

    CPAN::Shell->i('/CPAN::W/');

and got 4 calls to myprint (which looks like this:       print "X $_[1]"  )
So each call is prefixed with an X:

X CPAN: Storable loaded ok (v2.18)
X Going to read /home/gabor/.cpan/Metadata
X   Database was generated on Mon, 20 Oct 2008 02:27:15 GMT
X Module    CPAN::WAIT             (ULPFR/CPAN-WAIT-0.27-2.tar.gz)
Module    CPAN::WWW::Testers     (BARBIE/CPAN-WWW-Testers-0.36.tar.gz)
Module    CPAN::WWW::Testers::Generator
(BARBIE/CPAN-WWW-Testers-Generator-0.30.tar.gz)
Module    CPAN::WWW::Testers::Generator::Article
(BARBIE/CPAN-WWW-Testers-Generator-0.30.tar.gz)
Module    CPAN::WWW::Testers::Generator::Database
(BARBIE/CPAN-WWW-Testers-Generator-0.30.tar.gz)
Module    Parse::CPAN::Whois     (MARTIJN/Parse-CPAN-Whois-0.02.tar.gz)
Module    Parse::CPAN::Whois::Author (MARTIJN/Parse-CPAN-Whois-0.02.tar.gz)
7 items found

Now I need to somehow separate the various types of data:

   CPAN: Storable loaded ok (v2.18)
   Going to read /home/gabor/.cpan/Metadata
   Database was generated on Mon, 20 Oct 2008 02:27:15 GMT

Is basically logging information.

   Module    CPAN::WAIT             (ULPFR/CPAN-WAIT-0.27-2.tar.gz)
   ...

is the real data though I'd probably need it in a more fine tuned format
where
I can easily know what is the name of the module and what is the file.

  7 items found

is meta data that I should also recognize as that.


I could parse the strings and try to figure out what kind of output I get
but it will be much easier if there different printing functions
were called for different data types.
Then I could implement those separate functions and know what kind
of data to expect.

I did similar operations to ack - the grep substitute.

3) First I thought the CPAN GUI will run the CPAN client in the current perl
but now I have another idea. I am not sure yet about.
Padre has lots of dependencies and it also requires a threaded perl.
Users might install it in a perl that is not their production perl.
I could see the same with the CPAN GUI client. People might want to have it
but not installed in the perl they are using.

So I thought CPAN.pm should have remote capabilities just as the -d debugger
has.

What do you think?

Gabor
http://www.szabgab.com/

Reply via email to