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