示例#1
0
 def remove_blog(self, index):
     """delete blog"""
     try:
         del self.blogs[index]
     except IndexError, err:
         display_warning(_("Blog already deleted."),
                         error=err)
 def remove_blog(self):
     assert get_facade(), "Facade not initialiazed"
     selected = self.GetSelection()
     if selected != wx.NOT_FOUND:
         get_facade().remove_blog(selected)
     else:
         display_warning(_("none selected"))
 def remove_blog(self):
     selected = self.GetSelection()
     if selected != wx.NOT_FOUND:
         self.blog.remove_blog(selected)
         self.refresh()
     else:
         display_warning(_("none selected"))
 def add_comment(self, text):
     """store blog in cache as wx.HtmlListBox is virtual"""
     assert get_facade(), "Facade not initialiazed"
     selected = self.GetSelection()
     if selected != wx.NOT_FOUND:
         get_facade().add_comment(selected, text, get_facade()._desc.document.get_pseudo())
     else:
         display_warning(_("none selected"))
 def add_comment(self, text):
     """store blog in cache as wx.HtmlListBox is virtual"""
     selected = self.GetSelection()
     if selected != wx.NOT_FOUND:
         pseudo = get_facade()._desc.document.get_pseudo()
         self.blog.add_comment(selected, text, pseudo)
         self.refresh()
     else:
         display_warning(_("none selected"))
示例#6
0
def retro_compatibility(blogs):
    """make sure that downloaded version is the good one"""
    if not hasattr(blogs, "version"):
        # v 0.1.0: self.owner & self.blogs only
        return Blogs(blogs.blogs)
    elif blogs.version == "0.2.0":
        # v 0.2.0: + self._id & self._dir added
        #            self.owner becomes self.pseudo
        return Blogs(blogs.blogs)
    elif blogs.version in ["0.2.1", "0.2.2"]:
        # v 0.2.1: - self._id removed
        return Blogs(blogs.blogs)
    elif blogs.version == "0.3.0":
        # v 0.3.0: - self.pseudo & self._dir removed 
        return blogs
    else:
        display_warning(_("Could not read blog file. Using a blank one."))