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

Python textutil.getNoneString函数代码示例

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

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



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

示例1: importFtpMediaStore

    def importFtpMediaStore(self):
        joeyConfigDom = self._getJoeyUserConfigDom()
        if not joeyConfigDom:
            return
        try:
            url = getNoneString( joeyConfigDom.selectSingleNode(u"/joey/user-config/media-rep/url").getText() ) #$NON-NLS-1$
            host = getNoneString( joeyConfigDom.selectSingleNode(u"/joey/user-config/media-rep/remote/ip").getText() ) #$NON-NLS-1$
            port = getNoneString( joeyConfigDom.selectSingleNode(u"/joey/user-config/media-rep/remote/port").getText() ) #$NON-NLS-1$
            path = joeyConfigDom.selectSingleNode(u"/joey/user-config/media-rep/remote/path").getText() #$NON-NLS-1$
            username = getNoneString( joeyConfigDom.selectSingleNode(u"/joey/user-config/media-rep/remote/username").getText() )#$NON-NLS-1$
            password = getNoneString( joeyConfigDom.selectSingleNode(u"/joey/user-config/media-rep/remote/password").getText() ) #$NON-NLS-1$

            props = None
            if url and len(url) > 7 and  host and port and username and password:
                props = {}
                props[u"host"] = host  #$NON-NLS-1$
                props[u"port"] = int(port)  #$NON-NLS-1$
                props[u"username"] = username  #$NON-NLS-1$
                props[u"password"] = password  #$NON-NLS-1$
                props[u"path"] = path  #$NON-NLS-1$
                props[u"url"] = url #$NON-NLS-1$
                props[u"passive"] = True #$NON-NLS-1$
                registryList = self._getRegistryEntries(None) #@UnusedVariable
                # FIXME (PJ) create Raven FTP media site. Add regFiles to media store reg. Associate *imported raven* account that do not have publisher type fileupload with ftp.
                # store = self.mediaStoreService.createMediaStorage(u"FTP (BlogWriter)", u"zoundry.blogapp.mediastorage.site.customftp", properties) #$NON-NLS-2$ #$NON-NLS-1$
        except:
            pass
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:27,代码来源:zbwimporter.py


示例2: _validateBlog

    def _validateBlog(self, blog, validationReporter):
        zaccount = blog.getAccount()
        if not zaccount:
            # defect 534 work around - should not get here
            logger = getLoggerService()
            logger.error(u"Account information not available for Blog ID %s" % blog.getId() ) #$NON-NLS-1$
            validationReporter.addError(u"Blog Account", u"Account information not available for blog %s" % blog.getName() ) #$NON-NLS-1$ #$NON-NLS-2$
            return

        username = zaccount.getAttribute(u"username")#$NON-NLS-1$
        if not getNoneString(username):
            validationReporter.addError(u"Blog Account", u"Username is missing for blog %s" % blog.getName() ) #$NON-NLS-1$ #$NON-NLS-2$
        cyppass = zaccount.getAttribute(u"password")#$NON-NLS-1$
        if not getNoneString(cyppass):
            validationReporter.addError(u"Blog Account", u"Password is missing for blog %s" % blog.getName() ) #$NON-NLS-1$ #$NON-NLS-2$
        else:
            password = None
            try:
                password = crypt.decryptCipherText(cyppass, PASSWORD_ENCRYPTION_KEY)
            except:
                pass
            if not getNoneString(password):
                validationReporter.addError(u"Blog Account", u"Invalid password set for blog %s. Please set the blog account password." % blog.getName() ) #$NON-NLS-1$ #$NON-NLS-2$

        apiInfo = zaccount.getAPIInfo()
        url = apiInfo.getUrl()
        if not getNoneString(url):
            validationReporter.addError(u"Blog Account", u"Blog API URL is required for blog %s" % blog.getName() ) #$NON-NLS-1$ #$NON-NLS-2$

        siteId = apiInfo.getType()
        if not getNoneString(siteId):
            validationReporter.addError(u"Blog Account", u"Blog API type is required for blog %s" % blog.getName() ) #$NON-NLS-1$ #$NON-NLS-2$
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:32,代码来源:validators.py


