[go: nahoru, domu]

Skip to content

Commit

Permalink
git-svn-id: http://micolog.googlecode.com/svn/trunk@111 fd139d67-4554…
Browse files Browse the repository at this point in the history
…-0410-8437-97b8145f5b4d
  • Loading branch information
coolchyni committed Mar 23, 2010
1 parent e394e4b commit 8330ba3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
10 changes: 8 additions & 2 deletions api_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ def _wrapper(*args, **kwargs):

def format_date(d):
if not d: return None
#return xmlrpclib.DateTime(d.isoformat())
return xmlrpclib.DateTime(d)
return xmlrpclib.DateTime(d.isoformat())
# return xmlrpclib.DateTime(d)

def entry_struct(entry):
if not entry:
Expand Down Expand Up @@ -139,6 +139,12 @@ def metaWeblog_newPost(blogid, struct, publish):
if struct.has_key('mt_excerpt'):
entry.excerpt=struct['mt_excerpt']

if struct.has_key('dateCreated'): #如果有日期属性
try:
entry.date=xmlrpclib.datetime.datetime.strptime(str(post['dateCreated']), "%Y%m%dT%H:%M:%S")
except:
pass

if struct.has_key('wp_password'):
entry.password=struct['wp_password']

Expand Down
2 changes: 1 addition & 1 deletion app.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
application: micolog
application: mlog
version: 1
runtime: python
api_version: 1
Expand Down
7 changes: 7 additions & 0 deletions app/mktimefix.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from time import *
from calendar import timegm

# fix for mktime bug
# https://garage.maemo.org/tracker/index.php?func=detail&aid=4453&group_id=854&atid=3201
mktime = lambda time_tuple: calendar.timegm(time_tuple) + timezone

0 comments on commit 8330ba3

Please sign in to comment.