1
2 """A print manager plugin"""
3
4 __author__ = "karsten.hilbert@gmx.net"
5 __license__ = "GPL v2 or later"
6
7
8 import os.path, sys, logging
9 import wx
10
11 if __name__ == '__main__':
12
13 import sys
14 sys.path.insert(0, '../../../')
15 from Gnumed.pycommon import gmI18N
16 gmI18N.activate_locale()
17 gmI18N.install_domain()
18
19 from Gnumed.wxpython import gmPlugin
20 from Gnumed.wxpython import gmExportAreaWidgets
21
22
23 _log = logging.getLogger('gm.ui')
24
26 tab_name = _("Print Manager")
27
30
34
36 return ('paperwork', _('&Print Manager'))
37
42
44 if not gmPlugin.cNotebookPlugin._on_raise_by_signal(self, **kwds):
45 return False
46
47
48
49
50
51
52 return True
53
54
55
56 if __name__ == '__main__':
57
58
59 from Gnumed.business import gmPersonSearch
60 from Gnumed.wxpython import gmPatSearchWidgets
61
62 _log.info("starting template plugin...")
63
64
65 patient = gmPersonSearch.ask_for_patient()
66 if patient is None:
67 print("None patient. Exiting gracefully...")
68 sys.exit(0)
69 gmPatSearchWidgets.set_active_patient(patient=patient)
70
71
72 application = wx.wx.PyWidgetTester(size = (800,600))
73 widgets = gmExamplePluginWidgets.cExamplePluginPnl(application.frame, -1)
74
75 application.frame.Show(True)
76 application.MainLoop()
77
78
79 if patient is not None:
80 try:
81 patient.cleanup()
82 except Exception:
83 print("error cleaning up patient")
84
85 _log.info("closing example plugin...")
86