示例3: createHtmlElement

def createHtmlElement(parentElement, elementName, attrMap = {}, elementText = None):
    u"""createHtmlElement(Node, string, map, string) -> Node
    Creates a element given element name, attribute map and optional element node text.
    If the parentElement node is None, then element is under new document (zdom).
     """ #$NON-NLS-1$
    element = None
    elementName = getNoneString(elementName)
    elementText = getNoneString(elementText)
    if not elementName:
        return None
    dom = None
    if parentElement:
        dom = parentElement.ownerDocument
    else:
        dom = ZDom()
        dom.loadXML(ELEMENT_TEMPLATE)
        parentElement = dom.documentElement
    try:
        element = dom.createElement(elementName)
        parentElement.appendChild(element)
        for (n,v) in attrMap.iteritems():
            if n and v:                
                element.setAttribute(n,v)
        if elementText:
            element.setText(elementText)
    except:
        pass    
    return element
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:28,代码来源:xhtmldocutil.py


示例4: ping

    def ping(self, pingUrl, id, url, title, blogName, excerpt):
        u"""ping(string, string, string, string, string, string) -> ZTrackbackPingResponse
        Pings the track back and returns ZTrackbackPingResponse""" #$NON-NLS-1$
        if getNoneString(pingUrl) is None:
            return ZTrackbackPingResponse(False, u"Trackback ping url is required.") #$NON-NLS-1$

        if getNoneString(id) is None:
            return ZTrackbackPingResponse(False, u"Trackback Originating Resource ID is required.") #$NON-NLS-1$

        if getNoneString(url) is None:
            return ZTrackbackPingResponse(False, u"Trackback post url is required.") #$NON-NLS-1$

        title = convertToUtf8( getSafeString(title) )
        blogName = convertToUtf8( getSafeString(blogName))
        excerpt = convertToUtf8( getSafeString(excerpt))

        postData = {
            u'id': id, #$NON-NLS-1$
            u'url': url, #$NON-NLS-1$
            u'title': title, #$NON-NLS-1$
            u'blog_name': blogName, #$NON-NLS-1$
            u'excerpt': excerpt #$NON-NLS-1$
        }

        htmlResult = self._sendHttpPostData(pingUrl, postData)
        resp = self._parseResponse(htmlResult)
        return resp
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:27,代码来源:trackback.py


示例5: updatePubMetaData

    def updatePubMetaData(self, pubMetaData):
        # Flushes the UI data to the pubMetaData object.
        pubMetaData.setAddPoweredBy(self.poweredByZoundryCB.IsChecked())
        pubMetaData.setForceReUploadImages(self.forceUploadCB.IsChecked())
        pubMetaData.setAddLightbox(self.lightboxCB.IsChecked())
        pubMetaData.setPublishAsDraft(self.draftCB.IsChecked())
        pubMetaData.setPublishTime(None)
        if self.overridePubTimeCB.IsChecked():
            pubTime = self.dateCtrl.getDateTime()
            pubMetaData.setPublishTime(pubTime)
        pubMetaData.setUploadTNsOnly(self.thumbnailsOnlyCB.IsChecked())

        # WP custom data
        slug = getNoneString(self.wpPostSlugTextCtrl.GetValue() )
        setCustomWPMetaDataAttribute(pubMetaData, u"wp_slug", slug) #$NON-NLS-1$
        # password
        pw = getNoneString(self.wpPasswordTextCtrl.GetValue() )
        setCustomWPMetaDataAttribute(pubMetaData, u"wp_password", pw) #$NON-NLS-1$

        pubstatus = None        
        if self.wpPublishStatusValue == ZPubMetaDataView.WP_PUBLISHED:
            pubstatus = u"publish" #$NON-NLS-1$
        elif self.wpPublishStatusValue == ZPubMetaDataView.WP_DRAFT:
            pubstatus = u"draft" #$NON-NLS-1$
        elif self.wpPublishStatusValue == ZPubMetaDataView.WP_PENDING:
            pubstatus = u"pending" #$NON-NLS-1$            
        elif self.wpPublishStatusValue == ZPubMetaDataView.WP_PRIVATE:
            pubstatus = u"private" #$NON-NLS-1$
                                    
        if pubstatus:
            setCustomWPMetaDataAttribute(pubMetaData, u"post_status", pubstatus) #$NON-NLS-1$
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:31,代码来源:pubdatawidgets.py


