20 from ..
import context
21 from ..action
import ActionInfo
22 from ..pluginapi
import Plugin
23 from ..publish
import PUBLISHER, RideExecuteSpecXmlImport
24 from .xmlreaders
import get_name_from_xml
29 HEADER =
'Import Library Spec XML'
50 return path
and os.path.isfile(path)
53 self.
modelmodel.update_namespace()
56 wildcard = (
'Library Spec XML|*.xml|All Files|*.*')
57 dlg = wx.FileDialog(self.
frameframe,
58 message=
'Import Library Spec XML',
60 defaultDir=self.
modelmodel.default_dir)
62 if dlg.ShowModal() == wx.ID_OK:
72 shutil.copy(path, os.path.join(context.LIBRARY_XML_DIRECTORY, name+
'.xml'))
73 wx.MessageBox(
'Library "%s" imported\nfrom "%s"\nThis may require RIDE restart.' % (name, path),
'Info', wx.OK | wx.ICON_INFORMATION)
75 wx.MessageBox(
'Could not import library from file "%s"' % path,
'Import failed', wx.OK | wx.ICON_ERROR)
Used to create menu entries, keyboard shortcuts and/or toolbar buttons.
Entry point to RIDE plugin API – all plugins must extend this class.
def unsubscribe_all(self)
Stops to listen to all messages this plugin has subscribed to.
def register_action(self, action_info)
Registers a menu entry and optionally a shortcut and a toolbar icon.
def unregister_actions(self)
Unregisters all actions registered by this plugin.
def _store_spec(self, path)
def execute_spec_import(self)
def _is_valid_path(self, path)
def disable(self)
Called by RIDE when the plugin is disabled.
def enable(self)
This method is called by RIDE when the plugin is enabled.
def _execute_namespace_update(self)
def _get_path_to_library_spec(self)
def _ps_on_execute_spec_import(self, message)
def get_name_from_xml(path)