def _process(self, *args, **kwargs): global _ _ = get_() try: return func(self, *args, **kwargs) except TemplateNotFound as e: text = _(u'Snippet "{name}" not found').format( name=unicode(e.name) ) raise SnippetException(text) except TemplateSyntaxError as e: text = _(u'Snippet error at line {line}:\n{text}').format( line=e.lineno, text=unicode(e.message) ) raise SnippetException(text) except EnvironmentError as e: text = _(u'Snippet reading error:\n{text}').format( text=unicode(e) ) raise SnippetException(text) except BaseException as e: text = _(u'Snippet processing error:\n{text}').format( text=unicode(e) ) raise SnippetException(text)
def __init__(self, parser, snippets_dir, application): super(CommandSnip, self).__init__(parser) self._snippets_dir = snippets_dir self._application = application global _ _ = get_()
def openHelp(): global _ _ = get_() help_dir = _(u'help/en') help_path = os.path.join(getPluginPath(), help_dir, u'__content.html') getOS().startFile(help_path)
def __init__(self, parent): super(VariablesDialog, self).__init__(parent, style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER) global _ _ = get_() self._shortTemplateName = None self._createGUI() self.SetTitle(u'Snippet variables')
def __init__(self, application): global _ _ = get_() self._application = application self._snippetChanged = False self._dialog = EditSnippetsDialog(self._application.mainWindow) self._config = SnippetsConfig(self._application.config) self._dialog.SetClientSize( (self._config.editDialogWidth, self._config.editDialogHeight)) self._bind()
def __init__(self, application): global _ _ = get_() self._application = application self._snippetChanged = False self._dialog = EditSnippetsDialog(self._application.mainWindow) self._config = SnippetsConfig(self._application.config) self._dialog.SetClientSize((self._config.editDialogWidth, self._config.editDialogHeight)) self._bind()
def initialize(self): global _ _ = get_() if self._application.mainWindow is not None: self._mainMenu = self._application.mainWindow.mainMenu self._menuName = _(u'Snippets') self._createMenu() self._varDialogController.onFinishDialog += self._onFinishDialog self._application.customEvents.bind(EVENT_UPDATE_MENU, self._onMenuUpdate)
def __init__(self, parent): super(VariablesDialog, self).__init__( parent, style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER ) global _ _ = get_() self._shortTemplateName = None self._createGUI() self.SetTitle(u'Snippet variables')
def __init__(self, application): global _ _ = get_() self._application = application self._snippetChanged = False self._dialog = EditSnippetsDialog(self._application.mainWindow) self._config = SnippetsConfig(self._application.config) self._mainWindowconfig = MainWindowConfig(self._application.config) self._dialog.SetClientSize((self._config.editDialogWidth, self._config.editDialogHeight)) self._dialog.SetBackgroundColour(self._mainWindowconfig.mainPanesBackgroundColor.value) self._bind()
def __init__(self, application): global _ _ = get_() self._application = application self._snippetChanged = False self._dialog = EditSnippetsDialog(self._application.mainWindow) self._config = SnippetsConfig(self._application.config) self._mainWindowconfig = MainWindowConfig(self._application.config) self._dialog.SetClientSize( (self._config.editDialogWidth, self._config.editDialogHeight)) self._dialog.SetBackgroundColour( self._mainWindowconfig.mainPanesBackgroundColor.value) self._bind()
def initialize(self): global _ _ = get_() if self._application.mainWindow is not None: self._mainMenu = self._application.mainWindow.mainMenu self._menuName = _(u'Snippets') self._createMenu() self._varDialogController.onFinishDialogEvent += self._onFinishDialog self._application.customEvents.bind(defines.EVENT_UPDATE_MENU, self._onMenuUpdate) self._application.customEvents.bind(defines.EVENT_RUN_SNIPPET, self._onRunSnippet)
def __init__(self, parent): super().__init__(parent, style=wx.CAPTION | wx.CLOSE | wx.SYSTEM_MENU | wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX | wx.CLOSE_BOX | wx.RESIZE_BORDER | wx.FRAME_TOOL_WINDOW | wx.FRAME_NO_TASKBAR | wx.FRAME_FLOAT_ON_PARENT) global _ _ = get_() self.ICON_WIDTH = 16 self.ICON_HEIGHT = 16 self._imagesPath = getImagesPath() self._dirImageId = None self._snippetImageId = None self.addGroupBtn = None self.addSnippetBtn = None self._varMenuItems = [ (_(u'Selected text'), defines.VAR_SEL_TEXT), (_(u'Current date'), defines.VAR_DATE), (_(u'Page title'), defines.VAR_TITLE), (_(u'Page type'), defines.VAR_PAGE_TYPE), (_(u'Page tags list'), defines.VAR_TAGS), (_(u'Attachments path'), defines.VAR_ATTACH), (_(u'Path to page'), defines.VAR_FOLDER), (_(u'Relative page path'), defines.VAR_SUBPATH), (_(u'Page creation date'), defines.VAR_DATE_CREATING), (_(u'Page modification date'), defines.VAR_DATE_EDITIND), (_(u'Page Id'), defines.VAR_PAGE_ID), (_(u'Attachments list'), defines.VAR_ATTACHLIST), (_(u'Child pages'), defines.VAR_CHILDLIST), ] self._blocksMenuItems = [ (_('{% if %}'), (u'{% if %}', '{% elif %}{% else %}{% endif %}')), (_('{% include %}'), (u"{% include '", u"' %}")), (_('{# comment #}'), (u'{# ', ' #}')), ] self._createGUI() self.SetTitle(_(u'Snippets management')) self.disableSnippetEditor()
def _process(self, *args, **kwargs): global _ _ = get_() try: return func(self, *args, **kwargs) except TemplateNotFound as e: text = _(u'Snippet "{name}" not found').format(name=e.name) raise SnippetException(text) except TemplateSyntaxError as e: text = _(u'Snippet error at line {line}:\n{text}').format( line=e.lineno, text=e.message) raise SnippetException(text) except EnvironmentError as e: text = _(u'Snippet reading error:\n{text}').format(text=str(e)) raise SnippetException(text) except BaseException as e: text = _(u'Snippet processing error:\n{text}').format(text=str(e)) raise SnippetException(text)
def __init__(self, parent): super().__init__( parent, style=wx.CAPTION | wx.CLOSE | wx.SYSTEM_MENU | wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX | wx.CLOSE_BOX | wx.RESIZE_BORDER | wx.FRAME_TOOL_WINDOW | wx.FRAME_NO_TASKBAR | wx.FRAME_FLOAT_ON_PARENT ) global _ _ = get_() self.ICON_WIDTH = 16 self.ICON_HEIGHT = 16 self._imagesPath = getImagesPath() self._dirImageId = None self._snippetImageId = None self.addGroupBtn = None self.addSnippetBtn = None self._varMenuItems = [ (_(u'Selected text'), defines.VAR_SEL_TEXT), (_(u'Current date'), defines.VAR_DATE), (_(u'Page title'), defines.VAR_TITLE), (_(u'Page type'), defines.VAR_PAGE_TYPE), (_(u'Page tags list'), defines.VAR_TAGS), (_(u'Attachments path'), defines.VAR_ATTACH), (_(u'Path to page'), defines.VAR_FOLDER), (_(u'Relative page path'), defines.VAR_SUBPATH), (_(u'Page creation date'), defines.VAR_DATE_CREATING), (_(u'Page modification date'), defines.VAR_DATE_EDITIND), (_(u'Page Id'), defines.VAR_PAGE_ID), (_(u'Attachments list'), defines.VAR_ATTACHLIST), (_(u'Child pages'), defines.VAR_CHILDLIST), ] self._blocksMenuItems = [ (_('{% if %}'), (u'{% if %}', '{% elif %}{% else %}{% endif %}')), (_('{% include %}'), (u"{% include '", u"' %}")), (_('{# comment #}'), (u'{# ', ' #}')), ] self._createGUI() self.SetTitle(_(u'Snippets management')) self.disableSnippetEditor()
def __init__(self, application): super(RunRecentSnippet, self).__init__() self._application = application global _ _ = get_()
def __init__(self, application): super(EditSnippetsAction, self).__init__() self._application = application global _ _ = get_() self._dialogController = EditSnippetsDialogController(application)
def __init__(self, application): super(UpdateMenuAction, self).__init__() self._application = application global _ _ = get_()
def __init__(self, application): super(OpenHelpAction, self).__init__() global _ _ = get_()