← Back to team overview

screenlets-dev team mailing list archive

Small Modifications

 

Hello guys, My name is Tareq Al Jurf, from the Fedora Team
I've just joined the team and I made some modifications which I want to
present here before applying anything.

First of all, in the screenlets-manager.py:
It used to use the gtkTooltips class which is old and buggy, so i replaced
that with the new gtkTooltip.

Second, in the lib file __init__.py, i replaced

DEBIAN = subprocess.call("which dpkg >/dev/null", shell=True)==0


UBUNTU = subprocess.call("which apt-add-repository >/dev/null", shell=True)==0



with

DEBIAN = True
try:
    subprocess.call(["dpkg"], stdout=open(os.devnull, 'w'),
stderr=subprocess.STDOUT)
except OSError:
    DEBIAN = False

UBUNTU = True
try:
    subprocess.call(["apt-add-repository"], stdout=open(os.devnull, 'w'),
stderr=subprocess.STDOUT)
except OSError:
    UBUNTU = False

Since this causes errors for non-ubuntu systems, and I've been told that
using "which" and "shell=True" is not a good idea.
If something seems wrong please inform me.

Regards

-- 
Tareq Al Jurf
Fedora Ambassador
Riyadh, Saudi Arabia
taljurf@xxxxxxxxxxxxxxxxx