2012/12/30 Peter Landgren <peter.talken@telia.com>
> revision 20889 fixes the divisionbyzero.
> You will see a warning about that on the terminal, it still needs to be
> investigated what creates the callback with a zero total.
Any test I can do?

Probably the error Gary found means we cannot read lines in the xml documents anymore. However, reading it as an xml, that makes no difference as the xml elements are still correct.

Benny
 

Got one warning. XML import OK.
Progress bar shows always "full" during import.

/Peter

> Benny
>
>
> 2012/12/30 Benny Malengier <benny.malengier@gmail.com>
>
> > The first error is a typical python 3 error, division by 0 now always
> > gives an errors, not so in python2.
> > Is this an xml with no data in it?
> > I'll add a test to avoid division by 0.
> >
> > On the second error, can you translate the error in English?
> >
> > Benny
> >
> >
> > 2012/12/30 Peter Landgren <peter.talken@telia.com>
> >
> >> Den Sunday 30 December 2012 16.21.12 skrev Benny Malengier:
> >> > Peter,
> >> > svn up, I improved the version output on -v
> >> >
> >> > Even without that, problems with GTK3 drawing are normally due to
> >> > cairo issues. You should notify Mageia that there are problems.
> >> > On Ubuntu 12.10 pycairo is still 1.8.8, which is really old (2009),
> >>
> >> while
> >>
> >> > you use the very latest 1.10.0
> >> > If you now use -v, you will see the cairo version also, Ubuntu 12.10
> >> > is
> >>
> >> on
> >>
> >> > 1.12.3
> >> >
> >> > On python3, the versions are cairo     : 1.12.3,  pycairo   : 1.10.0
> >> >
> >> > So, please test if the problems exist also on python3, and if not,
> >>
> >> perhaps
> >>
> >> > write them to stick for python 2.7 with the old versions.
> >>
> >> Got bsddb3 installed and running:
> >>   python    : 3.3.0
> >>
> >>  gramps    : trunk
> >>  gtk++     : 3.6.2
> >>  gobject   : 3.4.2
> >>  pango     : 1.32.5
> >>  Using bsddb3
> >>  bsddb     : 5.3.0
> >>  bsddb.db  : 5.3.21
> >>  cairo     : 1.12.8
> >>  pycairo   : 1.10.0
> >>  osmgpsmap : not found
> >>  pyexiv2   : not found
> >>  o.s.      : Linux
> >>  kernel    : 3.7.1-desktop-1.mga3
> >>
> >> But when I try to import a XML I get:
> >>  ERROR .: Failed to import database.
> >>
> >> Traceback (most recent call last):
> >>   File "/home/peter/Gramps/trunk/gramps/gui/dbloader.py", line 251, in
> >>
> >> do_import
> >>
> >>     User(callback=self._pulse_progress))
> >>
> >>   File "/home/peter/Gramps/trunk/gramps/plugins/importer/importxml.py",
> >>
> >> line 137, in importData
> >>
> >>     info = parser.parse(xml_file, line_cnt, person_cnt)
> >>
> >>   File "/home/peter/Gramps/trunk/gramps/plugins/importer/importxml.py",
> >>
> >> line 902, in parse
> >>
> >>     self.p.ParseFile(ifile)
> >>
> >>   File "/home/peter/Gramps/trunk/gramps/plugins/importer/importxml.py",
> >>
> >> line 2915, in startElement
> >>
> >>     f(attrs)
> >>
> >>   File "/home/peter/Gramps/trunk/gramps/plugins/importer/importxml.py",
> >>
> >> line 1190, in start_event
> >>
> >>     self.update(self.p.CurrentLineNumber)
> >>
> >>   File "/home/peter/Gramps/trunk/gramps/gen/updatecallback.py", line 82,
> >>
> >> in update_real
> >>
> >>     newval = int(100 * count/self.total)
> >>
> >> ZeroDivisionError: division by zero
> >>
> >> Note must run with LANG=en otherwise I get into trouble:
> >>
> >> Traceback (most recent call last):
> >>   File "/home/peter/Gramps/trunk/gramps/gui/grampsgui.py", line 313, in
> >>
> >> __startgramps
> >>
> >>     Gramps(argparser)
> >>
> >>   File "/home/peter/Gramps/trunk/gramps/gui/grampsgui.py", line 238, in
> >>
> >> __init__
> >>
> >>     self.vm.init_interface()
> >>
> >>   File "/home/peter/Gramps/trunk/gramps/gui/viewmanager.py", line 960,
> >>   in
> >>
> >> init_interface
> >>
> >>     self.__build_tools_menu(self._pmgr.get_reg_tools())
> >>
> >>   File "/home/peter/Gramps/trunk/gramps/gui/viewmanager.py", line 1754,
> >>
> >> in __build_tools_menu
> >>
> >>     self.tool_menu_ui_id =
> >>
> >> self.uistate.uimanager.add_ui_from_string(uidef)
> >>
> >>   File "/usr/lib64/python3.3/site-packages/gi/overrides/Gtk.py", line
> >>
> >> 297, in add_ui_from_string
> >>
> >>     return Gtk.UIManager.add_ui_from_string(self, buffer, length)
> >>
> >>   File "/usr/lib64/python3.3/site-packages/gi/types.py", line 47, in
> >>
> >> function
> >>
> >>     return info.invoke(*args, **kwargs)
> >>
> >> gi._glib.GError: Fel på rad 1 tecken 1182:Dokumentet tog oväntat slut
> >> inuti stängningstaggen för
> >> elementet "menubar"
> >> [peter@dell2 trunk]$
> >>
> >> /Peter
> >>
> >> > Benny
> >> >
> >> >
> >> > 2012/12/30 Peter Landgren <peter.talken@telia.com>
> >> >
> >> > > Nick,
> >> > >
> >> > > Thanks, that made it.
> >> > > I  still get "millions" of:
> >> > > (Gramps.py:23975): Gtk-CRITICAL **: gtk_widget_get_toplevel:
> >> > > assertion `GTK_IS_WIDGET (widget)'
> >> > > failed
> >> > >
> >> > > (Gramps.py:23975): Gtk-CRITICAL **: gtk_widget_get_window: assertion
> >> > > `GTK_IS_WIDGET (widget)' failed
> >> > >
> >> > > I also have a problem with rendering. If I switch to "Diagram View"
> >>
> >> and
> >>
> >> > > back to "Relationship View"
> >> > > I see parts of the previous view "behind". I must minimize and then
> >> > > maximize to get a correct
> >> > > window. And still the top of "Relationship View" is not visiable.
> >> > > Also the image to right of the
> >> > > current persons is shown when I move the mouse over its place.
> >> > > Also all buttons are invisible until I move the mouse over them.
> >> > > I'm running Mageia 3 Beta 1. with
> >> > >
> >> > > python    : 2.7.3
> >> > >
> >> > >  gramps    : trunk
> >> > >  gtk++     : 3.6.2
> >> > >  gobject   : 3.4.2
> >> > >  Not using bsddb3
> >> > >  bsddb     : 4.8.4.2
> >> > >  bsddb.db  : (5, 3, 21)
> >> > >  cairo     : 1.10.0
> >> > >  osmgpsmap : not found
> >> > >  pyexiv2   : 0.3.0
> >> > >  o.s.      : Linux
> >> > >  kernel    : 3.7.1-desktop-1.mga3
> >> > >
> >> > > /Peter
> >> > >
> >> > > > Peter,
> >> > > >
> >> > > > Try removing the const.py file:
> >> > > >
> >> > > > rm gramps/gen/const.py
> >> > > >
> >> > > > and running the build again.
> >> > > >
> >> > > > Nick.
> >> > > >
> >> > > > On 30/12/12 13:29, Peter Landgren wrote:
> >> > > > > Did svn up on trunk
> >> > > > > Then python setup.py build
> >> > > > > and finally:
> >> > > > > python Gramps.py
> >> > > > > Error in sys.excepthook:
> >> > > > >
> >> > > > > Traceback (most recent call last):
> >> > > > >    File "/home/peter/Gramps/trunk/gramps/grampsapp.py", line
> >> > > > >    110,
> >>
> >> in
> >>
> >> > > > >    exc_hook
> >> > > > >
> >> > > > >      LOG.error("Unhandled exception\n" +
> >> > > > >
> >> > > > > AttributeError: 'NoneType' object has no attribute 'error'
> >> > > > >
> >> > > > > Original exception was:
> >> > > > >
> >> > > > > Traceback (most recent call last):
> >> > > > >    File "Gramps.py", line 29, in <module>
> >> > > > >
> >> > > > >      import gramps.grampsapp as app
> >> > > > >
> >> > > > >    File "/home/peter/Gramps/trunk/gramps/grampsapp.py", line
> >> > > > >    116,
> >>
> >> in
> >>
> >> > > > >    <module>
> >> > > > >
> >> > > > >      from .gen.utils.trans import LOCALEDOMAIN, LOCALEDIR,
> >> > > > >      setup_windows_gettext
> >> > > > >
> >> > > > >    File "/home/peter/Gramps/trunk/gramps/gen/utils/trans.py",
> >> > > > >    line 44,
> >> > >
> >> > > in
> >> > >
> >> > > > >    <module>
> >> > > > >
> >> > > > >      from ..const import LOCALE_DIR
> >> > > > >
> >> > > > > ImportError: cannot import name LOCALE_DIR
> >> > > > > [peter@dell2 trunk]$
> >> > > > >
> >> > > > > have I missed something?
> >> > > > >
> >> > > > > /Peter
> >> > > > >
> >> > > > >> I have now updated trans.py so it should work now.
> >> > > > >>
> >> > > > >> I have kept the code to check for GRAMPSI18N and give a warning
> >>
> >> if
> >>
> >> > > > >> the locale path is not valid.
> >> > > > >>
> >> > > > >> I'll update gramps40 if you are happy with the changes in
> >> > > > >> trunk.
> >> > > > >>
> >> > > > >> Nick.
> >> > > > >>
> >> > > > >> On 29/12/12 14:29, jerome wrote:
> >> > > > >>> Something is maybe missing on gen/utils/trans.py?
> >> > > > >>>
> >> > > > >>> - from ..const import PREFIXDIR, ROOT_DIR
> >> > > > >>> + from ..const import LOCALE_DIR, ROOT_DIR
> >> > > > >>>
> >> > > > >>> ..
> >> > > > >>>
> >> > > > >>> -if "GRAMPSI18N" in os.environ:
> >> > > > >>> -    if os.path.exists(os.environ["GRAMPSI18N"]):
> >> > > > >>> -        LOCALEDIR = os.environ["GRAMPSI18N"]
> >> > > > >>> -    else:
> >> > > > >>> -        LOCALEDIR = None
> >> > > > >>> -elif os.path.exists( os.path.join(ROOT_DIR, "lang") ):
> >> > > > >>> -    LOCALEDIR = os.path.join(ROOT_DIR, "lang")
> >> > > > >>> -elif os.path.exists(os.path.join(PREFIXDIR, "share/locale")):
> >> > > > >>> -    LOCALEDIR = os.path.join(PREFIXDIR, "share/locale")
> >> > > > >>> -else:
> >> > > > >>> -    lang = os.environ.get('LANG', 'en')
> >> > > > >>> -    if lang and lang[:2] == 'en':
> >> > > > >>> -        pass # No need to display warning, we're in English
> >> > > > >>> -    else:
> >> > > > >>> -        logging.warning('Locale dir does not exist at ' +
> >> > > > >>> -                        os.path.join(PREFIXDIR,
> >>
> >> "share/locale"))
> >>
> >> > > > >>> -        logging.warning('Running python setup.py install
> >> > > > >>> -                     --prefix=YourPrefixDir might fix the
> >> > > > >>> problem') -    LOCALEDIR = None
> >> > > > >>>
> >> > > > >>> LOCALEDIR = LOCALE_DIR
> >> > > > >>>
> >> > > > >>> ...
> >>
> >> ------------------------------------------------------------------------
> >>
> >> > > > >> --- --- Master Visual Studio, SharePoint, SQL, ASP.NET, C#
> >> > > > >> 2012,
> >> > >
> >> > > HTML5,
> >> > >
> >> > > > >> CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your
> >>
> >> skills
> >>
> >> > > > >> current with LearnDevNow - 3,200 step-by-step video tutorials
> >> > > > >> by Microsoft MVPs and experts. SALE $99.99 this month only --
> >> > > > >> learn more at:
> >> > > > >> http://p.sf.net/sfu/learnmore_122912
> >> > > > >> _______________________________________________
> >> > > > >> Gramps-devel mailing list
> >> > > > >> Gramps-devel@lists.sourceforge.net
> >> > > > >> https://lists.sourceforge.net/lists/listinfo/gramps-devel
> >>
> >> ------------------------------------------------------------------------
> >> -
> >>
> >> > > ----- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012,
> >> > > HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep
> >> > > your skills current with LearnDevNow - 3,200 step-by-step video
> >> > > tutorials by Microsoft MVPs and experts. ON SALE this month only --
> >> > > learn more at: http://p.sf.net/sfu/learnmore_123012
> >> > > _______________________________________________
> >> > > Gramps-devel mailing list
> >> > > Gramps-devel@lists.sourceforge.net
> >> > > https://lists.sourceforge.net/lists/listinfo/gramps-devel

--
Peter Landgren
Talken Hagen
671 94  BRUNSKOG
0570-530 21
070-345 0964
peter.talken@telia.com
Skype: pgl4820.2