• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python global_services.getApplicationModel函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中zoundry.appframework.global_services.getApplicationModel函数的典型用法代码示例。如果您正苦于以下问题:Python getApplicationModel函数的具体用法?Python getApplicationModel怎么用?Python getApplicationModel使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getApplicationModel函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: __init__

    def __init__(self, parent, tabInfo, selected = False):
        self.parent = parent
        self.tabInfo = tabInfo
        self.selected = selected
        self.firstTab = False
        self.wingmanTab = False
        self.hovering = False # is the user hovering the mouse over the control
        self.clicking = False # is the user clicking the control
        self.middleClicking = False # is the user middle-clicking the control
        self.borderColor = TAB_BORDER_INNER_COLOR
        self.selBGColorStart = wx.Color(157, 185, 235)
        self.selBGColorEnd = wx.Color(157, 185, 235)

        wx.Panel.__init__(self, parent, wx.ID_ANY)

        self.preferredWidth = self._calculatePreferredWidth()

        self.SetFont(getDefaultFont())
        self.closeButtonBitmap = getApplicationModel().getResourceRegistry().getBitmap(u"images/widgets/tabcontainer/close.png") #$NON-NLS-1$
        self.closeHoverButtonBitmap = getApplicationModel().getResourceRegistry().getBitmap(u"images/widgets/tabcontainer/close.png") #$NON-NLS-1$

        self.SetSize(wx.Size(self.preferredWidth, -1))

        self.Bind(wx.EVT_PAINT, self.onPaint, self)
        self.Bind(wx.EVT_ERASE_BACKGROUND, self.onEraseBackground, self)
        self.Bind(wx.EVT_ENTER_WINDOW, self.onEnter, self)
        self.Bind(wx.EVT_LEAVE_WINDOW, self.onLeave, self)
        self.Bind(wx.EVT_LEFT_DOWN, self.onLeftClickDown, self)
        self.Bind(wx.EVT_LEFT_UP, self.onLeftClickUp, self)
        self.Bind(wx.EVT_MIDDLE_DOWN, self.onMiddleClickDown, self)
        self.Bind(wx.EVT_MIDDLE_UP, self.onMiddleClickUp, self)
        self.Bind(wx.EVT_RIGHT_UP, self.onRightClick, self)

        # FIXME (EPW) show the tooltip string only if the title is truncated
        self.SetToolTipString(self.tabInfo.getTitle())
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:35,代码来源:tabs.py


示例2: initializeAspellDirectory

 def initializeAspellDirectory(self):
     spellingDir = getApplicationModel().getUserProfile().getDirectory(u"spellcheck") #$NON-NLS-1$
     aspellDir = os.path.join(spellingDir, u"aspell") #$NON-NLS-1$
     keyFilePath = os.path.join(aspellDir, u"data", u"ASCII.dat") #$NON-NLS-2$ #$NON-NLS-1$
     if not os.path.isfile(keyFilePath):
         aspellBaseZip = getApplicationModel().getResourceRegistry().getResourcePath(u"spellcheck/aspell/aspell-base.zip") #$NON-NLS-1$
         unpackZip(aspellBaseZip, aspellDir)
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:7,代码来源:aspellprovider.py


示例3: _loadStringFromFile

    def _loadStringFromFile(self, html):
        # MSHTML control requires a <head> and <title> element
        title = getNoneString( extractTitle(html) )
        if not title or html.find(u"<html") == -1: #$NON-NLS-1$
            # case where only the body content is given or the content did not have non-empty <head> and <title> elems.
            # try and create wrapper around the body. Eg:  <html><head><title>ZoundryDocument</title></head><body> CONTENT </body> </html>
            html = wrapHtmlBody(html, u"ZoundryDocument") #$NON-NLS-1$

        # note: \r\n must be replace with \n. Otherwise, in <pre> blocks, the \r' will show up as an extra line.
        html = html.replace(u"\r\n", u"\n")  #$NON-NLS-1$  #$NON-NLS-2$
        # For the test-harness to work, hard code temp dir
        tmpDir = u"c:/temp" #$NON-NLS-1$
        if getApplicationModel():
            userProfile = getApplicationModel().getUserProfile()
            tmpDir = userProfile.getTempDirectory()
        d = str(time.time())
        fname = os.path.join(tmpDir, u"_z_raven_mshtml_%s_tmp.xhtml" % d) #$NON-NLS-1$
        tmpFile = codecs.open(fname, u"w") #$NON-NLS-1$
        try:
            # write the utf-8 byte order marker for wintel platforms.
            tmpFile.write(codecs.BOM_UTF8)
            tmpFile.write( convertToUtf8(html) )
            tmpFile.close()
            self._loadFile(fname)
        finally:
            tmpFile.close()
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:26,代码来源:mshtmlcontrol.py


示例4: _saveTreeLayout

    def _saveTreeLayout(self):
        visitor = ZTreeLayoutSaveVisitor()
        self.treeView.accept(visitor)
        self._saveTreeSelection()

        # Save the properties
        getApplicationModel().getUserProfile().getProperties().save()
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:7,代码来源:navigator.py


示例5: _run

    def _run(self):
        publisherService = getApplicationModel().getService(IZBlogAppServiceIDs.PUBLISHING_SERVICE_ID)
        dataStoreService = getApplicationModel().getService(IZBlogAppServiceIDs.DATA_STORE_SERVICE_ID)
        publisher = None
        self.commands = []
        if self.blogs:
            for blog in self.blogs:
                account = blog.getAccount()
                publisher = createBlogPublisherFromAccount(account, publisherService)
                command = ZDeleteEntryCommand(publisher, dataStoreService, account, blog, self.document, False)
                command.addListener( self )
                self.commands.append(command)
        else:
            command = ZDeleteEntryCommand(None, dataStoreService, None, None, self.document, True)
            command.addListener( self )
            self.commands.append(command)

        if self.deleteLocal and self.commands:
            self.commands[len(self.commands) - 1].setDeleteLocalEntry(True)

        # Now run all of the commands.
        for command in self.commands:
            self.currentCommand = command
            if self.isCancelled():
                return
            else:
                self.currentCommand.doCommand()
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:27,代码来源:publisherutil.py


示例6: __init__

    def __init__(self):
        systemProfile = getApplicationModel().getSystemProfile()
        self.bundleDirectory = systemProfile.getBundleDirectory()
        self.i18nService = getApplicationModel().getService(IZBlogAppServiceIDs.I18N_SERVICE_ID)

        self.defaultTranslation = self._loadDefaultTranslation(self.bundleDirectory)
        self.defaultTranslation.load()
        self.translations = self._loadTranslations(self.bundleDirectory)
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:8,代码来源:translationmodel.py


示例7: updateCategories

 def updateCategories(self, account, blogList, izcommandActivityListener):
     accStoreService = getApplicationModel().getService(IZBlogAppServiceIDs.ACCOUNT_STORE_SERVICE_ID)
     publisherService = getApplicationModel().getService(IZBlogAppServiceIDs.PUBLISHING_SERVICE_ID)
     publisher = createBlogPublisherFromAccount(account, publisherService)
     blogList = self._getFilteredAccBlogList(account, blogList)
     cmd = ZListCategoriesCommand(publisher, account, blogList)
     cmd.addListener(izcommandActivityListener)
     cmd.doCommand()
     accStoreService.saveAccount(account)
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:9,代码来源:publisherutil.py


示例8: _registerAsListener

    def _registerAsListener(self):
        # Register as a data store listener
        service = getApplicationModel().getService(IZBlogAppServiceIDs.DATA_STORE_SERVICE_ID)
        service.addListener(self)

        # Register as a user prefs listener
        appModel = getApplicationModel()
        userProfile = appModel.getUserProfile()
        userPrefs = userProfile.getPreferences()
        userPrefs.addListener(self)
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:10,代码来源:previewdetails.py


示例9: downloadPosts

    def downloadPosts(self, account, blogList, maxDocs, izcommandActivityListener):
        docIndexService = getApplicationModel().getService(IZBlogAppServiceIDs.DOCUMENT_INDEX_SERVICE_ID)
        publisherService = getApplicationModel().getService(IZBlogAppServiceIDs.PUBLISHING_SERVICE_ID)
        dataStoreService = getApplicationModel().getService(IZBlogAppServiceIDs.DATA_STORE_SERVICE_ID)
        publisher = createBlogPublisherFromAccount(account, publisherService)

        blogList = self._getFilteredAccBlogList(account, blogList)
        cmd = ZDownloadEntriesCommand(dataStoreService, docIndexService, publisher, account, blogList, maxDocs)
        cmd.addListener(izcommandActivityListener)
        cmd.doCommand()
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:10,代码来源:publisherutil.py


示例10: createMediaStorages

 def createMediaStorages(self, account, izcommandActivityListener):
     accStoreService = getApplicationModel().getService(IZBlogAppServiceIDs.ACCOUNT_STORE_SERVICE_ID)
     publisherService = getApplicationModel().getService(IZBlogAppServiceIDs.PUBLISHING_SERVICE_ID)
     mediaStoreService = getApplicationModel().getService(IZBlogAppServiceIDs.MEDIA_STORAGE_SERVICE_ID)
     # create publisher
     publisher = createBlogPublisherFromAccount(account, publisherService)
     cmd = ZCreateOrUpdateBlogMediaStoragesCommand(publisher, mediaStoreService, account)
     cmd.addListener(izcommandActivityListener)
     cmd.doCommand()
     accStoreService.saveAccount(account)
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:10,代码来源:publisherutil.py


示例11: _unregisterAsListener

 def _unregisterAsListener(self):
     # Unregister from the data store
     service = getApplicationModel().getService(IZBlogAppServiceIDs.DATA_STORE_SERVICE_ID)
     service.removeListener(self)
     
     # Unregister from the user prefs object
     # Register as a user prefs listener
     appModel = getApplicationModel()
     userProfile = appModel.getUserProfile()
     userPrefs = userProfile.getPreferences()
     userPrefs.removeListener(self)
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:11,代码来源:previewdetails.py


示例12: __init__

    def __init__(self, parent):
        self.indexService = getApplicationModel().getService(IZBlogAppServiceIDs.DOCUMENT_INDEX_SERVICE_ID)
        self.accountStore = getApplicationModel().getService(IZBlogAppServiceIDs.ACCOUNT_STORE_SERVICE_ID)
        self.model = ZContextInfoTagsModel(ZTagSearchFilter())

        self.tagCloudsView = None
        self.searchTextBox = None

        ZBoxedView.__init__(self, parent)

        self._registerAsIndexListener()
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:11,代码来源:tagsview.py


示例13: _createCommand

 def _createCommand(self, account, blog, pubMetaData):
     publisherService = getApplicationModel().getService(IZBlogAppServiceIDs.PUBLISHING_SERVICE_ID)
     dataStoreService = getApplicationModel().getService(IZBlogAppServiceIDs.DATA_STORE_SERVICE_ID)
     publisher = createBlogPublisherFromAccount(account, publisherService)
     # create update or publish command and execute
     command = None
     if self.document.isPublishedToBlog( blog.getId() ):
         command = ZUpdateEntryCommand(publisher, dataStoreService, account, blog, self.document, pubMetaData)
     else:
         command = ZPublishEntryCommand(publisher, dataStoreService, account, blog, self.document, pubMetaData)
     return command
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:11,代码来源:publisherutil.py


示例14: _recoverCrashSnapshots

 def _recoverCrashSnapshots(self):
     crashRecoveryService = getApplicationModel().getService(IZBlogAppServiceIDs.CRASH_RECOVERY_SERVICE_ID)
     snapshots = crashRecoveryService.getRecoverySnapshots()
     if snapshots:
         title = _extstr(u"startup.RecoverTitle") #$NON-NLS-1$
         msg = _extstr(u"startup.RecoverMessage") % len(snapshots) #$NON-NLS-1$
         if ZShowYesNoMessage(getApplicationModel().getTopWindow(), msg, title):
             for document in snapshots:
                 editorWindow = getEditorWindow()
                 editorWindow.openDocument(document)
                 editorWindow.Show()
         crashRecoveryService.clearRecoverySnapshot()
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:12,代码来源:startup.py


示例15: updateBlogList

    def updateBlogList(self, account, selectedBlogList, izcommandActivityListener): #@UnusedVariable
        accStoreService = getApplicationModel().getService(IZBlogAppServiceIDs.ACCOUNT_STORE_SERVICE_ID)
        publisherService = getApplicationModel().getService(IZBlogAppServiceIDs.PUBLISHING_SERVICE_ID)
        # create publisher
        publisher = createBlogPublisherFromAccount(account, publisherService)

        # update account's blog list from server
        cmd = ZListBlogsCommand(publisher, account, selectedBlogList)
        cmd.addListener(izcommandActivityListener)
        cmd.listBlogs();
        # save account with the new blog lists.
        accStoreService.saveAccount(account)
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:12,代码来源:publisherutil.py


示例16: _run

 def _run(self):
     template = self.grabber.grab(self)
     if template is not None and not self.cancelled:
         template.setName(self.templateName)
         template.setSource(u"Blog [%s]" % getSafeString(self.blog.getName())) #$NON-NLS-1$
         service = getApplicationModel().getService(IZBlogAppServiceIDs.TEMPLATE_SERVICE_ID)
         service.saveTemplate(template)
         if self.bMakeDefaultTemplate:
             self.blog.setTemplateId(template.getId())
             self.blog.getPreferences().setUserPreference(IZBlogAppUserPrefsKeys.BLOG_OVERRIDE_TEMPLATE, True)
             accountService = getApplicationModel().getService(IZBlogAppServiceIDs.ACCOUNT_STORE_SERVICE_ID)
             accountService.saveAccount(self.blog.getAccount())
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:12,代码来源:templategrabber.py


示例17: __init__

    def __init__(self, parent):
        self.link = None
        self.blog = None
        self.indexService = getApplicationModel().getService(IZBlogAppServiceIDs.DOCUMENT_INDEX_SERVICE_ID)
        self.accountStore = getApplicationModel().getService(IZBlogAppServiceIDs.ACCOUNT_STORE_SERVICE_ID)
        self.model = ZContextInfoLinksModel(ZLinkSearchFilter())
        self.openLinkAction = getApplicationModel().getActionRegistry().findAction(IZAppActionIDs.OPEN_LINK_ACTION)

        ZBoxedView.__init__(self, parent)

        self._registerAsIndexListener()

        self.validSelection = False
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:13,代码来源:linksview.py


示例18: _restoreLayout

    def _restoreLayout(self):
        userPrefs = getApplicationModel().getUserProfile().getPreferences()
        width = userPrefs.getUserPreferenceInt(self.persistentId + u".width", -1) #$NON-NLS-1$
        height = userPrefs.getUserPreferenceInt(self.persistentId + u".height", -1) #$NON-NLS-1$
        posX = userPrefs.getUserPreferenceInt(self.persistentId + u".x", -1) #$NON-NLS-1$
        posY = userPrefs.getUserPreferenceInt(self.persistentId + u".y", -1) #$NON-NLS-1$

        # Bound the size
        if width < 100:
            width = -1
        if height < 100:
            width = -1

        # Bound the window position
        if posX < 0:
            posX = -1
        if posY < 0:
            posY = -1
        displaySize = wx.GetDisplaySize()
        if posX >= displaySize.GetWidth() - 50:
            posX = -1
        if posY >= displaySize.GetHeight() - 50:
            posY = -1

        if width != -1 and height != -1:
            self.SetSize(wx.Size(width, height))
        elif self.defaultToBestSize:
            self.SetSize(self.GetBestSize())
        if posX != -1 and posY != -1:
            self.SetPosition(wx.Point(posX, posY))
        elif self.defaultToCentreOnParent:
            self.CentreOnParent()
        else:
            # FIXME (EPW) this might be problematic for multi-screen setups
            self.CentreOnScreen()
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:35,代码来源:mixins.py


示例19: onActivated

 def onActivated(self, event):
     url = self.linkListView.GetItemText(event.GetIndex())
     if url:
         context = ZLinkActionContext(self, url)
         openLinkAction = getApplicationModel().getActionRegistry().findAction(IZAppActionIDs.OPEN_LINK_ACTION)
         openLinkAction.runAction(context)
     event.Skip
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:7,代码来源:linkdetails.py


示例20: onTemplateToggleButton

 def onTemplateToggleButton(self, event):
     appModel = getApplicationModel()
     userProfile = appModel.getUserProfile()
     userPrefs = userProfile.getPreferences()
     useTemplateInPreview = self.templateToggleButton.IsToggled()
     userPrefs.setUserPreference(IZBlogAppUserPrefsKeys.POST_PREVIEW_VIEW_USE_TEMPLATE, useTemplateInPreview)
     event.Skip()
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:7,代码来源:summaryview.py



注:本文中的zoundry.appframework.global_services.getApplicationModel函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python global_services.getResourceRegistry函数代码示例发布时间:2022-05-26
下一篇:
Python runtime.get_active_config函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap