Gdesklets Help (again)

I finally got gDesklets installed alright (I think).

Whenever I try to install a sensor though (using the .bin file), I get a tar/gz error, saying the file could not be decompressed.

My Tar and Gzip packages are working fine.

Anyone have any ideas?

#54584

grats on that mod status contra :)

now with your problem...

warning my python knowledge is poor in the best of the cases

the tar files are encapsulated in a base 64 encoded string embedded in the .bin files, the header of the script contains a function that trys to untar and install this.

def install(data, destination, no_message, list_only):

                                                                               

    try:

        archive = base64.decodestring(data)

    except:

        if (no_message): print ERROR_B64

        else: message(ERROR_B64, "error")

        sys.exit(1)

                                                                               

    tmp = tempfile.mktemp()

    fd = open(tmp, "w")

    fd.write(archive)

    fd.close()

    if (list_only):

        cmd = "mkdir -p %(destination)s; cd %(destination)s; " \

              "LANG=C tar -tzf %(tmp)s 2>&1"

    else:

        cmd = "mkdir -p %(destination)s; cd %(destination)s; " \

              "LANG=C tar -xzvf %(tmp)s 2>&1"

    fail, out = commands.getstatusoutput(cmd % vars())

    os.unlink(tmp)

                                                                               

    if (fail):

        if (no_message): print ERROR_TAR + out

        else: message(ERROR_TAR + out, "error")

        sys.exit(1)

                                                                               

    print out

    if (not list_only):

        if (no_message): print SUCCESS

        else: message(SUCCESS, "info")

                                                                               

                                                                               

                                                                               

# the tarball in base64 encoding

it trys to run whatever is the variable cmd in this case

cmd = "mkdir -p %(destination)s; cd %(destination)s; " \

              "LANG=C tar -xzvf %(tmp)s 2>&1"

%(tmp) are the contents of the base 64 embedded file extracted to a tmp file in a tmp directory, there are a few posibilities that can explain what it happening to you, I believe python is not able to correctly decode the file, so tar can't see if it is a tar file and bombs out.

as for how to verify this... I am trying to figure out how to write the contents of the embedded tar to a real file instead of a tmp file so you can try and see what you get.

more to come.....

#54606

Thanks, I would really appreciate this.

Damn this gDesklets is driving me crazy. Well, it LOOKS cool at least. <_<

#54611

god I hate python...

Contra, make this changes to one of the .bin files.

look for this

    tmp = tempfile.mktemp()

    fd = open(tmp, "w")

    fd.write(archive)

    fd.close()

and right after put "print tmp"

python is very an$$retentive about tabs and spaces so use whatever they used to created the file and in the same amounts.. i.e. if they used 5 spaces put 5 spaces.. if they used 2 tabs use 2 tabs.

now a few lines down you can find..

os.unlink(tmp)

remove that line.

run the bin and look for something that looks like: /tmp/@18072.0 and do a file on that.

if the file doesn't exist or is empty your python can't extract the file for some reason.. maybe an old version of python? if the file is there do a "file" on it and see if it returns:

@18072.0: gzip compressed data, from Unix

remember to scape the @

and try to untar if it does... if all that works and nothing failed.. well.. I'll keep looking.

#54623

The tarball (from both the /tmp directory, and running the .bin) comes up with those corrupted tarball errors when trying to extract.

This is on a lot of sensors, so I dont know what the problem is.

#54624

what version of python are you running? I am running 2.2.2 and works fine. Type python and see what it says.

To get out of python you have to ctrl-d

#54653

Python 2.3. gDesklets recommends Python 2.3.

#54670

the only thing that I can think off is that your python is creating corrupted tar files, how to fix it.. no clue :( I hate python even more that I hate perl... ruby rules

I can give you my .gdesklets directory with the sensors but that will not help you in the long run. stop playing with this wierd linux falvors and come back to the dark side (slackware) :P

#54742

OK, turns out that the Sensors still install, even though I get that error.

So it works now. :D

Question: How do you move Displays? The Weather one is right in the middle of my screen, annoying.

#54792

middle click and then drag them that way.

#54813

Wow, im an idiot.

Thanks.

The weather desklet is so cool.

Their man page definitly needs some work though.

#54824