Author Topic: [FIXED] Leiche took over [pygtk-shutdown]  (Read 1635 times)

Offline Archie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8821
  • Aurum nostrum non est aurum vulgi.
[FIXED] Leiche took over [pygtk-shutdown]
« on: September 08, 2011, 06:12:16 PM »
I did not have any spare machine to test 64-bit so I installed it on my VAIO that had my build environment, thinking I would be OK.

Melodie emailed me about our little collaboration, and informed her that I still haven't set up for 64-bit. So I am asking any other packager if they would like to take over because there's some tone of urgency in Melodie's email. She suggested Leiche because both of them already have collaborations.

The package is a small patched pygtk-shutdown. The SRPM is available at http://ge.tt/8ncDHa7?c so if anyone ... please post your interest on this thread.

Thank you.

In addition, can anyone assist me in setting up a packaging environment in 64-bit? Thanks again.

Archie.
« Last Edit: September 09, 2011, 07:47:27 PM by Archie »
Since 2006 | LiCo 401868 | Bare Metal | What is necessary is never unwise. --Sarek, 2258.42


Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15829
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Need someone to take over
« Reply #1 on: September 08, 2011, 06:26:48 PM »
Archie,
Kori has packaged the pkgutils packages for 64bit. They're in Dropbox > SRPM > x86_64.


Offline Archie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8821
  • Aurum nostrum non est aurum vulgi.
Re: Need someone to take over
« Reply #2 on: September 08, 2011, 10:01:12 PM »
Thanks, Neal. One, I cannot access Dropbox. Two, I think Melodie needed the pygtk-shutdown in 32-bit (which I no longer have).

Do you think you can pull in the RPMs for pkgutils and store it somewhere more accessible? Thanks.
Since 2006 | LiCo 401868 | Bare Metal | What is necessary is never unwise. --Sarek, 2258.42


Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15829
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Need someone to take over
« Reply #3 on: September 08, 2011, 10:47:22 PM »
Thanks, Neal. One, I cannot access Dropbox. Two, I think Melodie needed the pygtk-shutdown in 32-bit (which I no longer have).

Do you think you can pull in the RPMs for pkgutils and store it somewhere more accessible? Thanks.

Forgot about the dropbox access thing. Sorry. I sent you a PM.     

Offline Archie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8821
  • Aurum nostrum non est aurum vulgi.
Re: Need someone to take over
« Reply #4 on: September 08, 2011, 11:02:21 PM »
No apologies, Master Obiwan. ;)

Looking forward to the 64-bit packaging ... but I still have to deal with Melodie's 32-bit pygtk-shutdown.   :-\
Since 2006 | LiCo 401868 | Bare Metal | What is necessary is never unwise. --Sarek, 2258.42


Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15829
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Need someone to take over
« Reply #5 on: September 08, 2011, 11:08:42 PM »
Archie,
One word. Virtualbox.     

Offline daniel

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3794
  • God knows, i'm not an Angel!
    • Tipps und Tricks
Re: Need someone to take over
« Reply #6 on: September 08, 2011, 11:47:58 PM »
No apologies, Master Obiwan. ;)

Looking forward to the 64-bit packaging ... but I still have to deal with Melodie's 32-bit pygtk-shutdown.   :-\

Is need 32bit Version?
I will look about it...

Offline Archie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8821
  • Aurum nostrum non est aurum vulgi.
Re: Need someone to take over
« Reply #7 on: September 08, 2011, 11:52:24 PM »
Archie,
One word. Virtualbox.     

Shiver.... ;)

I guess I'd have to reinstall the stable 32-bit over the test 64-bit. ;)

Tex is right (as always) ... ain't gonna get anything from these except double the work. Hey, I ain't complaining. ;D

More fun!

@ Leiche, will you please? I am still having problems with my 64-bit test that I haven't reported yet. Plus I need to clear some more space on my HD. Thanks.
Since 2006 | LiCo 401868 | Bare Metal | What is necessary is never unwise. --Sarek, 2258.42


Offline daniel

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3794
  • God knows, i'm not an Angel!
    • Tipps und Tricks
