Last change
on this file since 65d1d04 was
ba65aff,
checked in by lewis, 8 years ago
|
Add docstrings & comments, and rename old bsl_loader to otoko_loader
|
-
Property mode set to
100644
|
File size:
1.4 KB
|
Rev | Line | |
---|
[77d92cd] | 1 | """ |
---|
| 2 | File Converter Plugin |
---|
| 3 | """ |
---|
| 4 | |
---|
| 5 | import logging |
---|
| 6 | from sas.sasgui.guiframe.plugin_base import PluginBase |
---|
| 7 | from sas.sasgui.perspectives.file_converter.converter_panel import ConverterWindow |
---|
| 8 | |
---|
| 9 | class Plugin(PluginBase): |
---|
[ba65aff] | 10 | """ |
---|
| 11 | This class defines the interface for a Plugin class |
---|
| 12 | for File Converter perspective |
---|
| 13 | """ |
---|
[77d92cd] | 14 | |
---|
| 15 | def __init__(self): |
---|
| 16 | PluginBase.__init__(self, name="File Converter") |
---|
| 17 | logging.info("File Converter plug-in started") |
---|
| 18 | self._sub_menu = "Tool" |
---|
| 19 | self.converter_frame = None |
---|
| 20 | |
---|
| 21 | def get_tools(self): |
---|
| 22 | """ |
---|
| 23 | Returns a set of menu entries |
---|
| 24 | """ |
---|
| 25 | help_txt = "Convert single column ASCII data to CanSAS format" |
---|
| 26 | return [("File Converter", help_txt, self.on_file_converter)] |
---|
| 27 | |
---|
| 28 | def on_file_converter(self, event): |
---|
| 29 | if self.converter_frame is None: |
---|
| 30 | frame = ConverterWindow(parent=self.parent, base=self.parent, |
---|
| 31 | manager=self) |
---|
| 32 | self.put_icon(frame) |
---|
| 33 | self.converter_frame = frame |
---|
| 34 | else: |
---|
| 35 | self.converter_frame.Show(False) |
---|
| 36 | self.converter_frame.Show(True) |
---|
| 37 | |
---|
| 38 | def put_icon(self, frame): |
---|
| 39 | """ |
---|
| 40 | Put icon in the frame title bar |
---|
| 41 | """ |
---|
| 42 | if hasattr(frame, "IsIconized"): |
---|
| 43 | if not frame.IsIconized(): |
---|
| 44 | try: |
---|
| 45 | icon = self.parent.GetIcon() |
---|
| 46 | frame.SetIcon(icon) |
---|
| 47 | except: |
---|
| 48 | pass |
---|
Note: See
TracBrowser
for help on using the repository browser.