Example #1
0
    def run (self, params):
        assert self._application.mainWindow is not None

        version = getCurrentVersion()
        dlg = AboutDialog (version, self._application.mainWindow)
        dlg.ShowModal()
        dlg.Destroy()
Example #2
0
    def run(self, params):
        assert self._application.mainWindow is not None

        version = getCurrentVersion()
        dlg = AboutDialog(version, self._application.mainWindow)
        dlg.ShowModal()
        dlg.Destroy()
Example #3
0
    def _showUpdates (self, verList):
        """
        Сверяем полученные номера версий с теми, что установлены сейчас и заполняем диалог изменениями (updateDialog)
        Возвращает True, если есть какие-нибудь обновления
        """
        setStatusText (u"")

        currentVersion = getCurrentVersion()
        stableVersion = verList.stableVersion
        unstableVersion = verList.unstableVersion

        updatedPlugins = self.getUpdatedPlugins (verList)

        updateDialog = UpdateDialog (self._application.mainWindow)
        updateDialog.setCurrentOutWikerVersion (currentVersion)

        if stableVersion != None:
            updateDialog.setLatestStableOutwikerVersion (stableVersion, currentVersion < stableVersion)
        else:
            updateDialog.setLatestStableOutwikerVersion (currentVersion, False)

        if unstableVersion != None:
            updateDialog.setLatestUnstableOutwikerVersion (unstableVersion, currentVersion < unstableVersion)
        else:
            updateDialog.setLatestUnstableOutwikerVersion (currentVersion, False)

        for plugin in updatedPlugins:
            updateDialog.addPluginInfo (plugin,
                    verList.getPluginVersion (plugin.name),
                    verList.getPluginUrl (plugin.name))

        updateDialog.ShowModal()
        updateDialog.Destroy()
Example #4
0
    def createHTMLContent(self, updatedAppInfo):
        currentVersion = getCurrentVersion()
        currentVersionsDict = self._getCurrentVersionsDict()

        template = readTextFile(self._updateTemplatePath)

        templateData = {
            u'outwiker_current_version':
            currentVersion,
            u'updatedAppInfo':
            updatedAppInfo,
            u'currentVersionsDict':
            currentVersionsDict,
            u'str_outwiker_current_version':
            _(u'Installed OutWiker version'),
            u'str_outwiker_latest_stable_version':
            _(u'Latest stable OutWiker version'),
            u'str_outwiker_latest_unstable_version':
            _(u'Latest unstable OutWiker version'),
            u'str_version_history':
            _(u'Version history'),
            u'str_more_info':
            _(u'More info'),
            u'str_download':
            _(u'Download'),
        }

        contentGenerator = ContentGenerator(template)
        HTMLContent = contentGenerator.render(templateData)
        return HTMLContent
Example #5
0
    def __processConsoleCommands (self):
        # Вывод справки
        if self._commandLine.help:
            print self._commandLine.format_help()
            raise StarterExit

        # Вывод информации о версии
        if self._commandLine.version:
            print ur"""OutWiker {ver}""".format (ver = str (getCurrentVersion()))
            raise StarterExit
