wrapping make config

I was trying to work on creating a simple pop up window that would list of a ports configuration options, same as the dialog you get when doing a make config on a port with options. But for the life of me, I couldn’t figure out how on earth to nab it because of it being a multi line variable.

With the bird screaming my head off and Ma trying to bake (including calling for help). I gave up on even trying.

Tonight I sat down and tried to *concentrate*, it sucks that I’ve got to wait till everyone else is asleep to ensure I can work with my brain on my thoughts… But the anwser to the problem it me quite quickly once I started tonight.

Don’t think about it as grabbing the OPTIONS out of th Makefile, think of it as if I was the make program!

So obviously if I was make(1) I would want to look through the Makefile in order to find all variables declared. Storing them in a simple data structure and relying on the @ EOL continuation syntax that is used — So I would be getting the ‘whole’ thing when storing a variable for later reference.

Stepping back to the problem at hand, I made it look exclusively for Options by wrapping it in a regex check for the specific variable rather then any. I’ve converted the routine to be able to hunt for an indicated rather then specific variable so it is not so closely tied to the problem it is actually solving for me.

Next up, figuring out how QT handles check boxes and adusting the routine for a ‘nicer’ way to use it.

When I can just sit and work/read, I can in-hale a problem/book but when I’ve got to do things so late at night, I am limited to how long I can go until my brain just conks out of logical thinking… Do to the requirement for sleep.

Night module

Unfortunitly it is 0430 and I’ve got to get up early for work :'(

Finally had free time to day to shave off that infernal beard.. After so many months it is kind of nice to be reminded I’m more human the Wookie haha.

Spent tonight doing some light but thoughtful work,

Terry@Dixie$ pwd; /bin/ls -1                                               9:26
/home/Terry/code/Python/src/neo/testing/alpha
dialogs.py
main.py
neo.py
options.py
translate.py
Terry@Dixie$ 9:29

I have arranged things from the testing directory to it’s own work dir to clean up. Not to mention to continue work in a more module oriented pattern then the monolith and scratch files I have been using to test the first mock up of the programs UI.

  • dialogs -> will hold code common to user interaction through ‘pop up’ windows.
  • main -> the begining of it all, will probably be wrapped in a shell script
  • neo -> the GUI’s mock up code for the main window, need to split stuff off into sub modules when more work is done.
  • options -> the option subsystem, currently part of a config parser; to be expanded greatly
  • translate -> quick references to tools we will need later (subject to changes)

There is also a .neorc INI file for the testing 🙂

My near-future to do list right now is, in no particular order:

experiment with improving the wrapping paper on pkg_info; regex might be an improvement to the current process what ever the possible speed changes are. It might also be beneficial to look into using a pipe in order to ease start up times.

expanding dialogs into some thing more complete, currently it only has a routine for an error message.

Figure out how we can create a suitable display area for the output of a shell command (such as ‘make’).

I think I could probably do double the amount of work per day on this, if I didn’t have to do it before bed… Which has the bad limit of only being able to do things until my mind gets to the point that I just have got to sleep or the clock passes a point where I need to hit the hay, in order to get enough sleep for work in the morning.

I am lucky though, I’ve had almost 3 day’s off and only light duties tomorrow.

searchlet test level 7

Almost finished my work on npm from early this afternoon.

Took care of getting the mock up to actually search the ports tree for a given string, considering incorporating a simplified version of psearch but I can worry about that later.

Did most of the right view of installed software today, it still has a problem but this is good progress:

Click to enlarge

Some of the listings are screwed up and trigger a TypeError, I know I’m doing some thing wrong some where but not sure where yet…. At the moment I am about ready to hit the hay.

Some future tasks include fixing that, adding a toolbar to the mockup, a place holder (or working) msg display area. And moving on to other mock up’s.

So far, it is not pretty but the mock up is doing quite well. Hopefully fiddling with layout management and spacers will not be to much heartache under QT3 without having to use the Designer tool. Hmm, you know it might even be possible to make things a bit more flexibble rather then choosing one of the mock ups as the basise of the final forms overall appearance.

Any way one slices it though, it is time for BED.

GET ME THE **** OUT OF HERE !

I’m sitting here across the building…

Trying to build a working mockup of my main widget that’ll handle searching ports for the entered string through the GUI and volia !

Family is driving me out of my fsck’ing mind.

Just for once in my life, I would love it if I didn’t have to stay up to after 4 in the damn morning just to get stuff done because I can’t be left alone during the afternoon !!!!!

