gnome-blog r307 - in trunk: . protocols
- From: herzi svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-blog r307 - in trunk: . protocols
- Date: Sat, 22 Mar 2008 02:32:05 +0000 (GMT)
Author: herzi
Date: Sat Mar 22 02:32:05 2008
New Revision: 307
URL: http://svn.gnome.org/viewvc/gnome-blog?rev=307&view=rev
Log:
2008-03-22 Sven Herzberg <sven imendio com>
Support keywords in the MetaWeblog API
* blog_poster.py: added some widgets for entering tags
* blog.py,
* protocols/MetaWeblog.py,
* protocols/advogato.py,
* protocols/bloggerAPI.py,
* protocols/livejournal.py: added a "keywords" parameter to
postEntry(); implement keywords for MetaWeblog using the "mt_keywords"
field
Modified:
trunk/ChangeLog
trunk/blog.py
trunk/blog_poster.py
trunk/protocols/MetaWeblog.py
trunk/protocols/advogato.py
trunk/protocols/bloggerAPI.py
trunk/protocols/livejournal.py
Modified: trunk/blog.py
==============================================================================
--- trunk/blog.py (original)
+++ trunk/blog.py Sat Mar 22 02:32:05 2008
@@ -15,13 +15,14 @@
raise FeatureNotSupported("getBlogList")
-def postEntry (title, entry, gconf_prefix):
+def postEntry (title, entry, gconf_prefix, keywords):
client = gconf.client_get_default()
username, password, protocol, url = _getSettings(client, gconf_prefix)
blog_backend = _getBlogBackend(protocol)
return blog_backend.postEntry(username, password,
url, title, entry,
+ keywords,
client, gconf_prefix)
def uploadImage (image, gconf_prefix):
Modified: trunk/blog_poster.py
==============================================================================
--- trunk/blog_poster.py (original)
+++ trunk/blog_poster.py Sat Mar 22 02:32:05 2008
@@ -81,8 +81,16 @@
titleBox.pack_start(gtk.Label(_("Title:")), expand=False)
titleBox.pack_start(self.titleEntry)
+ self.tagEntry = gtk.Entry()
+
+ taggingBox = gtk.HBox()
+ taggingBox.set_spacing(12)
+ taggingBox.pack_start(gtk.Label(_("Tags:")), expand=False)
+ taggingBox.pack_start(self.tagEntry)
+
box.pack_start(titleBox, expand=False)
box.pack_start(scroller)
+ box.pack_start(taggingBox, expand=False)
box.pack_start(buttonBox, expand=False)
self.add(box)
@@ -133,7 +141,10 @@
if not self._postIsReasonable(html_text):
return
- successful_post = blog.postEntry(title, html_text, gconf_prefix)
+ successful_post = blog.postEntry(title,
+ html_text,
+ gconf_prefix,
+ self.tagEntry.get_text().decode('utf-8'))
if successful_post:
# Only delete the entry if posting was successful
@@ -145,6 +156,7 @@
def _clearBlogEntryText(self):
self.blogEntry.clear()
self.titleEntry.delete_text(0, -1)
+ self.tagEntry.delete_text(0, -1)
def _onPrefsButtonClicked(self, button):
self._showPrefDialog()
Modified: trunk/protocols/MetaWeblog.py
==============================================================================
--- trunk/protocols/MetaWeblog.py (original)
+++ trunk/protocols/MetaWeblog.py Sat Mar 22 02:32:05 2008
@@ -17,7 +17,7 @@
bloggerAPI.Blog.__init__(self)
def postEntry (self, username, password, base_url, title,
- entry, client, gconf_prefix):
+ entry, keywords, client, gconf_prefix):
url = self._getURL(base_url, client, gconf_prefix)
@@ -36,6 +36,7 @@
content = {}
content['title'] = title
content['description'] = entry
+ content['mt_keywords'] = keywords
try:
server.metaWeblog.newPost(blog_id, username, password, content, xmlrpclib.True)
Modified: trunk/protocols/advogato.py
==============================================================================
--- trunk/protocols/advogato.py (original)
+++ trunk/protocols/advogato.py Sat Mar 22 02:32:05 2008
@@ -14,7 +14,7 @@
def __init__(self):
pass
- def postEntry (self, username, password, url, title, entry, client, gconf_prefix):
+ def postEntry (self, username, password, url, title, entry, keywords, client, gconf_prefix):
#check for GNOME proxy configurations and use if required
proxy_transport = proxy.GnomeProxyTransport(client)
Modified: trunk/protocols/bloggerAPI.py
==============================================================================
--- trunk/protocols/bloggerAPI.py (original)
+++ trunk/protocols/bloggerAPI.py Sat Mar 22 02:32:05 2008
@@ -52,7 +52,7 @@
- def postEntry (self, username, password, base_url, title, entry, client, gconf_prefix):
+ def postEntry (self, username, password, base_url, title, entry, keywords, client, gconf_prefix):
global appkey
url = self._getURL(base_url, client, gconf_prefix)
Modified: trunk/protocols/livejournal.py
==============================================================================
--- trunk/protocols/livejournal.py (original)
+++ trunk/protocols/livejournal.py Sat Mar 22 02:32:05 2008
@@ -17,7 +17,7 @@
def __init__(self):
pass
- def postEntry (self, username, password, url, title, entry, client, gconf_prefix):
+ def postEntry (self, username, password, url, title, entry, keywords, client, gconf_prefix):
#check for GNOME proxy configurations and use if required
proxy_transport = proxy.GnomeProxyTransport(client)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]