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…