Re: Need someone to take over
« Reply #8 on: September 08, 2011, 11:57:06 PM »
Yes, i do....
 :)

EDit:
Is packed, but get an error, when i will start it
Code: [Select]
shutdown-dialog.py
/usr/bin/env: python2: Datei oder Verzeichnis nicht gefunden
Is python2 missing?
« Last Edit: September 09, 2011, 12:01:39 AM by Leiche »

Offline Archie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8821
  • Aurum nostrum non est aurum vulgi.
Re: Need someone to take over [pygtk-shutdown]
« Reply #9 on: September 08, 2011, 11:58:50 PM »
Let me know how it goes ... thanks, Leiche.

All she (Melodie) wanted was to repatch the script. You should get in touch with her.
« Last Edit: September 09, 2011, 12:01:10 AM by Archie »
Since 2006 | LiCo 401868 | Bare Metal | What is necessary is never unwise. --Sarek, 2258.42


Offline daniel

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3794
  • God knows, i'm not an Angel!
    • Tipps und Tricks
Re: Need someone to take over [pygtk-shutdown]
« Reply #10 on: September 09, 2011, 12:02:01 AM »
see my edit  ;)

Offline Archie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8821
  • Aurum nostrum non est aurum vulgi.
Re: Need someone to take over [pygtk-shutdown]
« Reply #11 on: September 09, 2011, 12:07:34 AM »
I believe it was already fixed in the script.

Hmmmm ... the RPM build for that SRC package already worked. Lemme check my emails with Melodie. I'll get back to you. Maybe we could do this on email as well - pclinuxos dot ph at gmail dot com.
Since 2006 | LiCo 401868 | Bare Metal | What is necessary is never unwise. --Sarek, 2258.42


Offline melodie

  • Hero Member
  • *****
  • Posts: 5945
  • Internet Relay Chat sur Freenode
    • PCLinuxOS Fr
Re: Need someone to take over
« Reply #12 on: September 09, 2011, 11:44:09 AM »
Yes, i do....
 :)

EDit:
Is packed, but get an error, when i will start it
Code: [Select]
shutdown-dialog.py
/usr/bin/env: python2: Datei oder Verzeichnis nicht gefunden
Is python2 missing?


Hi Leiche,

Here is the last "python.patch" for this package:

Code: [Select]
--- pygtk-shutdown.orig    2011-08-16 11:43:21.000000000 +0200
+++ pygtk-shutdown    2011-08-16 12:42:32.510479395 +0200
 @@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python
# -*- coding: utf-8 -*-

# pygtk-shutdown - logout/reboot/shutdown your computer with an

Thank you for taking care of it.

I am willing to test the new package whenever it will be ready.

Thanks, thanks to Archie too !

Regards,
Mélodie



melodie at #lpic-fr on irc.freenode.net

Offline daniel

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3794
  • God knows, i'm not an Angel!
    • Tipps und Tricks
Re: Need someone to take over [pygtk-shutdown]
« Reply #13 on: September 09, 2011, 11:52:15 AM »
is packed with your patch

see my messages ↓

Code: [Select]
shutdown-dialog.py
/usr/bin/env: python2: Datei oder Verzeichnis nicht gefunden
[leiche@leiche ~]$ cat /usr/bin/shutdown-dialog.py
#!/usr/bin/env python2
# -*- coding: utf-8 -*-

# pygtk-shutdown - logout/reboot/shutdown your computer with an
# easy-to-use dialog, with minimal dependencies
# Version: 1.0
# Copyright (C) 2011 doorknob60 <doorknob60 at gmail dot com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

import pygtk
pygtk.require("2.0")
import gtk

import os
import sys
import subprocess
import time

LOGOUT_COMMAND = "openbox --exit"