Example #6
0
    def createHTMLContent(self, appInfoDict, updatedAppInfo,
                          installerInfoDict):
        currentVersion = getCurrentVersion()
        currentVersionsDict = self._getCurrentVersionsDict()

        appInfoDict = self.filterUpdatedApps(currentVersionsDict, appInfoDict)
        updateAppInfo = self.filterUpdatedApps(currentVersionsDict,
                                               updatedAppInfo)

        installedAppInfo = {
            x: y
            for x, y in updatedAppInfo.items() if x not in updateAppInfo
        }

        template = readTextFile(self._updateTemplatePath)

        templateData = {
            u'outwiker_current_version':
            currentVersion,
            u'outwikerAppInfo':
            appInfoDict,
            u'updatedAppInfo':
            updateAppInfo,
            u'installedAppInfo':
            installedAppInfo,
            u'otherAppInfo':
            installerInfoDict,
            u'currentVersionsDict':
            currentVersionsDict,
            u'str_outwiker_current_version':
            _(u'Installed OutWiker version'),
            u'str_outwiker_latest_stable_version':
            _(u'Latest stable OutWiker version'),
            u'str_outwiker_latest_unstable_version':
            _(u'Latest unstable OutWiker version'),
            u'str_version_history':
            _(u'Version history'),
            u'str_more_info':
            _(u'More info'),
            u'str_update':
            _(u'Update'),
            u'str_install':
            _(u'Install'),
            u'str_uninstall':
            _(u'Uninstall'),
            u'data_path':
            self._dataPath,
            u'escape':
            html.escape,
        }

        contentGenerator = ContentGenerator(template)
        HTMLContent = contentGenerator.render(templateData)
        return HTMLContent
Example #7
0
    def processConsole(self):
        """
        Выполнить команды командной строки до создания интерфейса
        """
        # Вывод справки
        if self._commandLine.help:
            print(self._commandLine.format_help())
            raise StarterExit

        # Вывод информации о версии
        if self._commandLine.version:
            print(r"""OutWiker {ver}""".format(ver=str(getCurrentVersion())))
            raise StarterExit
Example #8
0
    def __processConsoleCommands(self):
        # Вывод справки
        if self._commandLine.help:
            print(self._commandLine.format_help())
            raise StarterExit

        # Вывод информации о версии
        if self._commandLine.version:
            print(r"""OutWiker {ver}""".format(ver=str(getCurrentVersion())))
            raise StarterExit

        self._application.sharedData[
            APP_DATA_DISABLE_MINIMIZING] = self._commandLine.disableMinimizing
        self._application.sharedData[APP_DATA_DEBUG] = self._commandLine.debug
Example #9
0
    def _getCurrentVersionsDict(self):
        '''
        Return dictionary with apps versions. Key - plugin name or special id,
        value - string with version.
        '''
        currentVersion = getCurrentVersion()

        currentVersionsDict = {plugin: self.get_plugin(plugin).version
                               for plugin
                               in self._application.plugins.loadedPlugins}

        currentVersionsDict[self._OUTWIKER_STABLE_KEY] = str(currentVersion)
        currentVersionsDict[self._OUTWIKER_UNSTABLE_KEY] = str(currentVersion)

        return currentVersionsDict
    def _getCurrentVersionsDict(self):
        '''
        Return dictionary with apps versions. Key - plugin name or special id,
        value - string with version.
        '''
        currentVersion = getCurrentVersion()

        currentVersionsDict = {plugin: self.get_plugin(plugin).version
                               for plugin
                               in self._application.plugins.loadedPlugins}

        currentVersionsDict[self._OUTWIKER_STABLE_KEY] = str(currentVersion)
        currentVersionsDict[self._OUTWIKER_UNSTABLE_KEY] = str(currentVersion)

        return currentVersionsDict
Example #11
0
    def hasUpdates (self, verList):
        """
        Возвращает True, если есть обновления в плагинах или самой программы
        """
        currentVersion = getCurrentVersion()
        stableVersion = verList.stableVersion
        unstableVersion = verList.unstableVersion

        updatedPlugins = self.getUpdatedPlugins (verList)

        # Обновилась ли нестабильная версия (или игнорируем ее)
        unstableUpdate = (currentVersion < unstableVersion) and not self._config.ignoreUnstable

        result = ((currentVersion < stableVersion) or 
                unstableUpdate or 
                len (updatedPlugins) != 0)

        return result
Example #12
0
    def hasUpdates(self, verList):
        """
        Возвращает True, если есть обновления в плагинах или самой программы
        """
        currentVersion = getCurrentVersion()
        stableVersion = verList.stableVersion
        unstableVersion = verList.unstableVersion

        assert stableVersion is not None
        assert unstableVersion is not None

        updatedPlugins = self.getUpdatedPlugins(verList)

        # Обновилась ли нестабильная версия (или игнорируем ее)
        unstableUpdate = (currentVersion <
                          unstableVersion) and not self._config.ignoreUnstable

        result = ((currentVersion < stableVersion) or unstableUpdate
                  or len(updatedPlugins) != 0)

        return result
Example #13
0
    def createHTMLContent(
            self, appInfoDict, updatedAppInfo, installerInfoDict):
        currentVersion = getCurrentVersion()
        currentVersionsDict = self._getCurrentVersionsDict()

        appInfoDict = self.filterUpdatedApps(currentVersionsDict, appInfoDict)
        updateAppInfo = self.filterUpdatedApps(
            currentVersionsDict, updatedAppInfo)

        installedAppInfo = {
            x: y for x,
            y in updatedAppInfo.items() if x not in updateAppInfo}

        template = readTextFile(self._updateTemplatePath)

        templateData = {
            u'outwiker_current_version': currentVersion,
            u'outwikerAppInfo': appInfoDict,
            u'updatedAppInfo': updateAppInfo,
            u'installedAppInfo': installedAppInfo,
            u'otherAppInfo': installerInfoDict,
            u'currentVersionsDict': currentVersionsDict,
            u'str_outwiker_current_version': _(u'Installed OutWiker version'),
            u'str_outwiker_latest_stable_version': _(u'Latest stable OutWiker version'),
            u'str_outwiker_latest_unstable_version': _(u'Latest unstable OutWiker version'),
            u'str_version_history': _(u'Version history'),
            u'str_more_info': _(u'More info'),
            u'str_update': _(u'Update'),
            u'str_install': _(u'Install'),
            u'str_uninstall': _(u'Uninstall'),
            u'data_path': self._dataPath,
            u'escape': html.escape,
        }

        contentGenerator = ContentGenerator(template)
        HTMLContent = contentGenerator.render(templateData)
        return HTMLContent
Example #14
0
    def _showUpdates(self, verList):
        """
        Сверяем полученные номера версий с теми, что установлены сейчас и заполняем диалог изменениями (updateDialog)
        Возвращает True, если есть какие-нибудь обновления
        """
        setStatusText(u"")

        currentVersion = getCurrentVersion()
        stableVersion = verList.stableVersion
        unstableVersion = verList.unstableVersion

        updatedPlugins = self.getUpdatedPlugins(verList)

        updateDialog = UpdateDialog(self._application.mainWindow)
        updateDialog.setCurrentOutWikerVersion(currentVersion)

        if stableVersion is not None:
            updateDialog.setLatestStableOutwikerVersion(
                stableVersion, currentVersion < stableVersion)
        else:
            updateDialog.setLatestStableOutwikerVersion(currentVersion, False)

        if unstableVersion is not None:
            updateDialog.setLatestUnstableOutwikerVersion(
                unstableVersion, currentVersion < unstableVersion)
        else:
            updateDialog.setLatestUnstableOutwikerVersion(
                currentVersion, False)

        for plugin in updatedPlugins:
            updateDialog.addPluginInfo(plugin,
                                       verList.getPluginVersion(plugin.name),
                                       verList.getPluginUrl(plugin.name))

        updateDialog.ShowModal()
        updateDialog.Destroy()
Example #15
0

import os.path

from outwiker.core.pluginbase import Plugin
from outwiker.core.system import getOS
from outwiker.core.commands import getCurrentVersion
from outwiker.core.version import Version, StatusSet
from outwiker.pages.wiki.wikipanel import WikiPagePanel

from .ljcommand import LjUserCommand, LjCommunityCommand
from .ljtoolbar import LJToolBar


# Для работы этого плагина требуется версия OutWiker 1.7.0.670
if getCurrentVersion() < Version (1, 7, 0, 670, status=StatusSet.DEV):
    print ("Livejournal plugin. OutWiker version requirement: 1.7.0.670")
else:
    class PluginLivejournal (Plugin):
        """
        Плагин, добавляющий обработку команды spoiler в википарсер
        """
        def __init__ (self, application):
            """
            application - экземпляр класса core.application.ApplicationParams
            """
            Plugin.__init__ (self, application)
            self.ID_TOOLBAR = u"livejournal"
            self.ID_LJUSER = u"PLUGIN_LIVEJOURNAL_LJUSER_ID"
            self.ID_LJCOMMUNITY = u"PLUGIN_LIVEJOURNAL_LJCOMMUNITY_ID"
Example #16
0
# -*- coding: UTF-8 -*-

import os.path

from outwiker.core.pluginbase import Plugin
from outwiker.core.commands import getCurrentVersion
from outwiker.core.version import Version


__version__ = u"1.0"

if getCurrentVersion() < Version (1, 8, 0, 742):
    print ("ReadingMode. OutWiker version requirement: 1.8.0.742")
else:
    from outwiker.core.system import getOS
    from controller import Controller
    from .i18n import set_

    class PluginReadingMode (Plugin):
        """
        ReadingMode Plugin
        """
        def __init__ (self, application):
            super (PluginReadingMode, self).__init__ (application)
            self._controller = Controller (application)


        @property
        def name (self):
            return u"ReadingMode"
Example #17
0
# -*- coding: UTF-8 -*-

import os.path
import logging

from outwiker.core.pluginbase import Plugin
from outwiker.core.commands import getCurrentVersion
from outwiker.core.version import Version, StatusSet
from outwiker.core.system import getOS


__version__ = u'1.0.3'


if getCurrentVersion() < Version (1, 9, 0, 777, status=StatusSet.DEV):
    logging.warning ("TexEquation plugin. OutWiker version requirement: 1.9.0.777")
else:
    from .i18n import set_
    from .controller import Controller

    class PluginTexEquation (Plugin):
        def __init__ (self, application):
            """
            application - экземпляр класса core.application.ApplicationParams
            """
            super (PluginTexEquation, self).__init__ (application)
            self.__controller = Controller(self, application)


        @property
        def application (self):
Example #18
0
    def __init__(self):
        self._description = r"""OutWiker {ver}. Crossplatform program to keep your notes in a tree.""".format(ver=str(getCurrentVersion()))

        self._parser = self._createParser()
        self._namespace = None
Example #19
0
# -*- coding: UTF-8 -*-

from outwiker.core.pluginbase import Plugin
from outwiker.core.commands import getCurrentVersion
from outwiker.core.version import Version, StatusSet

if getCurrentVersion() < Version(1, 8, 0, 733, status=StatusSet.BETA):
    print("TestPage plugin. OutWiker version requirement: 1.8.0.733")
else:
    from .controller import Controller

    class PluginLatexPage(Plugin):
        def __init__(self, application):
            """
            application - экземпляр класса core.application.ApplicationParams
            """
            Plugin.__init__(self, application)
            self.__controller = Controller(self, application)

        @property
        def application(self):
            return self._application

        ###################################################
        # Свойства и методы, которые необходимо определить
        ###################################################

        @property
        def name(self):
            return u"LatexPage"
Example #20
0
    def __init__(self):
        self._description = r"""OutWiker {ver}. Crossplatform program to keep your notes in a tree.""".format(ver=str(getCurrentVersion()))

        self._parser = self._createParser()
        self._namespace = None
Example #21
0
# -*- coding: UTF-8 -*-

import os.path
import logging

from outwiker.core.pluginbase import Plugin
from outwiker.core.commands import getCurrentVersion
from outwiker.core.version import Version, StatusSet
from outwiker.core.system import getOS


def _no_translate(text):
    return text


if getCurrentVersion() < Version(2, 0, 0, 807, status=StatusSet.DEV):
    logging.warning("PluginName plugin. OutWiker version requirement: 2.0.0.807")
else:
    from .controller import Controller

    class PluginName(Plugin):
        def __init__(self, application):
            """
            application - Instance of the
                core.application.ApplicationParams class
            """
            super(PluginName, self).__init__(application)
            self.__controller = Controller(self, application)

        @property
        def application(self):
Example #22
0
import os.path
import sys

from outwiker.core.pluginbase import Plugin
from outwiker.core.system import getOS
from outwiker.core.commands import getCurrentVersion
from outwiker.core.version import Version

from .i18n import set_

__version__ = u"1.13"


# Для работы этого плагина требуется OutWiker 1.8.1
if getCurrentVersion() < Version(1, 8, 1):
    print ("Source plugin. OutWiker version requirement: 1.8.1")
else:

    class PluginSource(Plugin):
        """
        Плагин, добавляющий обработку команды (:source:) в википарсер
        """

        def __init__(self, application):
            """
            application - экземпляр класса core.application.ApplicationParams
            """
            Plugin.__init__(self, application)

            self.__correctSysPath()
Example #23
0
# -*- coding: UTF-8 -*-

import os.path

from outwiker.core.pluginbase import Plugin
from outwiker.core.commands import getCurrentVersion
from outwiker.core.version import Version
from outwiker.core.system import getOS


__version__ = u'1.0.6'


if getCurrentVersion() < Version (1, 8, 0, 750):
    print ("DataGraph plugin. OutWiker version requirement: 1.8.0.750")
else:
    from .i18n import set_
    from .controller import Controller

    class PluginDataGraph (Plugin):
        def __init__ (self, application):
            """
            application - экземпляр класса core.application.ApplicationParams
            """
            Plugin.__init__ (self, application)
            self.__controller = Controller(self, application)


        @property
        def application (self):
            return self._application
Example #24
0
# -*- coding: UTF-8 -*-

import os.path

import wx

from outwiker.core.pluginbase import Plugin
from outwiker.core.commands import getCurrentVersion
from outwiker.core.version import Version, StatusSet
from outwiker.core.system import getOS


__version__ = u"1.0.2"


if getCurrentVersion() < Version (1, 7, 0):
    print ("Statistics plugin. OutWiker version requirement: 1.7.0")
else:
    from .i18n import set_
    from .pagestat import PageStat
    from .treestat import TreeStat
    from .pagestatdialog import PageStatDialog
    from .treestatdialog import TreeStatDialog

    class PluginStatistics (Plugin):
        def __init__ (self, application):
            """
            application - экземпляр класса core.application.ApplicationParams
            """
            Plugin.__init__ (self, application)
Example #25
0
# -*- coding: UTF-8 -*-

from outwiker.core.pluginbase import Plugin
from outwiker.core.commands import getCurrentVersion
from outwiker.core.version import Version, StatusSet


if getCurrentVersion() < Version (1, 8, 0, 733, status=StatusSet.BETA):
    print ("TestPage plugin. OutWiker version requirement: 1.8.0.733")
else:
    from .controller import Controller

    class PluginLatexPage (Plugin):
        def __init__ (self, application):
            """
            application - экземпляр класса core.application.ApplicationParams
            """
            Plugin.__init__ (self, application)
            self.__controller = Controller(self, application)


        @property
        def application (self):
            return self._application


        ###################################################
        # Свойства и методы, которые необходимо определить
        ###################################################

        @property
Example #26
0
# -*- coding: UTF-8 -*-

import os.path
import logging

from outwiker.core.pluginbase import Plugin
from outwiker.core.commands import getCurrentVersion
from outwiker.core.version import Version, StatusSet
from outwiker.core.system import getOS

from .i18n import set_

__version__ = u'1.0.1'

if getCurrentVersion() < Version(1, 9, 0, 781, status=StatusSet.DEV):
    logging.warning(u"WebPage plugin. OutWiker version requirement: 1.9.0.781")
else:
    from .controller import Controller

    class PluginWebPage(Plugin):
        def __init__(self, application):
            """
            application - instance of the core.application.ApplicationParams class
            """
            super(PluginWebPage, self).__init__(application)
            self.__controller = Controller(self, self._application)

        @property
        def application(self):
            return self._application
Example #27
0
# -*- coding: UTF-8 -*-

import os.path

from outwiker.core.pluginbase import Plugin
from outwiker.core.commands import getCurrentVersion
from outwiker.core.version import Version

__version__ = u"1.0"

if getCurrentVersion() < Version(1, 8, 0, 742):
    print("ReadingMode. OutWiker version requirement: 1.8.0.742")
else:
    from outwiker.core.system import getOS
    from controller import Controller
    from .i18n import set_

    class PluginReadingMode(Plugin):
        """
        ReadingMode Plugin
        """
        def __init__(self, application):
            super(PluginReadingMode, self).__init__(application)
            self._controller = Controller(application)

        @property
        def name(self):
            return u"ReadingMode"

        @property
        def description(self):
Example #28
0
import os.path

from outwiker.core.pluginbase import Plugin
from outwiker.core.system import getOS
from outwiker.core.commands import getCurrentVersion
from outwiker.core.version import Version, StatusSet

from .controller import Controller


__version__ = u"1.1.5"


# Для работы этого плагина требуется OutWiker 1.6.0.632
if getCurrentVersion() < Version (1, 6, 0, 632, status=StatusSet.DEV):
    print ("Thumblist plugin. OutWiker version requirement: 1.6.0.632")
else:
    class PluginThumbGallery (Plugin):
        """
        Плагин, добавляющий обработку команды (:thumblist:) и (:thumbgallery:) в википарсер
        """
        def __init__ (self, application):
            """
            application - экземпляр класса core.application.ApplicationParams
            """
            Plugin.__init__ (self, application)
            self._controller = Controller (application)


        @property
Example #29
0
Плагин для открытия файлов заметок с помощью внешних программ,
а также для создания ссылок на викистраницах, при клике на которые запускаются
внешние программы.
"""

import os.path

from outwiker.core.commands import getCurrentVersion
from outwiker.core.version import Version
from outwiker.core.pluginbase import Plugin
from outwiker.core.system import getOS

__version__ = u"1.3.3"


if getCurrentVersion() < Version (1, 8, 0):
    print ("ExternalTools plugin. OutWiker version requirement: 1.8.0")
else:
    from controller import Controller
    from i18n import set_

    class PluginExternalTools (Plugin):
        def __init__ (self, application):
            """
            application - instance of core.application.ApplicationParams
            """
            Plugin.__init__ (self, application)
            self.__controller = Controller (self)


        @property
Example #30
0
# -*- coding: UTF-8 -*-

import os.path

from outwiker.core.pluginbase import Plugin
from outwiker.core.commands import getCurrentVersion
from outwiker.core.version import Version, StatusSet
from outwiker.core.system import getOS

__version__ = u"1.0.2"


if getCurrentVersion() < Version (1, 8, 0, 731, status=StatusSet.DEV):
    print ("ChangeUID plugin. OutWiker version requirement: 1.8.0.731")
else:
    from .i18n import set_
    from .controller import Controller


    class PluginTableOfContents (Plugin):
        def __init__ (self, application):
            """
            application - экземпляр класса core.application.ApplicationParams
            """
            Plugin.__init__ (self, application)
            self.__controller = Controller(self, application)


        @property
        def application (self):
            return self._application
Example #31
0
# -*- coding: UTF-8 -*-

import os.path

from outwiker.core.pluginbase import Plugin
from outwiker.core.system import getOS
from outwiker.core.commands import getCurrentVersion
from outwiker.core.version import Version, StatusSet

from .lightboxcommand import LightboxCommand

__version__ = u"1.1.2"

# Для работы этого плагина требуется OutWiker 1.7.0.653 и выше
if getCurrentVersion() < Version(1, 7, 0, 653, status=StatusSet.DEV):
    print("Lightbox plugin. OutWiker version requirement: 1.7.0.653")
else:

    class PluginLightbox(Plugin):
        """
        Плагин, добавляющий обработку команды (:lightbox:) в википарсер
        """
        def __init__(self, application):
            """
            application - экземпляр класса core.application.ApplicationParams
            """
            Plugin.__init__(self, application)
            self.LIGHTBOX_TOOL_ID = u"PLUGIN_LIGHTBOX_TOOL_ID"

        def __onWikiParserPrepare(self, parser):
            parser.addCommand(LightboxCommand(parser))
Example #32
0
# -*- coding: UTF-8 -*-

import os.path
import logging

from outwiker.core.pluginbase import Plugin
from outwiker.core.commands import getCurrentVersion
from outwiker.core.version import Version, StatusSet
from outwiker.core.system import getOS


if getCurrentVersion() < Version(2, 0, 0, 812, status=StatusSet.DEV):
    logging.warning("TexEquation plugin. OutWiker version requirement: 1.9.0.777")
else:
    from .i18n import set_
    from .controller import Controller

    class PluginTexEquation(Plugin):
        def __init__(self, application):
            """
            application - экземпляр класса core.application.ApplicationParams
            """
            super(PluginTexEquation, self).__init__(application)
            self.__controller = Controller(self, application)

        @property
        def application(self):
            return self._application

        ###################################################
        # Свойства и методы, которые необходимо определить
Example #33
0
# -*- coding: UTF-8 -*-

import os.path
import logging
import sys

from outwiker.core.pluginbase import Plugin
from outwiker.core.commands import getCurrentVersion
from outwiker.core.version import Version, StatusSet
from outwiker.core.system import getOS


if getCurrentVersion() < Version(2, 0, 0, 806, status=StatusSet.BETA):
    logging.warning("Snippets plugin. OutWiker version requirement: 2.0.0.806")
else:
    class PluginSnippets (Plugin):
        def __init__(self, application):
            """
            application - экземпляр класса core.application.ApplicationParams
            """
            super(PluginSnippets, self).__init__(application)
            self._correctSysPath()

            self.__controller = None

        @property
        def application(self):
            return self._application

        ###################################################
        # Свойства и методы, которые необходимо определить
Example #34
0
#!/usr/bin/env python
# -*- coding: UTF-8 -*-

import os.path

from outwiker.core.pluginbase import Plugin
from outwiker.core.system import getOS
from outwiker.core.commands import getCurrentVersion
from outwiker.core.version import Version, StatusSet

from .controller import Controller


# Для работы этого плагина требуется OutWiker 1.6.0.632
if getCurrentVersion() < Version (1, 6, 0, 632, status=StatusSet.DEV):
    print ("Thumblist plugin. OutWiker version requirement: 1.6.0.632")
else:
    class PluginThumbGallery (Plugin):
        """
        Плагин, добавляющий обработку команды (:thumblist:) и (:thumbgallery:) в википарсер
        """
        def __init__ (self, application):
            """
            application - экземпляр класса core.application.ApplicationParams
            """
            Plugin.__init__ (self, application)
            self._controller = Controller (application)


        @property
        def name (self):
Example #35
0
import os.path
import logging
import sys

from outwiker.core.pluginbase import Plugin
from outwiker.core.commands import getCurrentVersion
from outwiker.core.version import Version, StatusSet
from outwiker.core.system import getOS


def _no_translate(text):
    return text


if getCurrentVersion() < Version(2, 0, 0, 806, status=StatusSet.BETA):
    logging.warning("Snippets plugin. OutWiker version requirement: 2.0.0.806")
else:

    class PluginSnippets(Plugin):
        def __init__(self, application):
            """
            application - экземпляр класса core.application.ApplicationParams
            """
            super(PluginSnippets, self).__init__(application)
            self._correctSysPath()

            self.__controller = None

        @property
        def application(self):