diff options
Diffstat (limited to 'usr/share/mageiawelcome/helpers.py')
-rw-r--r-- | usr/share/mageiawelcome/helpers.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/usr/share/mageiawelcome/helpers.py b/usr/share/mageiawelcome/helpers.py new file mode 100644 index 0000000..027da77 --- /dev/null +++ b/usr/share/mageiawelcome/helpers.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- + + +import csv +import os + + +def get_listapp(): + listapp = '' + with open("apps.csv", 'rb') as f: + mycsv = csv.reader(f,delimiter='|') + mycsv.next() + for r in mycsv: + if (r[6] == 'false'): + start_btn = "" + else: + start_btn = "<button class='cmd small pill green' data-run='"+ r[6] + "'><i class='icon-ok-sign'> </i> start</button>" + if (r[7] != ''): + label = "<span class='label red'>" + r[7] + "</span>" + else: + label = "" + if ( not os.path.isfile(r[5])):# DO ZAINSTALOWANIA + listapp += "<li class='" + r[3] +"' id='" + r[0] + "'><img class=icon src=img/" + r[0] + ".png /> \ +<h6>" + r[2] + "</h6><p class=description>" + r[4] + "</p>" + start_btn + label + "<button class='inst small pill' data-rpm='" + r[1] + "'><i class='icon-circle-arrow-down'> </i> install</button></li>" + else: # JEST ZAINSTALOWANY + listapp += "<li class='urpme " + r[3] +"' id='" + r[0] + "'><img class=icon src=img/" + r[0] + ".png /> \ +<h6>" + r[2] + "</h6><p class=description>" + r[4] + "</p>" + start_btn + label + "<button class='uninst small pill red' data-rpm='" + r[1] + "'><i class='icon-minus-sign'> </i> remove</button></li>" + return listapp +
\ No newline at end of file |