Ok,

You clearly did not see my mail :-)

I'll wait till tomorrow morning, and see how far you got. Some remarks, and some problems:

1/ you could have easily used the perl script like for pygi to convert all
from gen
into
from gramps.gen

As well as some other changes.

I did that locally, but it creates all conflicts now with your one at a time changes on svn up.

2/In gui, you should not write
from gramps.gui....
Instead, import should be relative.

So if in same directory:
from .here import
from ..onedirup import
from ...twodirup import

3/ note that by doing one change at a time, gramps is not working in trunk. You converted some pieces, and others not yet, so as a consequence, some code is imported twice now, once via gramps.gui and once via gui, causing errors.  So, before you stop, you should test if gramps actually is working in trunk  :-)

Benny





2012/10/2 Benny Malengier <benny.malengier@gmail.com>
Nick,

I have some changes also ready. Did them while watching my daughter at the gym.
However, don't know where you are in changing things....

Benny

2012/10/2 Nick Hall <nick__hall@hotmail.com>
Benny,

I'll start working on this now, unless you email me back to stop.

In addition, I suggest that we move the grampsapp.py code into __init__.py, this will allow us to start Gramps with:

import gramps
gramps.main()

When I have finished, I'll also remove your temporary workaround.

Nick.



On 30/09/12 20:33, Benny Malengier wrote:
All,

With the change to gramps as a pure python module, we need a guideline on imports. You find it here:

http://www.gramps-project.org/wiki/index.php?title=Programming_guidelines#Imports

Current Gramps in trunk does not yet satisfy this, so I will be working following days to bring all pieces in line. Feel free to help me!
Once this is done, I will remove the sys.path.append trick which is now in Gramps.py, as that is the reason it works at the moment.

So, all imports should start with
import gramps......
or be relative imports.

No relative imports allowed between gen, cli, gui and plugins submodules.

The idea is, is then the following works:

benny@dell:~$ PYTHONPATH=~/gramps/trunk/build/lib.linux-x86_64-2.7/ python
Python 2.7.3 (default, Aug  1 2012, 05:14:39)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from gramps.gen.lib import Date
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/benny/gramps/trunk/build/lib.linux-x86_64-2.7/gramps/gen/lib/__init__.py", line 75, in <module>
    from markertype import MarkerType
  File "/home/benny/gramps/trunk/build/lib.linux-x86_64-2.7/gramps/gen/lib/markertype.py", line 34, in <module>
    from gen.ggettext import gettext as _
ImportError: No module named gen.ggettext
>>>

Clearly it doesn't work yet :-)

Benny



------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://ad.doubleclick.net/clk;258768047;13503038;j?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html


_______________________________________________
Gramps-devel mailing list
Gramps-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gramps-devel


------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev

_______________________________________________
Gramps-devel mailing list
Gramps-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gramps-devel