Subject: Bug#92: ZeroDivisionError: float division by zero error on startup

From: Orion Poplawski <[email-masked]>
Date: Tue, 18 Dec 2012 10:03:17 -0700

Package: phoca-gui
Version: 0.2.1.1

$ pyhoca-gui
Traceback (most recent call last):
   File "/usr/bin/pyhoca-gui", line 375, in <module>
     main()
   File "/usr/bin/pyhoca-gui", line 363, in main
     thisPyHocaGUI = PyHocaGUI(args, logger, liblogger, appname=PROG_NAME, 
version=VERSION)
   File "/usr/lib/python2.7/site-packages/pyhoca/wxgui/frontend.py", line 222, 
in __init__
     wx.App.__init__(self, redirect=False, clearSigInt=False)
   File "/usr/lib64/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/_core.py", 
line 7981, in __init__
     self._BootstrapApp()
   File "/usr/lib64/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/_core.py", 
line 7555, in _BootstrapApp
     return _core_.PyApp__BootstrapApp(*args, **kwargs)
   File "/usr/lib/python2.7/site-packages/pyhoca/wxgui/frontend.py", line 243, 
in OnInit
     self.startGUI()
   File "/usr/lib/python2.7/site-packages/pyhoca/wxgui/frontend.py", line 299, 
in startGUI
     self.about = about.PyHocaGUI_AboutFrame(self, 
about_image=self.args.about_image)
   File "/usr/lib/python2.7/site-packages/pyhoca/wxgui/about.py", line 88, in 
__init__
     about_wximage.Rescale(400, 
int(float(400)/about_wximage.Width*about_wximage.Height))
ZeroDivisionError: float division by zero

-- 
Orion Poplawski
Technical Manager                     303-415-9701 x222
NWRA, Boulder Office                  FAX: 303-415-9702
3380 Mitchell Lane                       [email-masked]
Boulder, CO 80301                   http://www.nwra.com

---

From: Mike Gabriel <[email-masked]>
Date: Tue, 18 Dec 2012 21:57:20 +0100

tag #92 moreinfo
thanks

On Di 18 Dez 2012 18:03:17 CET Orion Poplawski wrote:

Hi Orion

>     thisPyHocaGUI = PyHocaGUI(args, logger, liblogger,  
> appname=PROG_NAME, version=VERSION)
>   File "/usr/lib/python2.7/site-packages/pyhoca/wxgui/frontend.py",  
> line 222, in __init__
>   File
"/usr/lib64/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/_core.py",
>   File
"/usr/lib64/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/_core.py",
>   File "/usr/lib/python2.7/site-packages/pyhoca/wxgui/frontend.py",  
> line 243, in OnInit
>     self.startGUI()
>   File "/usr/lib/python2.7/site-packages/pyhoca/wxgui/frontend.py",  
> line 299, in startGUI
>   File "/usr/lib/python2.7/site-packages/pyhoca/wxgui/about.py",
line
> 88, in __init__

It seems very likely that your pyhoca-gui instance does not find the  
image folder shipped with it.

Can you check that?

Greets,
Mike

-- 

DAS-NETZWERKTEAM
mike gabriel, rothenstein 5, 24214 neudorf-bornstein
fon: +49 (1520) 1976 148

GnuPG Key ID 0x25771B31
mail: [email-masked], http://das-netzwerkteam.de

freeBusy:
https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xfb

---

From: Orion Poplawski <[email-masked]>
Date: Tue, 18 Dec 2012 15:22:20 -0700

On 12/18/2012 01:57 PM, Mike Gabriel wrote:
>
> It seems very likely that your pyhoca-gui instance does not find the image
> folder shipped with it.
>
> Can you check that?

Ah, it seems setup.py doesn't do everything it needs to.  The attached patch I 
think does what is needed for the most part.  Doesn't handle the debian links 
file though.

