brunolojor / jbrout

Automatically exported from code.google.com/p/jbrout
0 stars 0 forks source link

doesn't start #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. install jbrout and run it
2. observe crash
3.

[matej@viklef redhat]$ jbrout
Traceback (most recent call last):
  File "/usr/share/jbrout/jbrout.py", line 68, in <module>
    from jbrout.common import
cd2rd,cd2d,format_file_size_for_display,runWith,openURL # for selecteur
  File "/usr/share/jbrout/jbrout.py", line 51, in <module>
    __builtins__.__dict__["_"] =
createGetText("jbrout",os.path.join(os.path.dirname(__file__), 'po'))
AttributeError: 'dict' object has no attribute '__dict__'
[matej@viklef redhat]$ python --version
Python 2.5.2
[matej@viklef redhat]$ 

What is the expected output? What do you see instead?
running jbrout

What version of the product are you using? On what operating system?
svn133

Please provide any additional information below.
Tried to change the line to

    __builtins__["_"] =
createGetText("jbrout",os.path.join(os.path.dirname(__file__), 'po'))

and it didn't help either:
it says, that __builtins__ doesn't allow changes of attributes.

Original issue reported on code.google.com by matej.c...@gmail.com on 1 Jan 2009 at 9:52

GoogleCodeExporter commented 9 years ago
A weird thing is that when I cd into BUILD directory and run ./jbrout.py there
everything starts without a problems.

Original comment by matej.c...@gmail.com on 1 Jan 2009 at 9:54

GoogleCodeExporter commented 9 years ago
on debian systems ...
the bash file "jbrout" is located in /usr/bin
and jbrout core files (py, gfx, plugins ..) are in /usr/lib/jbrout

I really think it's that the trouble (except dict problem (btw, I've got python 
2.5.2
too))
I'm not really aware about fedora/rpms systems ...

It seems that your core files are in "/usr/share/jbrout" ... why ?
(the rpm should install them in /usr/lib/jbrout ... no ?)

Original comment by manat...@gmail.com on 6 Jan 2009 at 6:51

GoogleCodeExporter commented 9 years ago
All code in /usr/lib is platform-specific, /usr/share is not; remember, 
comparing to
other Linux distributions, Red Hat distros are actually really able to work with
multiple platforms running at once -- x86_64/i386 (or ppc64/ppc) is actually
something which is happening quite often. Therefore the separation between
platform-specific and platform-neutral code is critical for success.

So yes, the main jbrout tree is /usr/share/jbrout and my /usr/bin/jbrout is

#!/bin/sh
APPPATH=/usr/share/jbrout/jbrout.py

PYTHON=`which python`
if [ $? != 0 ]; then
    echo "jbrout requires Python >= 2.4 to be installed." >/dev/stderr
    exit 1
fi

"$PYTHON" "$APPPATH" "$@"

Should I change this to something like

cd /usr/share/jbrout
./jbrout.py "$@"

???

Original comment by matej.c...@gmail.com on 6 Jan 2009 at 11:08

GoogleCodeExporter commented 9 years ago
the original (which is in the deb) jbrout bash file looks like this :
-------------------------------------------------
#!/bin/sh
path=`which jbrout` # to obtain self path
path=`dirname $path` # cd ..
path=`dirname $path` # cd ..

APPPATH=$path/lib/jbrout/jbrout.py

python "$APPPATH" "$@"
-------------------------------------------------
here, it will try to locate relativly the real jbrout.py, according the path of 
itself.

You should adapt your APPPATH to point to your "share" no ?

BTW, if you got a better way to do this kind of things, or if you are able to 
make an
universal version : I take, for sure ;-)

Original comment by manat...@gmail.com on 8 Jan 2009 at 10:40

GoogleCodeExporter commented 9 years ago
Well, strictly speaking -- when doing packages for distro, I could actually live
pretty well just with 

#!/bin/sh
python /usr/share/jbrout/jbrout.py "$@"

or even

ln -sf /usr/share/jbrout/jbrout.py /usr/bin/jbrout

because I don't have to guess where my files are and what version python is 
(there is
Requires: in rpm for that).

The question remains, does jbrout needs to be in /usr/share/jbrout when it is 
being
started, so shouldn't I do

cd /usr/share/jbrout
./jbrout.py "$@"

instead?

Original comment by matej.c...@gmail.com on 8 Jan 2009 at 2:01

GoogleCodeExporter commented 9 years ago
jBrout needs to be in /usr/share/jbrout when it is being started !
(in fact jbrout.py should, from itself, place cwd in its current dir ... so you
shouldn't need to make the cd in the bash runner ... but it seems the trouble is
perhaps here, should don't cwd to itself)

Original comment by manat...@gmail.com on 8 Jan 2009 at 2:07

GoogleCodeExporter commented 9 years ago
I think that would be better. However, apparently the biggest problem was 
something
wrong with my build scripts. Now, when I have fixed it, jbrout now works. And 
yes,
even then I need to cd /usr/share/jbrout to get jbrout working. I really 
believe that
jbrout.py should do os.chdir() there.

Original comment by matej.c...@gmail.com on 8 Jan 2009 at 5:17

GoogleCodeExporter commented 9 years ago
> I really believe that jbrout.py should do os.chdir() there.

it does it, see line 31 !

I close the issue

Original comment by manat...@gmail.com on 8 Jan 2009 at 5:35