Every one else asleep == I can get stuff done

Any one else awake == 75% less chance of being able to hear my brains internal dialogue, let along get work done (much lower chances).

Thinking…

A few concept drawings of what I have in mind

Style #1: simple interface (emphasis on searching and ease of performing common actions)

Free Image Hosting at www.ImageShack.us

Style #2: orthodox interface (commander like with toolbar, I like this one xD)
Free Image Hosting at www.ImageShack.us

Style #3: balanced interface (I think it would be better with the left being a |installed software | build messages | tab-thingy).

Free Image Hosting at www.ImageShack.us

Personally I think the first style is easier to use if your not familiar with what your doing, can you get more simple then ‘search, click, click’ with a big set of buttons?

The second I really like because I think it makes best use of space and presents the most important information quickly.

The third, I think is probably a better choice since it combines #1 and #2’s ways of doing things into a fairly simple yet compact amount of space.

To be honest, I would kind of love docking / undocking elements and a very ‘cool’ look, like XFire or XMMS L&F with a Gimp or Designer style of operation but I think that would probably be a lot of work and a bit confusing to new people =/

searchlet prototypes

Oy’vey why does it have to be so easy to take a nap after chow with that dang couch =/

I suppose it is just as well that I’m finishing Dune tonight as I work because in this case the sleeper must awaken 😉

I’m trying to finish work on a routine to search the ports tree and generate the necessary stuff for a widget to display. The next phase is to experiment with how signals and slots workout through Python. Then build a more complete ‘searchlet’ module that can be integrated once the rest of work on the GUI is done. When I get a chance I’ll try to post a screen shot of the minimal searchlet in some portion of completion.

I’d also like to work on a few mock ups in designer or a few drawings in kolourpaint of possible configurations of the GUI.

edit:

I’ve basically finished the routine for searching the ports tree via psearch and getting it to display:

click to enlarge
Free Image Hosting at www.ImageShack.us

I think I’ve also figured out how to connect a C++ signal to a slot in the Python code but I’m still testing with that. The Signals & Slots mechanism is one thing that I do like a lot about QT. I’ve yet to use the Designer tool for any of this but for ease of use I probably will beyond test modules like the one pictured above.

I am using C++ documentation for most of this, so I am pretty dang glad that the best docs I’ve ever found in my time aroung computers has been the OpenBSD Manual, Vim’s :help stuff, and Trolltechs excellent offerings on qt documentation through the assistant program and the WWW. I also love that konqueror has qt, qt3, kde, and kde3 time saving web shortcuts like the wp (wikipedia) one I use so often.

Enter the Dragon

Well, so for work goes well for day one.

I’ve spent most of the day working on the configuration system, at this point it would be a lot easier to have a configuration file, so I set about to work with Pythons SafeConfigParser class and the format of the config file and options, e.t.c. There is still more to do but it is a great start, especially considering that I am not entirely comfortable with OOP under Python

I’d say greater then half the code for installing and updating the ports tree is done enough for further testing, the only issue right now is the reaction to errors sup’ing or portsnaping.

I am some what tempted to try and have a wrapper of sorts that will abstact the issue of using QT or KDE specifics but I don’t think there would be any point. I need to dig deeper into the PyQT/PyKDE, QT, and KDE documentation soon so I can work more gui_error.py.

widets ? qt : kde;

It would be nice to use as many elements of the KDE bindings as possible, so it fits better with systems running KDE, yet it would also be nice to keep to the QT bindings more strongly so it is less tied to KDE.. In the end it will probably be which ever I’m more comfortable with.

My primary goals in the coming days is to finish the options and errors modules while I start work on the ‘searchlet’, which should handle searching through ports. Until a concreate mock-up can be made of the entire main window, I think I should keep the search stuff as far away from the rest of the program as I can.

Work on the searchlet as I call it, shouldn’t be to hard to keep self-contained since I prefer to work on smaller pieces and properly prototype things when I can, I’m not a real fan of monolithic masses =

Basically 7 tenths of that battle will be wrapping my head around working with the KListView and QListView widgets. Once I’ve figured that out, it’ll be simple enough (I hope) to figureout how to make it work with displaying a search through ports. It’s just I need to get a grip on the ListView widgets before I can do that lol.

Either way, I think I have done enough for one day… 0700 Zulu Time and it would probably be nice to have a little sleep before work tomorrow 0.o

A little horsing around before bed, not pretty but considering I don’t know QT from a hole int he ground… And I’m doing this with C++ documentation for Python, I think it’s a nice ‘Hmm, how do you make a QListView object?” test:

