Indywiki Developer Notes

File structure

indywiki.py : GUI logic and algorithms

qrc_resources.py contains the images (encoded) so it is not necessary to ship them on separate files

config.py has the user options (language of last visit, geometry of the application plus some other variables)

web1/ contains wikipedia.py, which is part of the nodebox web library for python. wikipedia.py does many of the queries to the wikipedia API.

Functions

Most of the widgets are initiated on their own classes (subclasses of main QT widgets) that are found on second half of indywiki.py and below (eg MYLINEEDIT(), MyTextBrowser2() etc)

so when the user enters a query, first_click() is called, that stores the value plus language (wikipedia site) on a list (Back button needs this), sets the mouse pointer as busy, makes a quick sanitization (replace(' ', '_')) and calls class first_click_zero().

['Samos City', 'http://upload.wikimedia.org/wikipedia/commons/thumb/a/ad/Samos.jpg/250px-Samos.jpg', '250', '188'] is a list (a native image, found on the article 'Samos Island'. The entries are:image title, image url, image weight, image width.

(u'Icaria', ['The village of Armenistis in the north between Nas and Evdilos', 'http://upload.wikimedia.org/wikipedia/commons/thumb/8/8a/Armenist%C3%ADs_ikar%C3%ADa.JPG/250px-Armenist%C3%ADs_ikar%C3%ADa.JPG', '250', '188']) on the other hand is a tuple and thus a non_native image (when we are searching at 'Samos Island' article and click on this, we get directed to article 'Icaria'). The entries are: article, and then a list with info for the article's first image.


WIKIPEDIA DATA

We get most Wikipedia data using the mediawiki API: We use getImages() to get a list with images from an article (if it contains any images). We don't use the Wikipedia Api here, since we want a)to avoid several images (for example Wikipedia related images, banners etc) and b)images to be at a minimum width/height combination, that we specify at config.py. The API doesn't provide us with this info (so far)



MISC

-number_of_ten = 0 after the first ten images are shown. Each time the next button is pressed, it gets increased by one.