Other notes:
- Categories in pyhoca-gui.desktop needs a trailing semicolon.
- There is /usr/bin/env python at the top of pyhoca/wxgui/messages.py, but I 
imagine that file isn't meant to be executed directly.

Finally, I seem to be able to connect to the server properly, but no window 
ever appears, and no errors.

Seems to be stuck in this loop:

pyhoca-gui[15357] (x2goguardian-pylib) DEBUG: Entering X2Go Guardian client 
management loop...
pyhoca-gui[15357] (x2gocontrolsession-pylib) INFO: executing command on X2Go 
server ,,Vulcan'': sh -c "export HOSTNAME && x2golistsessions"
pyhoca-gui[15357] (x2gocontrolsession-pylib) INFO: executing command on X2Go 
server ,,Vulcan'': sh -c "export HOSTNAME && x2golistmounts 
orion-51-1355520763_stDXFCE_dp24"

[orion@vulcan ~]$ sh -c "export HOSTNAME && x2golistmounts 
orion-51-1355520763_stDXFCE_dp24"
orion orion

[orion@vulcan ~]$

-- 
Orion Poplawski
Technical Manager                     303-415-9701 x222
NWRA, Boulder Office                  FAX: 303-415-9702
3380 Mitchell Lane                       [email-masked]
Boulder, CO 80301                   http://www.nwra.com
diff -up pyhoca-gui-0.2.1.1/debian/pyhoca-gui.install pyhoca-gui-0.2.1.1/debian/pyhoca-gui
diff -up pyhoca-gui-0.2.1.1/setup.py.install pyhoca-gui-0.2.1.1/setup.py
--- pyhoca-gui-0.2.1.1/setup.py.install	2012-12-18 15:02:38.406371984 -0700
+++ pyhoca-gui-0.2.1.1/setup.py	2012-12-18 15:10:04.304695211 -0700
@@ -171,6 +171,40 @@ elif platform.system() == 'Linux':
             "clean": clean_i18n.clean_i18n,
         }
     )