示例6: _storeDocument

 def _storeDocument(self, document, connection):
     params = [
           document.getId(),
           document.getTitle(),
           getNoneString(document.getCreationTime()),
           getNoneString(document.getLastModifiedTime())
     ]
     self._insert(u"INSERT INTO Document (DocumentId, Title, CreationTime, LastModifiedTime) values (?, ?, ?, ?)", params, connection) #$NON-NLS-1$
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:8,代码来源:sqlprovider.py


示例7: _createAmazonAssociateLink

 def _createAmazonAssociateLink(self, productUrl, asin, assoicateId):
     asin = getNoneString(asin)
     if asin:
         return u"http://www.amazon.com/exec/obidos/ASIN/%s/ref=nosim/%s" % (asin, assoicateId) #$NON-NLS-1$
     productUrl = getNoneString(productUrl)
     if not productUrl:
         return None
     productUrl = encodeUri(productUrl)
     return u"http://www.amazon.com/exec/obidos/redirect?tag=%s&path=%s" % (assoicateId, productUrl) #$NON-NLS-1$
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:9,代码来源:merchants.py


示例8: _setEditorFonts

 def _setEditorFonts(self):
     try:
         userPrefs = getApplicationModel().getUserProfile().getPreferences()
         fontName = getNoneString(userPrefs.getUserPreference(IZBlogAppUserPrefsKeys.EDITOR_FONT_NAME, u"")) #$NON-NLS-1$
         fontSize = getNoneString(userPrefs.getUserPreference(IZBlogAppUserPrefsKeys.EDITOR_FONT_SIZE, u"")) #$NON-NLS-1$
         if fontName:
             self._getMshtmlControl().getIHTMLDocument().body.style.fontFamily = fontName
         if fontSize:
             self._getMshtmlControl().getIHTMLDocument().body.style.fontSize = fontSize
     except:
         pass
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:11,代码来源:mshtmlblogposteditcontrol.py


示例9: _getPicasaServer

 def _getPicasaServer(self):
     if not self.picasaServer:
         username = None
         password = None
         if u"username" in self.properties: #$NON-NLS-1$
             username = getNoneString(self.properties[u"username"]) #$NON-NLS-1$
         if not username:
             raise ZException(u"Picasa web album account username is required.") #$NON-NLS-1$
         if u"password" in self.properties: #$NON-NLS-1$
             password = getNoneString(self.properties[u"password"]) #$NON-NLS-1$
         if not password:
             raise ZException(u"Picasa web album account password is required.") #$NON-NLS-1$
         self.picasaServer = ZPicasaServer(username, password)
         self.picasaServer.setLogger(getLoggerService())
     return self.picasaServer
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:15,代码来源:picasaprovider.py


示例10: _extractRssItems

 def _extractRssItems(self, url, title, htmlContent): #@UnusedVariable
     u"""Extracts the RSS Item data from the given content string and returns a list of Trackback objects.""" #$NON-NLS-1$
     ## NOTE: Needs more testing.
     rssTbList = []
     itemEleList = ITEM_RE.findall(htmlContent)
     for item in itemEleList:
         link = self._extract(ITEM_LINK_RE,item)
         desc = self._extract(ITEM_DESC_RE,item)
         pingUrl = self._extract(ITEM_TB_1_RE,item)
         if getNoneString(pingUrl) is None:
             pingUrl = self._extract(ITEM_TB_2_RE,item)
         if getNoneString(pingUrl) is not None:
             tb = ZTrackbackEntry(pingUrl, entryUrl=link, title=desc, summary=u"") #$NON-NLS-1$
             rssTbList.append(tb)
     return rssTbList
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:15,代码来源:trackback.py


示例11: _sendTrackbacks

 def _sendTrackbacks(self, trackbackUrlList):
     blog = self._getContext().getBlog()
     blogName = getNoneString( blog.getName() )
     id = blog.getUrl()
     title = self._getContext().getTitle()
     if blogName is None:
         blogName = title
     # get the post entry url.
     postUrl = getNoneString( self._getContext().getUrl() )
     if not postUrl:
         pass
         #log error and return
     if not id:
         id = postUrl
     # post summary
     excerpt = self._getContext().getXhtmlDocument().getSummary(500)
     pinger = ZTrackbackPinger()
     sentCount = 0
     for pingUrl in trackbackUrlList:
         if self.isCancelled():
             return
         s = u"Sending trackback to %s" % pingUrl #$NON-NLS-1$
         self._getContext().logInfo(self, s)
         self._getContext().notifyProgress(self, s, 1, False)
         ok = False
         msg = u"" #$NON-NLS-1$
         try:
             response = pinger.ping(pingUrl, id, postUrl, title, blogName, excerpt)
             ok = response.isSuccessful()
             msg = getSafeString(response.getMessage())
         except Exception, e:
             ok = False
             msg = unicode(e)
         if ok:
             trackback = ZTrackback()
             trackback.setUrl(pingUrl) #$NON-NLS-1$
             trackback.setSentDate(ZSchemaDateTime())
             pubInfo = self._getPubInfo()
             if pubInfo:
                 pubInfo.addTrackback(trackback)
             sentCount = sentCount + 1
             s = u"Trackback sent successfully: %s" % msg #$NON-NLS-1$
             self._getContext().logInfo(self, s)
             self._getContext().notifyProgress(self, s, 0, False)
         else:
             s = u"Trackback failed: %s" % msg #$NON-NLS-1$
             self._getContext().logError(self, s)
             self._getContext().notifyProgress(self, s, 0, False)
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:48,代码来源:postpubhandlers.py


示例12: _getProperties

    def _getProperties(self):
        if not self.firstTime:
            return
        self.firstTime = False
        elem = self._getElement()
        if not elem or not elem.style:
            return

#        print "---"
#        print "IN", len(elem.innerText)
#        print "TR", len(self.mshtmlIHTMLTextRange.text)
#        print "IN}%s{" % elem.innerText
#        print "TR}%s{" % self.mshtmlIHTMLTextRange.text
        bgColor = None
        color = None
        fontSize = None
        fontName = None
        self.hasCSSFontSize = False
        self.hasCSSFontName = False

        # walk up the ladder and build css font properties
        while (elem != None):
            if not self.hasCSSFontSize and getNoneString(elem.style.fontSize):
                self.hasCSSFontSize = True
            if not self.hasCSSFontName and getNoneString(elem.style.fontFamily):
                self.hasCSSFontName = True

            if not bgColor:
                bgColor = getNoneString( elem.style.backgroundColor )
            if not color:
                color = getNoneString(elem.style.color)
            if not fontName:
                fontName = self.mshtmlControl.queryCommandValue(u"FontName") #$NON-NLS-1$
            if not fontSize:
                fontSize = getNoneString(elem.style.fontSize)
            if elem.tagName == u"BODY": #$NON-NLS-1$
                break
            if (color and bgColor and fontSize and fontName):
                break
            elem = elem.parentElement
        # end while
        if color:
            self.cssColor = ZCssColor(color)
        if bgColor:
            self.cssBgColor = ZCssColor(bgColor)
        self.fontInfo = ZCssFontInfo()
        self.fontInfo.setFontName(fontName)
        self.fontInfo.setFontSize(fontSize)
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:48,代码来源:mshtmleditor.py


示例13: _sendUploadFile

    def _sendUploadFile(self, fileName, metaTitle = None, metaDesc = None, zBlogServerMediaUploadListener = None, gallery=None):
        fileDescriptor = None
        if hasattr(fileName, u'read'): #$NON-NLS-1$
            # file name is a file descriptor. get name from descriptor.
            fileDescriptor = fileName     
            fileName = fileDescriptor.name.split(u'/')[-1] #$NON-NLS-1$   
        metaFilename = os.path.basename(fileName)
        if not metaTitle:
            metaTitle =  metaFilename
        if not metaDesc:
            metaDesc  =  metaFilename

        if not getNoneString(gallery):
            gallery = FB_GALLERY_NAME
        picMd5 = self._getFileMD5(fileName)
        picSize = os.path.getsize(fileName)
        fbRequest = ZFotoBilderRequest(u"UploadPic", fileName, fileDescriptor, zBlogServerMediaUploadListener) #$NON-NLS-1$
        fbRequest.addRequestParam(u"X-FB-UploadPic.MD5", picMd5) #$NON-NLS-1$
        #fbRequest.addRequestParam("X-FB-UploadPic.PicSec", "1")
        fbRequest.addRequestParam(u"X-FB-UploadPic.ImageLength", str(picSize) ) #$NON-NLS-1$
        fbRequest.addRequestParam(u"X-FB-UploadPic.Meta.Filename", metaFilename ) #$NON-NLS-1$
        fbRequest.addRequestParam(u"X-FB-UploadPic.Meta.Title", metaTitle )#$NON-NLS-1$
        fbRequest.addRequestParam(u"X-FB-UploadPic.Meta.Description", metaDesc ) #$NON-NLS-1$
        fbRequest.addRequestParam(u"X-FB-UploadPic.Gallery._size", u"1" ) #$NON-NLS-1$ #$NON-NLS-2$
        fbRequest.addRequestParam(u"X-FB-UploadPic.Gallery.0.GalName", gallery ) #$NON-NLS-1$
        #fbRequest.addRequestParam("X-FB-UploadPic.Gallery.0.GalSec", "")
        fbResponse = self._sendRequest(fbRequest)
        return fbResponse
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:28,代码来源:fotobilder.py


示例14: _parseMargin

 def _parseMargin(self, imageEle):
     # return "top right bottom left"
     cssAttrs = self._getStyleMap(imageEle)
     if cssAttrs.has_key(u"margin") and getNoneString(cssAttrs[u"margin"]) is not None: #$NON-NLS-1$ #$NON-NLS-2$
         (t, r, b, l) = parseCssRectangleProperty(cssAttrs[u"margin"]) #$NON-NLS-1$
         return u"%s %s %s %s" % (t, r, b, l) #$NON-NLS-1$
     return None
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:7,代码来源:mshtmlimglinkctx.py


示例15: _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


示例16: _populateAtomEntry

    def _populateAtomEntry(self, atomEntry, zserverBlogEntry):
        title = getSafeString( zserverBlogEntry.getTitle() )
        content = getSafeString( self._formatContentForPublishing( zserverBlogEntry ) )
        utcDateTime = zserverBlogEntry.getUtcDateTime()
        draft = zserverBlogEntry.isDraft()
        author = getNoneString( zserverBlogEntry.getAuthor() )
        if not author:
            author = self.getUsername()

        atomEntry.setTitle(title)
        atomEntry.setDate(utcDateTime)
        atomEntry.setContent(content)
        atomEntry.setDraft(draft)
        atomEntry.setAuthor(author)

        atomCatList = []
        # list of categories already added
        catNames = []
        for cat in zserverBlogEntry.getCategories():
            # map Zoundry cat id to atom category 'term' attribute.
            atomCat = ZAtomCategory(cat.getId(), cat.getName() )
            atomCatList.append( atomCat )
            name = cat.getName().lower()
            if name not in catNames:
                catNames.append(name)
        # Special case for Blogger. Blend zcategories + ztags into atom catories
        # FIXME (PJ) externalize this to a capability or param
        if zserverBlogEntry.getTagwords() and self.getApiUrl().startswith(u"http://www.blogger.com/feeds/default/blogs"): #$NON-NLS-1$
            for tagword in zserverBlogEntry.getTagwords():
                if tagword.lower() not in catNames:
                    catid = tagword
                    atomCat = ZAtomCategory(catid, tagword )
                    atomCatList.append( atomCat )

        atomEntry.setCategories(atomCatList)
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:35,代码来源:atomapi.py


