Esempio n. 1
0
def createDefaultPubMetaDataForBlog(blog):
    if blog:
        pubMetaData = ZPubMetaData()
        pubMetaData.setAccountId(blog.getAccount().getId())
        pubMetaData.setBlogId(blog.getId())

        blogPrefs = blog.getPreferences()
        pubMetaData.setAddPoweredBy(
            blogPrefs.getUserPreferenceBool(
                IZBlogAppUserPrefsKeys.SP_ADD_POWERED_BY, False))
        pubMetaData.setForceReUploadImages(
            blogPrefs.getUserPreferenceBool(
                IZBlogAppUserPrefsKeys.SP_FORCE_REUPLOAD, False))
        pubMetaData.setUploadTNsOnly(
            blogPrefs.getUserPreferenceBool(
                IZBlogAppUserPrefsKeys.SP_UPLOAD_TNS_ONLY, False))
        pubMetaData.setAddLightbox(
            blogPrefs.getUserPreferenceBool(
                IZBlogAppUserPrefsKeys.SP_ADD_LIGHTBOX, False))
        pingSitesStr = blogPrefs.getUserPreference(
            IZBlogAppUserPrefsKeys.SP_PING_SITES, None)
        pingSites = deserializePingSiteList(pingSitesStr)
        pubMetaData.setPingServices(pingSites)
        tagSitesStr = blogPrefs.getUserPreference(
            IZBlogAppUserPrefsKeys.SP_TAG_SITES, None)
        tagSites = deserializeTagSiteList(tagSitesStr)
        pubMetaData.setTagspaceUrls(tagSites)
        return pubMetaData
    else:
        return None
Esempio n. 2
0
def createDefaultPubMetaDataForBlog(blog):
    if blog:
        pubMetaData = ZPubMetaData()
        pubMetaData.setAccountId(blog.getAccount().getId())
        pubMetaData.setBlogId(blog.getId())

        blogPrefs = blog.getPreferences()
        pubMetaData.setAddPoweredBy(blogPrefs.getUserPreferenceBool(IZBlogAppUserPrefsKeys.SP_ADD_POWERED_BY, False))
        pubMetaData.setForceReUploadImages(blogPrefs.getUserPreferenceBool(IZBlogAppUserPrefsKeys.SP_FORCE_REUPLOAD, False))
        pubMetaData.setUploadTNsOnly(blogPrefs.getUserPreferenceBool(IZBlogAppUserPrefsKeys.SP_UPLOAD_TNS_ONLY, False))
        pubMetaData.setAddLightbox(blogPrefs.getUserPreferenceBool(IZBlogAppUserPrefsKeys.SP_ADD_LIGHTBOX, False))
        pingSitesStr = blogPrefs.getUserPreference(IZBlogAppUserPrefsKeys.SP_PING_SITES, None)
        pingSites = deserializePingSiteList(pingSitesStr)
        pubMetaData.setPingServices(pingSites)
        tagSitesStr = blogPrefs.getUserPreference(IZBlogAppUserPrefsKeys.SP_TAG_SITES, None)
        tagSites = deserializeTagSiteList(tagSitesStr)
        pubMetaData.setTagspaceUrls(tagSites)
        return pubMetaData
    else:
        return None
Esempio n. 3
0
 def getSelectedPingSites(self):
     sitesStr = self.getUserPreference(IZBlogAppUserPrefsKeys.SP_PING_SITES, u"") #$NON-NLS-1$
     return deserializePingSiteList(sitesStr)
Esempio n. 4
0
 def _getSelectedPingSites(self):
     sitesStr = self.userPrefs.getUserPreference(
         IZBlogAppUserPrefsKeys.SP_PING_SITES, None)
     return deserializePingSiteList(sitesStr)
Esempio n. 5
0
 def getSelectedPingSites(self):
     if KEY_PING_SITES in self.newSettings:
         return deserializePingSiteList(self.newSettings[KEY_PING_SITES])
     else:
         return self._getSelectedPingSites()
Esempio n. 6
0
 def getSelectedPingSites(self):
     sitesStr = self.getUserPreference(IZBlogAppUserPrefsKeys.SP_PING_SITES,
                                       u"")  #$NON-NLS-1$
     return deserializePingSiteList(sitesStr)
Esempio n. 7
0
 def _getSelectedPingSites(self):
     sitesStr = self.userPrefs.getUserPreference(IZBlogAppUserPrefsKeys.SP_PING_SITES, None)
     return deserializePingSiteList(sitesStr)
Esempio n. 8
0
 def getSelectedPingSites(self):
     if KEY_PING_SITES in self.newSettings:
         return deserializePingSiteList( self.newSettings[KEY_PING_SITES] )
     else:
         return self._getSelectedPingSites()