| Home | Trees | Indices | Help |
|
|---|
|
|
1 # -*- coding: utf-8 -*-
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 # stdlib
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 #--------------------------------------------------------
37 #--------------------------------------------------------
42 #--------------------------------------------------------
44 if not gmPlugin.cNotebookPlugin._on_raise_by_signal(self, **kwds):
45 return False
46 # try:
47 # # add here any code you for the plugin executed after
48 # # raising the pugin
49 # pass
50 # except KeyError:
51 # pass
52 return True
53 #================================================================
54 # MAIN
55 #----------------------------------------------------------------
56 if __name__ == '__main__':
57
58 # GNUmed
59 from Gnumed.business import gmPersonSearch
60 from Gnumed.wxpython import gmPatSearchWidgets
61
62 _log.info("starting template plugin...")
63
64 # obtain patient
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 # display the plugin standalone
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 # clean up
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
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Sat Feb 29 02:55:27 2020 | http://epydoc.sourceforge.net |