#!/usr/bin/env python
# Neo Ports Manager (NPM) -- refer to the LICENSE file for terms and conditions

"""

"""
import sys, os
from qt import *


def main( argc, argv ):
a=QApplication( argv )
listViews=QListView()
listViews.resize(640,480)
listViews.setCaption("Qt Example - Listview") # Sets window title
# Add some columns to the list view
listViews.addColumn('Qualified name')
listViews.addColumn('Namespace')
# element is how to create a new list view item for display
element = QListViewItem(listViews, 'qName', 'namespaceURI')
# Now lets populate an array of items into view
els=[ [listViews, 'dir1', 'descr1'], [listViews, 'dir2', 'descr2'],
[listViews, 'dir3', 'descr3'] ]
for j in els:
QListViewItem(j[0], j[1], j[2])
# And sort it descending by col 1
listViews.setSorting( 1, False )


a.setMainWidget(listViews)

# draw & exec
listViews.show()
a.exec_loop()


if __name__ == "__main__":
main(len(sys.argv), sys.argv)

I don’t like that QListViewItem(j[0], j[1], j[2]) line but I was trying to translate from the C++,

for ( int i = 0 ; i < attributes.length(); i++ ) {
new QListViewItem( element, attributes.qName(i), attributes.uri(i) );
}

And I’ve yet to figure out how to better cook this up, still reading the docs here…

FreeBSD + Java?

How easy is it…

The JDK and JRE packages on the FreeBSD Foundation require the following to install and run correctly:

inputproto-1.4.2.1, javavmwrapper-2.3, kbproto-1.0.3, libICE-1.0.4,1, libSM-1.0.3,1, libX11-1.1.3,1, libXau-1.0.3_2, libXdmcp-1.0.2, libXext-1.0.3,1, libXi-1.1.3,1, libXp-1.0.0,1, libXt-1.0.5, libXtst-1.0.3, pkg-config-0.22, printproto-1.0.3, recordproto-1.13.2, xextproto-7.0.2, xproto-7.0.10_1, xtrans-1.0.4

If you run a Desktop based system with Xorg installed most of these are probably already there, on my laptop which has KDE 3.5.7 for the GUI all I had to do was install one package first:

pkg_add -r javavmwrapper

If you don’t have a required package it will tell you what you need to install when you try to pkg_add Java. Most probably can be pkg_add -r’d unless you want to the ports.

I then went over to the FreeBSD Foundation website to download Java

If you only want to run Java programs, you will need the JRE (Java Runetime Environment) but if you wish to develop Java programs you’ll require the JDK (Java Development Kit).

The packages currently are for FreeBSD 5.5/i386 and FreeBSD 6.1/i386 and amd64. Just download the one that matches your FreeBSD major branch and CPU Architecture. I fetched both JRE and JDK for FreeBSD 6.1/i386 which is about a 70MB download combined, my Laptop runs PC-BSD v1.4 so the underlaying system is FreeBSD 6.2-Stable, no problems so far.

You need to accept the license agreement to download and when you pkg_add, just scroll to the bottom and type ‘yes’ and press enter, you can probably use the shift+g command to jump to the bottom of the license.

I think because of the terms that the JRE/JDK were licensed for distro we’ve got to live with the manual download. Once you’ve got your packages downloaded, just do a :

pkg_add ./diablo-jdk-freebsd6.i386.1.5.0.07.01.tbz

of course replacing ./ with the path (if necessary) and the filename with the proper one. Tip: If you don’t want to typo it, use tab completion in your shell. I usually just download things to /tmp and cd over to it. You also need to be root in order to run pkg_add with any possibility of success. Depending on ones shell a ‘rehash’ command might also be needed before the programs can be found in the command prompt.

which tells me that java and javac are working, and it passed the test of compiling a small test program and running it.

Day dream

I don’t know if I can pull it off yet but I can try.

I find working this out in ASCII kind of fun compared to pencil and paper. I also get spell checking built in as you can see lol. Not that I can type during daylight hours ether.

Image Hosted by ImageShack.us

It would be cool to have a Ports managment tool thats really simple yet really powerful. Easy for newbie/guibies yet powerful enough to administer the system from.

Photo Op

PC-BSD 1.3/FreeBSD 6.1-Release and KDE 3.5.5. The system monitor is Gkrellm2, the console saver is cmatrix and the menu bar has a shredder and network browser applet installed.