+    data_files.extend([('/usr/share/applications', glob('desktop/*')),
+                       ('/usr/share/man/man1', glob('man/man1/*.1')),
+                       ('/usr/share/pixmaps', glob('pixmaps/*.svg')),
+                       ('/usr/share/pyhoca/img', glob('img/*.png')),
+                       ('/usr/share/icons/PyHoca/16x16', glob('icons/PyHoca/16x16/applications-*.png')),
+                       ('/usr/share/icons/PyHoca/16x16', glob('icons/PyHoca/16x16/pyhoca*.png')),
+                       ('/usr/share/icons/PyHoca/16x16', glob('icons/PyHoca/16x16/x2go*.png')),
+                       ('/usr/share/icons/PyHoca/16x16', glob('icons/PyHoca/16x16/question.png')),
+                       ('/usr/share/icons/PyHoca/22x22', glob('icons/PyHoca/22x22/applications-*.png')),
+                       ('/usr/share/icons/PyHoca/22x22', glob('icons/PyHoca/22x22/pyhoca*.png')),
+                       ('/usr/share/icons/PyHoca/22x22', glob('icons/PyHoca/22x22/x2go*.png')),
+                       ('/usr/share/icons/PyHoca/22x22', glob('icons/PyHoca/22x22/question.png')),
+                       ('/usr/share/icons/PyHoca/32x32', glob('icons/PyHoca/32x32/pyhoca*.png')),
+                       ('/usr/share/icons/PyHoca/32x32', glob('icons/PyHoca/32x32/x2go*.png')),
+                       ('/usr/share/icons/PyHoca/32x32', glob('icons/PyHoca/32x32/question.png')),
+                       ('/usr/share/icons/PyHoca/32x32', glob('icons/PyHoca/32x32/broom-cleanup.png')),
+                       ('/usr/share/icons/PyHoca/48x48', glob('icons/PyHoca/48x48/pyhoca*.png')),
+                       ('/usr/share/icons/PyHoca/48x48', glob('icons/PyHoca/48x48/x2go*.png')),
+                       ('/usr/share/icons/PyHoca/48x48', glob('icons/PyHoca/48x48/question.png')),
+                       ('/usr/share/icons/PyHoca/64x64', glob('icons/PyHoca/64x64/pyhoca*.png')),
+                       ('/usr/share/icons/PyHoca/64x64', glob('icons/PyHoca/64x64/x2go*.png')),
+                       ('/usr/share/icons/PyHoca/64x64', glob('icons/PyHoca/64x64/question.png')),
+                       ('/usr/share/icons/PyHoca/128x128', glob('icons/PyHoca/128x128/pyhoca*.png')),
+                       ('/usr/share/icons/PyHoca/128x128', glob('icons/PyHoca/128x128/x2go*.png')),
+                       ('/usr/share/icons/PyHoca/128x128', glob('icons/PyHoca/128x128/question.png')),
+                       ('/usr/share/icons/PyHoca/scalable', glob('icons/PyHoca/scalable/pyhoca*.svg')),
+                       ('/usr/share/icons/PyHoca/scalable', glob('icons/PyHoca/scalable/x2go*.svg')),
+                       ('/usr/share/icons/PyHoca/scalable', glob('icons/PyHoca/scalable/question.svg')),
+                       ('/usr/share/icons/PyHoca/scalable', glob('icons/PyHoca/scalable/broom-cleanup.svg')),
+                       # these 64x64 icons are missing in gnome-colors-common
+                       ('/usr/share/icons/PyHoca/64x64', glob('icons/PyHoca/64x64/dialog-apply.png')),
+                       ('/usr/share/icons/PyHoca/64x64', glob('icons/PyHoca/64x64/dialog-error.png')),
+                       ('/usr/share/icons/PyHoca/64x64', glob('icons/PyHoca/64x64/dialog-question.png')),
+                       ('/usr/share/icons/PyHoca/64x64', glob('icons/PyHoca/64x64/dialog-warning.png'))])
 
 setup(
     name = PROGRAM_NAME,

---

From: Mike Gabriel <[email-masked]>
Date: Thu, 20 Dec 2012 09:59:54 +0100

retitle #92 Install icons, images, man page and desktop files through setup.py
tag #92 pending
thanks

Hi Orion,

On Di 18 Dez 2012 23:22:20 CET Orion Poplawski wrote:

> Ah, it seems setup.py doesn't do everything it needs to.  The  
> attached patch I think does what is needed for the most part.   
> Doesn't handle the debian links file though.

I have added two commits for that to X2Go Git, can you cross-check that?

First one (unfortunately a dirty commit, see at the botton):
http://code.x2go.org/gitweb?p=pyhoca-gui.git;a=commitdiff;h=51c52fb1b0d3f94c6cc9c1d42fe5f84674e6026e

Then for the symlinks:
http://code.x2go.org/gitweb?p=pyhoca-gui.git;a=commitdiff;h=052916c4ea0d523a6db253b4f0ffe394d932aab9

> - Categories in pyhoca-gui.desktop needs a trailing semicolon.

Done!
http://code.x2go.org/gitweb?p=pyhoca-gui.git;a=commitdiff;h=1a1ab1dbd055d31ec639da9ddf815afc7a55d86f

> - There is /usr/bin/env python at the top of  
> pyhoca/wxgui/messages.py, but I imagine that file isn't meant to be  
> executed directly.

Done!
http://code.x2go.org/gitweb?p=pyhoca-gui.git;a=commitdiff;h=6cdc40a31c8ca51ac9feade208cea13a9157308c

> Finally, I seem to be able to connect to the server properly, but no  
> window ever appears, and no errors.

I will answer that off-BTS as it is not part of this bug report, actually.

Greets,
Mike

-- 

DAS-NETZWERKTEAM

GnuPG Key ID 0x25771B31

freeBusy: