def run (self, params): assert self._application.mainWindow is not None version = getCurrentVersion() dlg = AboutDialog (version, self._application.mainWindow) dlg.ShowModal() dlg.Destroy()
def run(self, params): assert self._application.mainWindow is not None version = getCurrentVersion() dlg = AboutDialog(version, self._application.mainWindow) dlg.ShowModal() dlg.Destroy()
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()
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
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
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
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
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
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 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
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
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
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()
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"
# -*- 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"
# -*- 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):
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
# -*- 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"
# -*- 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):
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()
# -*- 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
# -*- 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)
# -*- 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
# -*- 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
# -*- 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):
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
Плагин для открытия файлов заметок с помощью внешних программ, а также для создания ссылок на викистраницах, при клике на которые запускаются внешние программы. """ 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
# -*- 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
# -*- 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))
# -*- 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 ################################################### # Свойства и методы, которые необходимо определить
# -*- 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 ################################################### # Свойства и методы, которые необходимо определить
#!/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):
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):