• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythongamewindowsbathyscaphephpguic翻訳omegattwitterframeworktestbtronarduinovb.net計画中(planning stage)directxpreviewerゲームエンジンdom

maintaince tools for sfjp magazine


Commit MetaInfo

修订版18485328b7f68a9a533620d06a857452f5dbca9a (tree)
时间2017-07-18 19:19:17
作者hylom <hylom@hylo...>
Commiterhylom

Log Message

fix some codes

更改概述

差异

--- a/sfjpmagclient/sfjpmagclient.py
+++ b/sfjpmagclient/sfjpmagclient.py
@@ -30,9 +30,9 @@ class CookieTransport(xmlrpclib.SafeTransport):
3030
3131 response = h.getresponse()
3232
33- print response.status
33+ print >> sys.stderr, response.status
3434 for hv in response.getheaders():
35- print hv[0] + ": " + hv[1]
35+ print >> sys.stderr, hv[0] + ": " + hv[1]
3636 #print response.read()
3737 for header in response.msg.getallmatchingheaders("Set-Cookie"):
3838 val = header.split(": ", 1)[1]
@@ -76,6 +76,14 @@ class MagClient(object):
7676 user_id,
7777 fields)
7878
79+ def edit_post(self, post_id, content):
80+ proxy = self._get_proxy()
81+ return proxy.wp.editPost(self._get_blog_id(),
82+ self.username,
83+ self.password,
84+ post_id,
85+ content)
86+
7987 def new_post(self, content):
8088 proxy = self._get_proxy()
8189 return proxy.wp.newPost(self._get_blog_id(),
@@ -114,4 +122,4 @@ class MagClient(object):
114122 filter)
115123 except xmlrpclib.Fault, e:
116124 # print "error {0}: {1}".format(e.faultCode, e.faultString.encode('utf8'))
117- print "error %s: %s" % (e.faultCode, e.faultString.encode('utf8'))
125+ print >> sys.stderr, "error %s: %s" % (e.faultCode, e.faultString.encode('utf8'))