• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

maintaince tools for sfjp magazine


Commit MetaInfo

Revision08b76a4084dc558885978a7f5aa051d8beacd859 (tree)
Zeit2013-04-12 19:47:17
Autorhylom <hylom@hylo...>
Commiterhylom

Log Message

add get_user method

Ändern Zusammenfassung

Diff

--- a/sfjpmagclient/sfjpmagclient.py
+++ b/sfjpmagclient/sfjpmagclient.py
@@ -26,6 +26,14 @@ class MagClient(object):
2626 def _get_proxy(self):
2727 return xmlrpclib.ServerProxy(self.uri)
2828
29+ def get_user(self, user_id, fields=[]):
30+ proxy = self._get_proxy()
31+ return proxy.wp.getUser(self._get_blog_id(),
32+ self.username,
33+ self.password,
34+ user_id,
35+ fields)
36+
2937 def get_users_blogs(self):
3038 proxy = self._get_proxy()
3139 return proxy.wp.getUsersBlogs(self.username, self.password)
--- a/test/test_getposts.py
+++ b/test/test_getposts.py
@@ -1,6 +1,7 @@
11 #!/usr/bin/python
22 # -*- coding: utf-8 -*-
33
4+import json
45 import sys
56 sys.path.append('.')
67
@@ -15,6 +16,7 @@ auth_pass = config["auth_pass"]
1516 c = MagClient(username, password, auth_user, auth_pass)
1617 ret = c.get_posts(dict(number=10))
1718 print len(ret)
19+print ret[0]
1820 for item in ret:
1921 print item["post_title"], item["link"]
2022