class ShutdownDialog:
    def __init__(self):
        iconsize = gtk.icon_size_register("64x64", 64, 64)

        self.window = gtk.Window()
        self.window.set_decorated(False)
        self.window.set_keep_above(True)

        self.frame1 = gtk.Frame()
        self.frame2 = gtk.Frame()

        self.layoutBox = gtk.VBox(False, 5)
        self.layoutBox.set_border_width(5)
        self.buttonsBox1 = gtk.HBox(True, 5)
        self.buttonsBox2 = gtk.HBox(True, 5)
        self.buttonsBox1.set_border_width(5)
        self.buttonsBox2.set_border_width(5)
        self.cancelButtonAlignment = gtk.Alignment(1.0, 0.5)

        self.logoutButton = gtk.Button("Logout")
        ico = gtk.Image()
        ico.set_from_icon_name("gnome-logout", iconsize)
        self.logoutButton.set_image(ico)

        self.restartButton = gtk.Button("Restart")
        ico = gtk.Image()
        ico.set_from_icon_name("gnome-session-reboot", iconsize)
        self.restartButton.set_image(ico)

        self.haltButton = gtk.Button("Shutdown")
        ico = gtk.Image()
        ico.set_from_icon_name("gnome-shutdown", iconsize)
        self.haltButton.set_image(ico)

        self.cancelButton = gtk.Button(None, gtk.STOCK_CANCEL)

        self.buttonsBox1.pack_start(self.logoutButton)
        self.buttonsBox2.pack_start(self.restartButton)
        self.buttonsBox2.pack_start(self.haltButton)
        self.cancelButtonAlignment.add(self.cancelButton)
        self.frame1.add(self.buttonsBox1)
        self.frame2.add(self.buttonsBox2)
        self.layoutBox.pack_start(self.frame1)
        self.layoutBox.pack_start(self.frame2)
        self.layoutBox.pack_start(self.cancelButtonAlignment)

        self.window.add(self.layoutBox)

        self.window.show_all()

        self.window.set_gravity(gtk.gdk.GRAVITY_NORTH_WEST)
        w, h = self.window.get_size()
        self.window.move(gtk.gdk.screen_width() / 2 - w / 2,
gtk.gdk.screen_height() / 2 - h / 2)

        self.window.connect("delete-event", self.terminate)
        self.cancelButton.connect("clicked", self.terminate)

        self.logoutButton.connect("clicked", self.logout)
        self.restartButton.connect("clicked", self.reboot)
        self.haltButton.connect("clicked", self.shutdown)

    def main(self):
        gtk.main()

    def terminate(self, widget = None, data = None):
        gtk.main_quit()

    def logout(self, widget = None, data = None):
        self.callcmd(LOGOUT_COMMAND)

    def shutdown(self, widget = None, data = None):
        self.callcmd("dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop")

    def reboot(self, widget = None, data = None):
        self.callcmd("dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart")


    def callcmd(self, cmd):
        proc = subprocess.Popen(cmd, stdout = subprocess.PIPE, stderr =
                subprocess.PIPE, shell = True)
        starttime = time.time() * 1000

        status = proc.poll()
        while status is None and time.time() * 1000 < starttime + 5000:
            status = proc.poll()

        if status is None:
            if sys.hexversion >= 0x02060000:
                proc.kill()
            else:
                subprocess.Popen("kill -9 " + str(proc.pid), shell = True)

        if status != 0:
            subprocess.Popen(cmd, shell = True)

        self.terminate()

def main():
    shutdownDialog = ShutdownDialog()
    shutdownDialog.main()

if __name__ == "__main__":
    LOGOUT_COMMAND = os.getenv("LOGOUT_COMMAND", LOGOUT_COMMAND)

    if len(sys.argv) > 1:
        LOGOUT_COMMAND = " ".join(sys.argv[1:])

    main()
[leiche@leiche ~]$

I'm not sure whats wrong...

« Last Edit: September 10, 2011, 01:27:53 PM by Leiche »

Offline melodie

  • Hero Member
  • *****
  • Posts: 5945
  • Internet Relay Chat sur Freenode
    • PCLinuxOS Fr
Re: Need someone to take over [pygtk-shutdown]
« Reply #14 on: September 09, 2011, 01:06:55 PM »
Leiche, the line 1:
#!/usr/bin/env python2

must be
#!/usr/bin/env python

Then it has to work.

Thanks,
Mélodie

melodie at #lpic-fr on irc.freenode.net