Week[3] Report: On-Schedule and More Features!

June 22, 2008 at 14:21 | Posted in Perl, Summer of Code | Leave a comment

This week has been exciting for me! I have completed the code for listing all installed modules by Name, Author, and Category (‘chapterid’). Here is a list of features I have also implemented:

Search
I finished the search algorithm. You can search by exact query, or search with regex, using ‘/$searchtext/$mods’, just like regular regex in perl. I am going to implement an “Any” function for searching within any of the required type for CPANPLUS’s search() function.

Toolbar
The toolbar now works. If you are downloading the code, the XRC file specifies the tools in the toolbar, but since I can’t update the icons, I delete them all, then insert new tools. I plan on removing the ‘Update List’ button later, as I am using it for testing purposes.

The Module List
I worked very hard on the code which lists the modules by the various information. It still needs some work, but will do for now. Listing the modules by category was the hardest part. (See previous entry for explanation.) I poured over the code, and re-worked a bit of it to get the actual sorting routine from 4 minutes average, down to 1.5 minutes. A more than 50% reduction in time! The routine that inserts the items into the list originally averaged 30 seconds, (no icons in list), but now averages 1 minute, with the icons displayed. I think this is acceptable. Overall, my execution went from 5-8 minutes, down to 2-3 minutes. Not bad! As for improving this, I am not sure I can, except to give the user the option of displaying icons, but there will be no way to tell the module’s status, except for clicking on it and waiting for the other information to update. Eventually, I am going to put a reference to the generated list in the ListCtrl module, so if the user goes back to a previous view, the update won’t take so long.

The Actions Collector [placeholder]
This tab was added to the main display. It is not implemented yet, but will hold all a list of all the actions a user has selected, so if she wishes to do a mass update/install/remove, she will be able to review her changes before it begins. The “Update List” toolbar item will be changed to “Update Installation” (or something like that).

Status and Information Tabs
I have almost fully completed this. The method to update the display takes 5-10 seconds to complete. I have several information-related tabs: Info, Actions, Files, Readme.txt, Status, and Prerequisites.

Info [works]
displays various module-related information, like author, package, etc.
Actions [not implemented yet]
This is where the user can install different versions of a module or remove it.
Files [problems]
This lists all of the files in an installed module. Apparently, the CPANPLUS::Module::files() method only works for the installed version, so I need a way to get the module object for the installed version.
Readme.txt [works]
This is where the module’s README file is displayed. wxPerl v0.83 is preferred, as previous versions seemed to have a limit on text size in a TextCtrl. This is an unverified claim, but when I updated wxPerl to 0.83, the full file displayed properly.
Status [problems]
This is where most of the information from $module->status() is displayed. It is mostly checkboxes and textfields. I am not sure where or even if there is a problem, but almost all modules return a status object with all values set to undef. Maybe status() is only used during installation? Needs further testing – possibly ask Mr. Boumans, but I don’t want to waste his time.
Prerequisites [major problems]
This is a tree display of all the prerequisites for a module. It doesn’t seem to work with any modules. I am attempting to fix this.

Here is a screenshot to show what the main window looks like as of today.

wxCPAN in action!

Advertisements

Leave a Comment »

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.
Entries and comments feeds.

%d bloggers like this: