NPM Code List

A quick list of standing to do’s so I can be sure I don’t miss things, I really should look at using the tracker service on Source Forge for this hehe. But I’d rather spend my time writing the solutions 😉

In no particular order:

  • extend QLineEditdone a different way (for now)
  • do concept drawings of settings dialog
  • integrate logger and options module
  • remove dependency on psearch — it really is that simple a program!
  • fill in stubs for various port actions; install/upgrade/delete and prepair for various capabilities that need further development *wink*mostly done and evolving
  • ability to select items by means not tied to the mouse pointer location
  • consider a better name then port_viewer.pyrenamed pkgviwer.py
  • begin work on the ground work to begin the German translation
  • performance tests of our background process handling
  • mock up of NPM_MainWindow in style number 2done, minor changes to go (mostly educational advancements
  • gui for cvsup/csup/portsnap operations
  • replace search box and refresh button with tool bar in mock up layout
  • tabbed about dialog, kde-style

S’all I can think of right now. I know I really need to look deeper into Qt’s layout handling and widget geometry related facilities not to mention the coordinate system.

NPM_DisplayDialog

Spent most of the night watching Simpsons but I started work after awhile.

Worked on a compromise between the pkg_info/pkg_delete display needing to pass on the software packages name to be operated on to the appropriate slot and my own code minded need to place the actual implementations of those slots in its own file along side other port-related actions. I also removed the hidden column since I realized I already had a method to cram the spitted name and version back together and store it in an instance variable for passing on.

The internal QAction object for each entry in the context menu has it’s connect() signal connected to a python slot. Since we need to know what was activated (and I am not a genius with context menus in QT3) when the action is activated the slot calls an external function (the real slot if you like) with the name of the selected package.

So right clicking the package in the list brings up the context menu, which saves a reference to the item selected; suitable for running the pkg_delete/info commands on directly. When selecting the action to perform from the context menu, it causes the activated() signal to be sent to the wrapper slots for that action. Which intern call the implementations from another file with the item/package name that was set by displaying the context menu.

There might be a better way of doing it but I ain’t found it yet. And personally I am one that prefers to try the simplest solutions to a problem first and see if they work before complicating things. And this way of doing it is quite simple, at least to my brain cells.

I also skipped using the poor looking mockup of a display area I wrote to pack the output of running a command, such as make into a window for display. The mockup was based on a translation to Python I did of a C++ Example from QT3. It worked but did not look very nice and although I prefer to hand-code things when it’s not to major because it normally ends with me knowing WTF is going on. I fired up QT Designer and used it to create a simple Dialog with buttons I can edit into what I want and spend time getting it to do what I want rather then look nice.

Generated the python version of an ui.h file from it and wrote a subclass of it that modifies it (for testing at this point) and extends it with the extra functionality we want, being able to run the requested process and display it’s output. So far I am enjoying this and because the .ui files created by QT Designer is just a custom XML format, it is easy to edit by hand as well as through Designer (A GUI for making a GUI the easy way). Later on the subclass from the ui.py file might get replaced with a handwritten equivalent but I’ll worry about that later.

Some standing issues are:

0/ Define usage style for the Display Dialog while it ‘runs’ including changes to the options sub-system as needed.

1/ Set up the pkg_delete / pkg_info handlers to use it for displaying their output.

2/ (later) figure out how we can get the Dialog to display properly when resized, namely having the buttons and display widget resize with the window !

The above 3 items are what I would be doing tonight, if tonight was not really this morning because it is after 0500 in the local morning !!!!!!!!!!!!!!!!

The sad thing is I am hungry and wide awake but not sleepy in the least. I guess programming for a couple hours has that effect =/

Man, I love to code…

svn commit vs straight jackets

Made a bombing run across the code for wrapping pkg_info, the stuff to right click a program and delete it is still mock-up. But I’ve fixed the display of programs. Before when I had initially written it back in December I used a mish-mash of operations on links and arrays to rip off the version # and description from pkg_info’s output because I didn’t have time to learn Pythons Regular Expressions. Which of course I had to learn the regular expressions module like 2 weeks later but I never had time to revisit that.

I converted it to use regular expressions so it can solve the known issue that some of the entries displayed in the names and versions columns would be ‘cut’ wrongly. An exception handler was there to report any ones that failed the operation (and would display wrong). Because of the change to regular expressions that’s fixed and the exception handlers are mostly there to catch any errors I might make before the file grows more mature.

I’ve also tried to adjusted it so that a non displayed column is used to hold a complete reference to the programs name-version suitable to use plg_delete on. For the sake of those that don’t know what prog-foo installed does I should add a column between it and the versions that will display the short descriptions given by pkg_info; minor change.

I imported about 1/3 to 2/4 of my most stable files into the SVN Repository. And I think I can import most of the others in the testing/alpha2 directory. Before starting t his move to SVN. What I did was create stubs in my ~/code/Python/src/neo directory. And make a testing directory there for scratch tests and things because I still had many modules in Pythons standard library to learn and knew zilch about Qt programming.

The Alpha1 directory was made as a place to start compiling code that could begin to form the basis of an Alpha release. The Alpha2 directory was forked off from the Alpha1 directory to build more quality to it and iron out more ideas. I still personally consider NPM as pre-alpha because it has yet to be made a full program beyond the near complete mockup in the Alpha1 directory.

For the SVN Repository, code is being taken from the Alpha2 directory on the laptop and imported into the trunk. My intention is to make use of the branching/tagging features to prepare an alpha release from the current code when it is ready. So there is no need to use the directory structure I was using before SVN, because this is Subversion versioning system 😉

Ma kindly reminded me that it was after 0500 in tbe morning so I didn’t take time to finish work on the file before commit, it is still improving though. The only thing that pisses me off is I spent about 10 hours yesterday working on NPM after getting home from work. Between the website and the program code the first 5 hours were almost a washout, the 2nd 5 hours were like 20 * more productive then the first — Oh what difference there is between starting at 1500 and starting at 2400 here…

Neonic adventure

NPM now has a website set up. It is pretty basic and 2 files plus a stylesheet but gets the job done for now.

I want to see what I can do with the server side scripting so I could move the links menu, header, and footer into their own files to be inserted into the target page. I considered setting up a bare-bones install of a content management system since there is a MySQL database and 100mb storage allowed.

I ruled it out throuhg because the majority of it would just sit unused and that is at least 50MB of files for most CMS’s I’ve bumped into. While I do have experience with the software we use on [SAS] that does not mena I like it, I don’t think there is a CMS that I would want to use unless there was going to be enough volume of work to warrent it. I tried several demos of various PHP based CMS systems online, Drupal, Typo, Joomla, Xaraya, eZ Publish, e.t.c. I didn’t partictually like any of them but Xarya and Ez Publish looked quite nice but still overkill for this.

I also began checking in some of the more complete modules from NPM into the code repository on source forge.

As far as the web site goes, the only major additions I have planned for the near future is a planned features page, contact form, adding a link to my blog from page 2, and a note on fetching the sources from the svn. I also would like to get a mailing list setup.

My only complanit so far, it took me 6 hours to create the website — most of it done when my family was finally ‘out of the house’ for awhile, and all in all the job should have taken less then 45 minutes for me… That is how much damage constant interuptions, dogs barking, birds screaming like hell, fetch this and thats, phones ringing, peoples TV’s blasting my ear drums away, and the other general commotion going on in this rat-hole causes… Trying to work here is like pulling a fat man through the eye of a needle unless everyone here but me is sound asleep…

*sighs* is it any wonder I’m awake until I pass out from lack of sleep when I’ve got ‘work’ todo?

NPM ? SVN : SF

Registored for an account on Source Forge today and set up a project there for NPM.

My primary goal at the moment is the website because managing the source code on my laptop is no real problem, you could say I’m my own revision control system.

I’m planning on putting Source Forges project SVN Repository to work soon though. I am some what familiar with CVS, I’ve used it in the past but I’m not fond of it. Like emacs my relationship with CVS is a case of being able to live with it but not partial to it.

So in accordance with how much I have had to learn in getting this project a moving, I’ve elected to study a bit about using SVN. Heck, I havn’t used C++ in ages, I even hated the Python tutorials and never found the time to learn GUI toolkits besides (old version of) Java’s AWT. I also had to do a fair bit of hide and seek throughout the ports system internals. So I may as well learn a new versioning control system while I’m at it.

Hmm, busy busy busy time ! I’d love to get a micro-website and an alpha release sorted out this month.

NOTE TO SELF: Upload map for tomorrows live op tonight!

3 Modules and a pillow.

Been at work on 3 modules tonight, the searchlet looks like it’s able to stand alone quite well, leaving the NPM_MainWindow() to sort out how to lay it out in the main window. The module to handle pkg_info is becoming likewise (atm it’s just a thin layer around QListView). I’ve also made a few minor changes to the dialogs module, as soon as I have time to learn a more effective way of dealing with the arg’s involved I can get several classes sorted quickly in that module.

Very productive day all around it seems lol.

Now for some Simpsons and Sleep……. zzzZzzzzZzzzZzzZzzz

Spent last night working on further modulariation of the NPM_MainWindow class and I ended up sleeping next to Dixie =/

How many lucky guys get to wake up next to a laptop hahaha !!!

Today every one else was out so I managed to get time to sort out my paper work, makes me feel a little better at having dozed of after 2-3am =/

We also had a nice live op.. Went quite nice until we came to an area, from what I could see through lakes cam I thought the area was maybe 25-30m square. So I figured, roll a sting ball out and dominate along the two flanks. One man down in the entry attempt, 2 pinned down and one separated…

Moving out and trying to take cover we lost 2 more men so I shouted for Pittman to hold in cover.. Only to get sniped by a buckshot firing shotgun lol…. My failure not the teams.

Playing through the round for fun after we failed the live op (yuke whent to post the report). The resut of us went through again to explor, finding out that the area was closer to 45-55m square with evated shooters along one flank.

Nice secrets we uncovered, lake found a secret passage ‘ghost wall’ that opens a passage into hallway below. There’s a |_| area there that leads into a pair of dark rooms, one of which the door to the out-side is closed until you get to the room; it was there when we were exploring. But not there when me and Lake when hunting, until we cleared that room!

The passage under the pools, I h ad fired several 5.56x45mm FMJ into it before but no go, Lake applied his .45Cal UMP45 and it worked :-). So we went through the water, up to the secret room, and back through a sand filled set of hallways and boom.

We found out that the statue of a Crypt guarded by Anubis had slid to one side, unveiling the next hidden passage and exit.

While Lake went off to hunt down stuff, I tried walking off a platform into some plants. To my shop I fell through and found myself in an armour, varius pisol, smg, ar, sg, and tac aids on shelves and I took this screen shot of names on the wall:

[Click to Enlarge]
Free Image Hosting at www.ImageShack.us

Spent most of the dy with a headache and killing time in the servers..

I did manage to get time to read most of the documentation on QT’s I18N & L10N features and it actually seems to be a lot easier then I thought.

I knew there was some thing I liked about the folks at Trolltech ^_^

As far as coding for tonight, I’m not sure what I’ll be working on.. All I know is my paper work is late and the dead lines in two days… So I think that has priority if my family would ever leave me be…

I don’t really know what is worse, taking aspirin so often you get stomach ulcers or putting up with the results of life here =/

code at last

Spent tonight working on rewritten logger and options modules for the next phases of their prototypes.

There still is a fair bit of work to do with logger (i.e. telling it / getting from it the name of log file(s)) but it’s now essentially integrated with the rest of the program. Internally the module might change quite a bit but it’s usage throughout NPM will remain pretty much the same save where the above is concerned ^ (basically within the options module).

The options module is quite a lot cleaner imho, now has a search for a config file and can write the configuration file, the module matures bit by bit. I’ve also streamlined the configuration file a bit but I’ve still got to find the time to work on some concept drawings of the GUI’s configuration menu.

I also want to take a look at QAction and QActionGroup later on based on inputs from the QT4 doc’s.

*technically* I could probably get it operational for building a port right now with a wee bit of work… But I’d much rather have the bloody thing working properly and tested first :-).

*sigh* after 0400… time for bed because work is in the morning. It sucks that I’ve to wait till like 2300 or later to start coding… Any attempt at getting stuff done while the rest of my family is awake has proved futile over the last year and a half….. I could be so much more productive if I didn’t have to cram-things around every one.. I’ve got paper work due for En4cers inbox that’s overdue, school work piling up, and a project to work on (npm) and I’ve got to fit it all into the time slot of

>= every one else in bed
< I'm ready to pass out
< the time to go to work
<= time to go to bed if I'm ever gonna get to work on time
Grrr…

snoring through logging

been working on a simple logging module for npm, so far I’ve set it up to handle 3 different outputs, the usual STDERR for big problems, a regular log file for every thing but debugging, and a developers log file for use during debugging.

stderr
CRITICAL: critical message
ERROR: error message
WARNING: warning message
run log
2007-12-27 07:27:45,156: CRITICAL -:- critical message
2007-12-27 07:27:45,157: ERROR -:- error message
2007-12-27 07:27:45,157: WARNING -:- warning message
2007-12-27 07:27:45,158: INFO -:- info message
dev log
2007-12-27 07:27:45,156 root CRITICAL: logger.logger.py.73
critical message
2007-12-27 07:27:45,157 root ERROR: logger.logger.py.74
error message
2007-12-27 07:27:45,157 root WARNING: logger.logger.py.75
warning message
2007-12-27 07:27:45,158 root INFO: logger.logger.py.76
info message
2007-12-27 07:27:45,159 root DEBUG: logger.logger.py.77
debug message

The formats are just a matter of what I find easy on the eyes, think the middle one could stand with a shorter date format.

I might ditch the idea of a second log file and just follow my original idea of being able to specify the level of logging to use. It’d also be less work then

Either way yee slice it, I need some freaking sleep… because I can’t think no more.

:wq!