Skip to content
This repository has been archived by the owner on Dec 27, 2020. It is now read-only.

Commit

Permalink
Added mt.getCategoryList and removed print statement
Browse files Browse the repository at this point in the history
  • Loading branch information
rockyburt committed Mar 15, 2011
1 parent 5ffd48e commit d2edca2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion rezine/plugins/legacy_apis/__init__.py
Expand Up @@ -49,7 +49,6 @@ def dump_post(post):
"""Dumps a post into a structure for the MetaWeblog API."""
link = url_for(post, _external=True)
tags = ','.join([x.name for x in post.tags])
print '[%s]' % tags

return dict(
pubDate=post.pub_date,
Expand Down Expand Up @@ -372,6 +371,11 @@ def mt_get_post_categories(post_id, username, password):
return map(dump_category, post.categories)


def mt_get_category_list(post_id, username, password):
request = login(username, password)
return map(dump_category, Category.query.all())


def mt_set_post_categories(post_id, username, password, categories):
request = login(username, password)
post = Post.query.get(post_id)
Expand Down Expand Up @@ -450,6 +454,7 @@ def mt_supported_methods():
(mt_get_post_categories, 'mt.getPostCategories'),
(mt_set_post_categories, 'mt.setPostCategories'),
(mt_supported_text_filters, 'mt.supportedTextFilters'),
(mt_get_category_list, 'mt.getCategoryList'),
(mt_supported_methods, 'mt.supportedMethods')
])

Expand Down

0 comments on commit d2edca2

Please sign in to comment.