示例17: _getSuggestionList

 def _getSuggestionList(self, word):
     u"""Returns a list of suggested words for the given word.""" #$NON-NLS-1$
     word = getNoneString(word)
     if word and self._getSpellChecker():
         return self._getSpellChecker().suggest(word)
     else:
         return []
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:7,代码来源:spellcheckcontext.py


示例18: _process

    def _process(self):
        if self.pingSites is None:
            return
        blog = self._getContext().getBlog()
        blogName = getNoneString( blog.getName() )
        if blogName is None:
            # get the post entry title
            blogName = self._getContext().getTitle()

        blogUrl = blog.getUrl()
        if blogUrl is None:
            # get the post entry url.
            blogUrl = self._getContext().getUrl()

        pingServer = ZWeblogPingServer()
        for weblogPingSite in self.pingSites:
            if self.isCancelled():
                return
            s = u"Pinging %s at %s" % ( weblogPingSite.getName(), weblogPingSite.getUrl() ) #$NON-NLS-1$
            self._getContext().logInfo(self, s)
            self._getContext().notifyProgress(self, s, 1, False)

            weblogPingResponse = pingServer.ping(weblogPingSite.getUrl(), blogName, blogUrl)
            if weblogPingResponse.isSuccessful():
                s = u"Pinged %s successfully: %s" % ( weblogPingSite.getName(),weblogPingResponse.getMessage() ) #$NON-NLS-1$
                self._getContext().logInfo(self, s)
                self._getContext().notifyProgress(self, s, 0, False)

            else:
                s = u"Pinging %s failed: %s" % ( weblogPingSite.getName(),weblogPingResponse.getMessage() ) #$NON-NLS-1$
                self._getContext().logError(self, s)
                self._getContext().notifyProgress(self, s, 0, False)
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:32,代码来源:postpubhandlers.py


示例19: _isMisspelled

 def _isMisspelled(self, word):
     u"""Returns true if the given word is not in the dictionary.""" #$NON-NLS-1$
     word = getNoneString(word)
     if word and self._getSpellChecker():
         return not self._getSpellChecker().check(word)
     else:
         return True
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:7,代码来源:spellcheckcontext.py


示例20: _storeBlogInfo

 def _storeBlogInfo(self, documentId, blogInfo, connection):
     pubInfo = blogInfo.getPublishInfo()
     draft = 0
     if pubInfo.isDraft():
         draft = 1
     params = [
           documentId,
           blogInfo.getAccountId(),
           blogInfo.getBlogId(),
           pubInfo.getBlogEntryId(),
           getNoneString(pubInfo.getPublishedTime()),
           getNoneString(pubInfo.getSynchTime()),
           draft,
           pubInfo.getUrl()
     ]
     self._insert(u"INSERT INTO PublishedData (DocumentId, AccountId, BlogId, BlogEntryId, IssuedTime, SynchTime, Draft, Permalink) values (?, ?, ?, ?, ?, ?, ?, ?)", params, connection) #$NON-NLS-1$
开发者ID:Tidosho,项目名称:zoundryraven,代码行数:16,代码来源:sqlprovider.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python textutil.getSafeString函数代码示例发布时间:2022-05-26
下一篇:
Python messages._extstr函数代码示例发布时间: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