1 """
2 This is a template plugin
3 """
4 __version__ = "$Revision: 0.1 $"
5 __author__ = "Sebastian Hilbert <Sebastian.Hilbert@gmx.net>"
6 __license__ = "GPL"
7
8
9 import os.path, sys, logging
10 import wx
11
12 if __name__ == '__main__':
13
14 import sys
15 sys.path.insert(0, '../../../')
16
17 from Gnumed.pycommon import gmI18N
18 gmI18N.activate_locale()
19 gmI18N.install_domain()
20
21 """ import the widgets from the file referencing the widgets
22 for that particualr plugin
23 """
24
25 from Gnumed.wxpython import gmPlugin, gmPlugintemplateWidgets
26
27 _log = logging.getLogger('gm.ui')
28 _log.info(__version__)
29
30
32
33 tab_name = _("Template Plugin")
34
37
42
44
45 return ('emr', _('Show &Plugintemplate'))
46
48
49 """ uncomment the next two lines if a patient
50 needs to be active before the plugin """
51
52
53 return 1
54
56 if not gmPlugin.cNotebookPlugin._on_raise_by_signal(self, **kwds):
57 return False
58 try:
59
60
61 pass
62 except KeyError:
63 pass
64 return True
65
66
67
68 if __name__ == '__main__':
69
70
71 from Gnumed.business import gmPerson
72 from Gnumed.wxpython import gmPatSearchWidgets
73
74 _log.info("starting template plugin...")
75
76 try:
77
78 patient = gmPerson.ask_for_patient()
79 if patient is None:
80 print "None patient. Exiting gracefully..."
81 sys.exit(0)
82 gmPatSearchWidgets.set_active_patient(patient=patient)
83
84
85 application = wx.wx.PyWidgetTester(size = (800,600))
86 widgets = gmPlugintemplateWidgets.cPlugintemplatePnl(application.frame, -1)
87
88 application.frame.Show(True)
89 application.MainLoop()
90
91
92 if patient is not None:
93 try:
94 patient.cleanup()
95 except:
96 print "error cleaning up patient"
97 except StandardError:
98 _log.exception("unhandled exception caught !")
99
100 raise
101
102 _log.info("closing Notebooked cardiac device input plugin...")
103