Logo Search packages:      
Sourcecode: lekhonee version File versions  Download package

def lekhonee-gnome::LekhoneeGTK::messagePost (   self,
  publish 
)

Post the message to the server

Definition at line 553 of file lekhonee-gnome.py.

00553                                   :
        """
        Post the message to the server
        """
        selection = self.categoryList.get_selection()
        model, selected = selection.get_selected_rows()
        categories = [model[sec][0] for sec in selected]
        if self.wTree.get_widget("commentCheckBox").get_active():
            comment = 1
        else:
            comment = 0
        start, end = self.blogTxt.get_bounds()
        desc = unicode(self.blogTxt.get_text(start, end))
        title = unicode(self.titleTxt.get_text())
        if self.advertisement:
            mes = 'The post is brought to you by <a href="http://fedorahosted.org/lekhonee">lekhonee</a> v%s' % (__version__)
            if not self.editFlag:
                desc += '\n\n' + mes
        tags = unicode(self.tagsTxt.get_text()).split(",")
        if tags[0] == u'Tags':
            tags = []
        content = {'title':unicode(self.titleTxt.get_text()),'description':desc, 'categories':categories, 'mt_keywords':tags, 'mt_allow_comments':comment}
        try:
            if not self.editFlag:
                mes = self.server.post(content, publish)
            else:
                mes = self.server.edit(self.entry['postid'], content, publish)
            if self.editFlag:
                self.draftBttn.set_sensitive(True)
                self.publishBttn.set_label('Publish')
            self.editFlag = False
            self.getEntries()
            self.clearAll()
            dm = gtk.MessageDialog(self.window, gtk.DIALOG_MODAL, gtk.MESSAGE_INFO, gtk.BUTTONS_OK, mes)
        except Exception, e:
            dm = gtk.MessageDialog(self.window, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, e.faultString)
        dm.run()
        dm.destroy()

    def clearAll(self):


Generated by  Doxygen 1.6.0   Back to index