gnumed-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-devel] NUmed plugin development - part 8


From: Karsten Hilbert
Subject: Re: [Gnumed-devel] NUmed plugin development - part 8
Date: Mon, 13 Apr 2009 17:57:10 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

On Mon, Apr 13, 2009 at 05:15:39PM +0200, Hilbert, Sebastian wrote:

> Turns out he added some special code to the file wxgSoapPluginPnl.py which 
> normally gets autogenerated from the wxg file. Looking at the file I found I 
> had to add
> 
>     class wxgCardiacDevicePluginPnl(wx.ScrolledWindow):
>         def __init__(self, *args, **kwds):
> 
>             from Gnumed.wxpython.gmNarrativeWidgets import 
> cSoapNoteInputNotebook
>             from Gnumed.wxpython.gmDateTimeInput import cFuzzyTimestampInput
>             from Gnumed.wxpython.gmEMRStructWidgets import 
> cEncounterTypePhraseWheel
>             from Gnumed.wxpython import gmListWidgets
> 
>             # begin wxGlade: wxgCardiacDevicePluginPnl.__init__

Three relevant notes to the above:

1) the extra import statements cannot be added by using the
   "extra code" feature of wxGlade because they must be inside
   the class definition in order to avoid circular import
   problems

2) note how the extra statements appear *before* the line
     # begin wxGlade: wxgCardiacDevicePluginPnl.__init__
   such that they are duly left in place when re-generating the file

3) while all other GNUmed code prefers TABs as indentation (although
   in-file consistency is more important than whether TAB or SPACE)
   the wxGlade code cannot be instructed to generate TABs rather
   than SPACEs (hopefully for good reason) -- so adding the above
   lines better arrange with that wxGlade convention and use SPACEs

> shows up in GNUmed. Horray. But it crashes when trying to load data.
> 
> Here is the error:
...
>     NotImplementedError: [cCardiacDeviceMeasurementsPnl] 
> _populate_with_data() 
> not implemented

Yep, right there is the reason ;-)

> That is no surprise since I decided to put the class 
> cCardiacDeviceMeasurementsPnl into gmMeasurementWidgets.py and did not copy 
> all stuff from gmSoapWidgets. What I effectively missed is to copy all the 
> needed functions like _populate_with_data().
That's where the GNUmed wrapper class around the wxGlade
class comes into play. You need to "fill in the blanks" now.

> One issue is if it makes sense to put more stuff into gmMeasurementWidgets or 
> rather a seperate file along the lines of gmDeviceAssessmentWidgets.

Let me suggest gmDeviceWidgets.py.

Karsten
-- 
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346




reply via email to

[Prev in Thread] Current Thread [Next in Thread]