Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

修正wp_import插件只能导入目录和导入文件过小的问题

修正tinymce编辑器在IE6下无法保存文章问题

git-svn-id: http://micolog.googlecode.com/svn/trunk@119 fd139d67-4554-0410-8437-97b8145f5b4d
  • Loading branch information...
commit 0e5c308468d5cd12ae2c9fd4b36f7b06752947bd 1 parent 5da0086
coolchyni@gmail.com authored
84 admin.py
View
@@ -18,7 +18,7 @@
from google.appengine.api import memcache
from google.appengine.api.labs import taskqueue
from datetime import datetime ,timedelta
-import base64,random,math
+import base64,random,math,zipfile
from django.utils import simplejson
import pickle
from base import *
@@ -75,9 +75,9 @@ def get(self,slug=None):
if func and callable(func):
func()
else:
- self.render2('views/admin/error.html',{'message':'This operate has not defined!'})
+ self.render2('views/admin/error.html',{'message':_('This operate has not defined!')})
except:
- self.render2('views/admin/error.html',{'message':'This operate has not defined!'})
+ self.render2('views/admin/error.html',{'message':_('This operate has not defined!')})
@requires_admin
def post(self,slug=None):
@@ -86,16 +86,16 @@ def post(self,slug=None):
if func and callable(func):
func()
else:
- self.render2('views/admin/error.html',{'message':'This operate has not defined!'})
+ self.render2('views/admin/error.html',{'message':_('This operate has not defined!')})
except:
- self.render2('views/admin/error.html',{'message':'This operate has not defined!'})
+ self.render2('views/admin/error.html',{'message':_('This operate has not defined!')})
def action_test(self):
self.write(os.environ)
def action_cacheclear(self):
memcache.flush_all()
- self.write('"Cache cleared successful"')
+ self.write(_('"Cache cleared successful"'))
def action_updatecomments(self):
for entry in Entry.all():
@@ -103,7 +103,7 @@ def action_updatecomments(self):
if cnt<>entry.commentcount:
entry.commentcount=cnt
entry.put()
- self.write('"ok"')
+ self.write(_('"All comments updated"'))
def action_updatelink(self):
link_format=self.param('linkfmt')
@@ -124,9 +124,9 @@ def action_updatelink(self):
if entry.link<>newlink:
entry.link=newlink
entry.put()
- self.write('"ok"')
+ self.write(_('"Link formated succeed"'))
else:
- self.write('"Please input url format."')
+ self.write(_('"Please input url format."'))
def action_init_blog(self,slug=None):
@@ -137,7 +137,7 @@ def action_init_blog(self,slug=None):
entry.delete()
g_blog.entrycount=0
- self.write('"Init has succeed."')
+ self.write(_('"Init has succeed."'))
def action_update_tags(self,slug=None):
for tag in Tag.all():
@@ -150,7 +150,7 @@ def action_update_tags(self,slug=None):
except:
traceback.print_exc()
- self.write('"All tags for entry have been updated."')
+ self.write(_('"All tags for entry have been updated."'))
def action_update_archives(self,slug=None):
@@ -159,7 +159,7 @@ def action_update_archives(self,slug=None):
entries=Entry.all()
for entry in entries:
entry.update_archive()
- self.write('"All entries have been updated."')
+ self.write(_('"All entries have been updated."'))
def action_trackback_ping(self):
@@ -380,13 +380,19 @@ def post(self,slug='post'):
tags=self.param("tags")
cats=self.request.get_all('cats')
key=self.param('key')
- published=self.parambool('publish')
+ if self.param('publish')!='':
+ published=True
+ elif self.param('unpublish')!='':
+ published=False
+ else:
+ published=self.param('published')=='True'
+
allow_comment=self.parambool('allow_comment')
allow_trackback=self.parambool('allow_trackback')
entry_slug=self.param('slug')
entry_parent=self.paramint('entry_parent')
menu_order=self.paramint('menu_order')
- entry_excerpt=self.param('excerpt')
+ entry_excerpt=self.param('excerpt').replace('\n','<br>')
password=self.param('password')
sticky=self.parambool('sticky')
@@ -413,7 +419,7 @@ def mapit(cat):
'sticky':sticky}
}
if not (title and (content or (is_external_page and external_page_address))):
- vals.update({'result':False, 'msg':'Please input title and content or external_page_address.'})
+ vals.update({'result':False, 'msg':_('Please input title and content or external_page_address.')})
self.render2('views/admin/entry.html',vals)
else:
if action=='add':
@@ -443,7 +449,12 @@ def mapit(cat):
entry.categorie_keys=newcates;
entry.save(published)
- vals.update({'action':'edit','result':True,'msg':'Saved ok','entry':entry})
+ if published:
+ smsg=_('Saved ok. <a href="/%s" target="_blank">View it now!</a>')
+ else:
+ smsg=_('Saved ok.')
+
+ vals.update({'action':'edit','result':True,'msg':_('Saved ok. <a href="/%s" target="_blank">View it now!</a>')%entry.link,'entry':entry})
self.render2('views/admin/entry.html',vals)
elif action=='edit':
try:
@@ -474,12 +485,15 @@ def mapit(cat):
entry.allow_trackback=allow_trackback
entry.save(published)
-
- vals.update({'result':True,'msg':'Saved ok','entry':entry})
+ if published:
+ smsg=_('Saved ok. <a href="/%s" target="_blank">View it now!</a>')
+ else:
+ smsg=_('Saved ok.')
+ vals.update({'result':True,'msg':_('Saved ok. <a href="/%s" target="_blank">View it now!</a>')%entry.link,'entry':entry})
self.render2('views/admin/entry.html',vals)
except:
- vals.update({'result':False,'msg':'Error:Entry can''t been saved.'})
+ vals.update({'result':False,'msg':_('Error:Entry can''t been saved.')})
self.render2('views/admin/entry.html',vals)
@@ -641,7 +655,7 @@ def post(self):
vals={'action':action,'postback':True,'current':'links'}
if not (name and url):
- vals.update({'result':False,'msg':'Please input name and url.'})
+ vals.update({'result':False,'msg':_('Please input name and url.')})
self.render2('views/admin/link.html',vals)
else:
if action=='add':
@@ -661,7 +675,7 @@ def post(self):
self.redirect('/admin/links')
except:
- vals.update({'result':False,'msg':'Error:Link can''t been saved.'})
+ vals.update({'result':False,'msg':_('Error:Link can''t been saved.')})
self.render2('views/admin/link.html',vals)
class admin_category(BaseRequestHandler):
@@ -692,13 +706,13 @@ def post(self):
vals={'action':action,'postback':True}
if not (name and slug):
- vals.update({'result':False,'msg':'Please input name and slug.'})
+ vals.update({'result':False,'msg':_('Please input name and slug.')})
self.render2('views/admin/category.html',vals)
else:
if action=='add':
cat= Category(name=name,slug=slug)
cat.put()
- vals.update({'result':True,'msg':'Saved ok'})
+ vals.update({'result':True,'msg':_('Saved ok')})
self.render2('views/admin/category.html',vals)
elif action=='edit':
try:
@@ -710,7 +724,7 @@ def post(self):
self.redirect('/admin/categories')
except:
- vals.update({'result':False,'msg':'Error:Category can''t been saved.'})
+ vals.update({'result':False,'msg':_('Error:Category can''t been saved.')})
self.render2('views/admin/category.html',vals)
class admin_status(BaseRequestHandler):
@@ -778,7 +792,7 @@ def post(self):
vals={'action':action,'postback':True}
if not (name and slug):
- vals.update({'result':False,'msg':'Please input dispname and email.'})
+ vals.update({'result':False,'msg':_('Please input dispname and email.')})
self.render2('views/admin/author.html',vals)
else:
if action=='add':
@@ -800,7 +814,7 @@ def post(self):
self.redirect('/admin/authors')
except:
- vals.update({'result':False,'msg':'Error:Author can''t been saved.'})
+ vals.update({'result':False,'msg':_('Error:Author can''t been saved.')})
self.render2('views/admin/author.html',vals)
class admin_plugins(BaseRequestHandler):
def __init__(self):
@@ -835,8 +849,7 @@ def get(self,slug=None):
return
plugins=self.blog.plugins.filter('active',True)
if not plugin.active:
- pcontent=_('''<div>Plugin '%s' havn't actived!</div><br><form method="post" action="/admin/plugins?action=activate&amp;plugin=%s&amp;return=/admin/plugins/%s">
-<input type="submit" value="Activate Now"/></form>''')%(plugin.name,plugin.iname,plugin.iname)
+ pcontent=_('''<div>Plugin '%(name)s' havn't actived!</div><br><form method="post" action="/admin/plugins?action=activate&amp;plugin=%(iname)s&amp;return=/admin/plugins/%(iname)s"><input type="submit" value="Activate Now"/></form>''')%{'name':plugin.name,'iname':plugin.iname}
plugins.insert(0,plugin)
else:
pcontent=plugin.get(self)
@@ -857,8 +870,7 @@ def post(self,slug=None):
return
plugins=self.blog.plugins.filter('active',True)
if not plugin.active:
- pcontent=_('''<div>Plugin '%s' havn't actived!</div><br><form method="post" action="/admin/plugins?action=activate&amp;plugin=%s&amp;return=/admin/plugins/%s">
-<input type="submit" value="Activate Now"/></form>''')%(plugin.name,plugin.iname,plugin.iname)
+ pcontent=_('''<div>Plugin '%(name)s' havn't actived!</div><br><form method="post" action="/admin/plugins?action=activate&amp;plugin=%(iname)s&amp;return=/admin/plugins/%(iname)s"><input type="submit" value="Activate Now"/></form>''')%{'name':plugin.name,'iname':plugin.iname}
plugins.insert(0,plugin)
else:
pcontent=plugin.post(self)
@@ -962,6 +974,15 @@ def get(self,slug=None):
else:
self.redirect('/admin/entries/post')
+class admin_ThemeEdit(BaseRequestHandler):
+ @requires_admin
+ def get(self,slug):
+ zfile=zipfile.ZipFile(os.path.join(rootpath,"themes",slug+".zip"))
+ newfile=zipfile.ZipFile('')
+ for item in zfile.infolist():
+ self.write(item.filename+"<br>")
+
+
def main():
webapp.template.register_template_library('filter')
application = webapp.WSGIApplication(
@@ -986,6 +1007,7 @@ def main():
('/admin/export/micolog.xml',WpHandler),
('/admin/do/(\w+)',admin_do_action),
('/admin/lang',setlanguage),
+ ('/admin/theme/edit/(\w+)',admin_ThemeEdit),
('/admin/upload', Upload),
('/admin/filemanager', FileManager),
@@ -994,6 +1016,8 @@ def main():
('.*',Error404),
],debug=True)
+ g_blog.application=application
+ g_blog.plugins.register_handlerlist(application)
wsgiref.handlers.CGIHandler().run(application)
if __name__ == "__main__":
9 app.yaml
View
@@ -12,10 +12,13 @@ handlers:
- url: /robots\.txt
static_files: static/robots.txt
upload: static/robots.txt
-
+
- url: /tinymce/.*
script: $PYTHON_LIB/google/appengine/ext/zipserve
+#- url: /tinymce
+# static_dir: tinymce
+
- url: /static
static_dir: static
@@ -44,6 +47,10 @@ handlers:
- url: /admin/.*
script: admin.py
login: admin
+
+- url: /remote_api
+ script: $PYTHON_LIB/google/appengine/ext/remote_api/handler.py
+ login: admin
- url: /.*
script: blog.py
BIN  locale/zh_CN/LC_MESSAGES/django.mo
View
Binary file not shown
719 locale/zh_CN/LC_MESSAGES/django.po
View
@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: micolog 0.7\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-03-20 00:31+0800\n"
-"PO-Revision-Date: 2010-03-20 00:35+0800\n"
+"POT-Creation-Date: 2010-04-29 14:28+0800\n"
+"PO-Revision-Date: 2010-04-29 13:56+0800\n"
"Last-Translator: xuming <coolchyni@gmail.com>\n"
"Language-Team: micolog <coolchyni@gmail.com>\n"
"MIME-Version: 1.0\n"
@@ -18,908 +18,961 @@ msgstr ""
"X-Poedit-Country: CHINA\n"
"X-Poedit-SourceCharset: utf-8\n"
-#: .\admin.py:936
-#: .\admin.py:958
+#: admin.py:78 admin.py:80 admin.py:89 admin.py:91
+msgid "This operate has not defined!"
+msgstr ""
+
+#: admin.py:98
+msgid "\"Cache cleared successful\""
+msgstr ""
+
+#: admin.py:106
+msgid "\"All comments updated\""
+msgstr "\"所有评论更新成功\""
+
+#: admin.py:127
+msgid "\"Link formated succeed\""
+msgstr ""
+
+#: admin.py:129
+msgid "\"Please input url format.\""
+msgstr ""
+
+#: admin.py:140
+msgid "\"Init has succeed.\""
+msgstr ""
+
+#: admin.py:153
+msgid "\"All tags for entry have been updated.\""
+msgstr ""
+
+#: admin.py:162
+msgid "\"All entries have been updated.\""
+msgstr ""
+
+#: admin.py:422
+msgid "Please input title and content or external_page_address."
+msgstr ""
+
+#: admin.py:453 admin.py:457 admin.py:489 admin.py:492
+#, python-format
+msgid "Saved ok. <a href=\"/%s\" target=\"_blank\">View it now!</a>"
+msgstr ""
+
+#: admin.py:455 admin.py:491
+msgid "Saved ok."
+msgstr "保存成功"
+
+#: admin.py:496
+msgid "Error:Entry cant been saved."
+msgstr ""
+
+#: admin.py:658
+msgid "Please input name and url."
+msgstr "请输入名称和URL"
+
+#: admin.py:678
+msgid "Error:Link cant been saved."
+msgstr ""
+
+#: admin.py:709
+msgid "Please input name and slug."
+msgstr "请输入名称和Slug"
+
+#: admin.py:715
+msgid "Saved ok"
+msgstr "保存成功"
+
+#: admin.py:727
+msgid "Error:Category cant been saved."
+msgstr ""
+
+#: admin.py:795
+msgid "Please input dispname and email."
+msgstr "请输入姓名,Email地址"
+
+#: admin.py:817
+msgid "Error:Author cant been saved."
+msgstr ""
+
+#: admin.py:852 admin.py:873
#, python-format
msgid ""
-"<div>Plugin '%s' havn't actived!</div><br><form method=\"post\" action=\"/admin/plugins?action=activate&amp;plugin=%s&amp;return=/admin/plugins/%s\">\n"
-"<input type=\"submit\" value=\"Activate Now\"/></form>"
+"<div>Plugin '%(name)s' havn't actived!</div><br><form method=\"post\" action="
+"\"/admin/plugins?action=activate&amp;plugin=%(iname)s&amp;return=/admin/"
+"plugins/%(iname)s\"><input type=\"submit\" value=\"Activate Now\"/></form>"
msgstr ""
-"<div>插件 '%s' 还没有激活!</div><br><form method=\"post\" action=\"/admin/plugins?action=activate&amp;plugin=%s&amp;return=/admin/plugins/%s\">\n"
+"<div>插件 '%(name)s' 还没有激活!</div><br><form method=\"post\" action=\"/"
+"admin/plugins?action=activate&amp;plugin=%(iname)s&amp;return=/admin/plugins/"
+"%(iname)s\">\n"
"<input type=\"submit\" value=\"现在激活\"/></form>"
-#: .\base.py:133
-#: .\tools\pingback.py:55
+#: base.py:132 tools/pingback.py:55
msgid "source URL does not exist"
msgstr ""
-#: .\base.py:134
-#: .\tools\pingback.py:56
+#: base.py:133 tools/pingback.py:56
msgid "The source URL does not contain a link to the target URL"
msgstr ""
-#: .\base.py:135
-#: .\tools\pingback.py:57
+#: base.py:134 tools/pingback.py:57
msgid "The specified target URL does not exist"
msgstr ""
-#: .\base.py:136
-#: .\tools\pingback.py:58
+#: base.py:135 tools/pingback.py:58
msgid "The specified target URL cannot be used as a target"
msgstr ""
-#: .\base.py:137
-#: .\tools\pingback.py:59
+#: base.py:136 tools/pingback.py:59
msgid "The pingback has already been registered"
msgstr ""
-#: .\base.py:138
-#: .\tools\pingback.py:60
+#: base.py:137 tools/pingback.py:60
msgid "Access Denied"
msgstr "访问受限"
-#: .\base.py:175
-#: .\tools\pingback.py:97
+#: base.py:174 tools/pingback.py:97
+#, python-format
msgid "An unknown server error (%s) occurred"
msgstr "未知的服务器错误:(%s)"
-#: .\blog.py:479
-#: .\blog.py:481
-#: .\blog.py:485
-#: .\blog.py:487
+#: blog.py:486 blog.py:488 blog.py:492 blog.py:494
msgid "Your check code is invalid ."
msgstr "验证码错误"
-#: .\blog.py:498
-#: .\blog.py:500
+#: blog.py:505 blog.py:507
msgid "Please input name, email and comment ."
msgstr "请输入姓名,Email地址和评论内容"
-#: .\blog.py:540
+#: blog.py:547
msgid "Comment not allowed."
msgstr "不允许评论"
-#: .\blog.py:542
+#: blog.py:549
msgid "Comment not allowed ."
msgstr "不允许评论"
-#: .\blog.py:623
+#: blog.py:630
msgid "this is a test"
msgstr "这是一个测试"
-#: .\model.py:407
+#: model.py:416
msgid "..more"
msgstr "(..更多内容)"
-#: .\model.py:750
-#, python-format
-msgid ""
-"New comment on your post \"%s\"\n"
-"Author : %s\n"
-"E-mail : %s\n"
-"URL\t: %s\n"
-"Comment:\n"
-"%s\n"
-"You can see all comments on this post here:\n"
-"%s\n"
-msgstr ""
-"关于\"%s\"的新评论\n"
-"作者 : %s\n"
-"E-mail : %s\n"
-"网址 : %s\n"
-"内容:\n"
-"%s\n"
-"查看所有评论:\n"
-"%s\n"
-
-#: .\model.py:761
-#, python-format
-msgid ""
-"Hi~ New reference on your comment for post \"%s\"\n"
-"Author : %s\n"
-"URL\t: %s\n"
-"Comment:\n"
-"%s\n"
-"You can see all comments on this post here:\n"
-"%s\n"
-msgstr ""
-"Hi~ New reference on your comment for post \"%s\"\n"
-"Author : %s\n"
-"URL\t: %s\n"
-"Comment:\n"
-"%s\n"
-"You can see all comments on this post here:\n"
-"%s\n"
-
-#: .\model.py:892
+#: model.py:867
msgid "Hello world!"
msgstr "欢迎使用Micolog"
-#: .\model.py:893
-msgid "<p>Welcome to micolog. This is your first post. Edit or delete it, then start blogging!</p>"
-msgstr "<p>欢迎使用micolog. 这是您的第一篇博客. 您可以修改或删除这篇文章,开始您精彩的独立Blog之旅。</p>"
+#: model.py:868
+msgid ""
+"<p>Welcome to micolog. This is your first post. Edit or delete it, then "
+"start blogging!</p>"
+msgstr ""
+"<p>欢迎使用micolog. 这是您的第一篇博客. 您可以修改或删除这篇文章,开始您精彩"
+"的独立Blog之旅。</p>"
-#: .\model.py:895
+#: model.py:870
msgid "Xuming's blog"
msgstr "徐明的博客"
-#: .\plugins\wordpress\wpimport.html.py:50
+#: plugins/wordpress/wpimport.html:56
msgid "Please select a file which exported from wordpress to import!"
msgstr "请选择一个从wordpress导出的格式化文件进行导入!"
-#: .\plugins\wordpress\wpimport.html.py:56
+#: plugins/wordpress/wpimport.html:62
msgid "Wordpress export file (WXR file):"
msgstr "Wordpress 格式文件(WXR格式):"
-#: .\plugins\wordpress\wpimport.html.py:64
-#: .\views\admin\import.html.py:62
+#: plugins/wordpress/wpimport.html:71 views/admin/import.html:62
msgid "Import"
msgstr "导入"
-#: .\views\admin\author.html.py:11
+#: views/admin/author.html:11
msgid "Edit Author"
msgstr "修改作者"
-#: .\views\admin\author.html.py:11
+#: views/admin/author.html:11
msgid "Add Author"
msgstr "添加作者"
-#: .\views\admin\author.html.py:28
-#: .\views\admin\category.html.py:28
-#: .\views\admin\entry.html.py:179
-#: .\views\admin\link.html.py:28
+#: views/admin/author.html:28 views/admin/category.html:28
+#: views/admin/entry.html:188 views/admin/link.html:28
msgid "Related"
msgstr "相关操作"
-#: .\views\admin\author.html.py:31
+#: views/admin/author.html:31
msgid "Manage All Authors"
msgstr "管理作者"
-#: .\views\admin\author.html.py:40
+#: views/admin/author.html:40
msgid "Display Name"
msgstr "名称"
-#: .\views\admin\author.html.py:43
+#: views/admin/author.html:43
msgid "The name is used to display."
msgstr "用于显示的名字"
-#: .\views\admin\authors.html.py:7
+#: views/admin/authors.html:7
msgid "Manage Authors"
msgstr "管理作者"
-#: .\views\admin\authors.html.py:7
-#: .\views\admin\categories.html.py:7
-#: .\views\admin\links.html.py:7
-#: .\views\admin\pages.html.py:7
-#: .\views\admin\posts.html.py:7
+#: views/admin/authors.html:7 views/admin/categories.html:7
+#: views/admin/links.html:7 views/admin/pages.html:7 views/admin/posts.html:7
msgid "add new"
msgstr "新建"
-#: .\views\admin\authors.html.py:8
+#: views/admin/authors.html:8
msgid "All Authors"
msgstr "作者"
-#: .\views\admin\authors.html.py:14
-#: .\views\admin\categories.html.py:14
-#: .\views\admin\comments.html.py:26
-#: .\views\admin\filemanager.html.py:53
-#: .\views\admin\links.html.py:12
-#: .\views\admin\pages.html.py:14
-#: .\views\admin\posts.html.py:15
+#: views/admin/authors.html:14 views/admin/categories.html:14
+#: views/admin/comments.html:26 views/admin/filemanager.html:53
+#: views/admin/links.html:12 views/admin/pages.html:14
+#: views/admin/posts.html:15
msgid "Delete"
msgstr "删除"
-#: .\views\admin\authors.html.py:18
-#: .\views\admin\categories.html.py:18
-#: .\views\admin\comments.html.py:30
-#: .\views\admin\filemanager.html.py:57
-#: .\views\admin\pages.html.py:18
-#: .\views\admin\posts.html.py:20
+#: views/admin/authors.html:18 views/admin/categories.html:18
+#: views/admin/comments.html:30 views/admin/filemanager.html:57
+#: views/admin/pages.html:18 views/admin/posts.html:20
msgid "&laquo; prev"
msgstr "&laquo; 前一页"
-#: .\views\admin\authors.html.py:22
-#: .\views\admin\categories.html.py:22
-#: .\views\admin\comments.html.py:34
-#: .\views\admin\filemanager.html.py:61
-#: .\views\admin\pages.html.py:22
-#: .\views\admin\posts.html.py:24
+#: views/admin/authors.html:22 views/admin/categories.html:22
+#: views/admin/comments.html:34 views/admin/filemanager.html:61
+#: views/admin/pages.html:22 views/admin/posts.html:24
msgid "next &raquo;"
msgstr "后一页 &raquo;"
-#: .\views\admin\authors.html.py:23
-#: .\views\admin\categories.html.py:24
-#: .\views\admin\comments.html.py:35
-#: .\views\admin\filemanager.html.py:62
-#: .\views\admin\pages.html.py:23
-#: .\views\admin\posts.html.py:26
+#: views/admin/authors.html:23 views/admin/categories.html:24
+#: views/admin/comments.html:35 views/admin/filemanager.html:62
+#: views/admin/pages.html:23 views/admin/posts.html:26
+#, python-format
msgid " Page %(pindex)s"
msgstr " 第%(pindex)s页"
-#: .\views\admin\authors.html.py:34
-#: .\views\admin\categories.html.py:35
-#: .\views\admin\category.html.py:40
-#: .\views\admin\link.html.py:40
-#: .\views\admin\links.html.py:22
+#: views/admin/authors.html:34 views/admin/categories.html:35
+#: views/admin/category.html:40 views/admin/link.html:40
+#: views/admin/links.html:22
msgid "Name"
msgstr "名称"
-#: .\views\admin\authors.html.py:34
+#: views/admin/authors.html:34
msgid "IsAdmin"
msgstr "是否管理员"
-#: .\views\admin\base.html.py:31
+#: views/admin/base.html:31
msgid "Micolog Dashboard"
msgstr "Micolog控制面板"
-#: .\views\admin\base.html.py:31
+#: views/admin/base.html:31
msgid "Logout"
msgstr "注销"
-#: .\views\admin\base.html.py:60
+#: views/admin/base.html:60
msgid "Write"
msgstr "写文章"
-#: .\views\admin\base.html.py:61
+#: views/admin/base.html:61
msgid "Posts"
msgstr "文章"
-#: .\views\admin\base.html.py:62
+#: views/admin/base.html:62
msgid "Pages"
msgstr "页面"
-#: .\views\admin\base.html.py:63
+#: views/admin/base.html:63
msgid "Links"
msgstr "链接"
-#: .\views\admin\base.html.py:64
+#: views/admin/base.html:64
msgid "Categories"
msgstr "目录"
-#: .\views\admin\base.html.py:65
+#: views/admin/base.html:65
msgid "Comments"
msgstr "评论"
-#: .\views\admin\base.html.py:66
-#: .\views\admin\entry.html.py:108
-#: .\views\admin\upload.html.py:5
+#: views/admin/base.html:66 views/admin/entry.html:108
+#: views/admin/upload.html:5
msgid "Files"
msgstr "文件"
-#: .\views\admin\base.html.py:69
+#: views/admin/base.html:69
msgid "Configuration"
msgstr "设置"
-#: .\views\admin\base.html.py:70
+#: views/admin/base.html:70
msgid "Plugins"
msgstr "插件"
-#: .\views\admin\base.html.py:72
+#: views/admin/base.html:72
msgid "Cache"
msgstr "缓存"
-#: .\views\admin\base.html.py:73
+#: views/admin/base.html:73
msgid "Authors"
msgstr "作者"
-#: .\views\admin\base.html.py:78
+#: views/admin/base.html:78
msgid "help"
msgstr "帮助"
-#: .\views\admin\categories.html.py:7
+#: views/admin/categories.html:7
msgid "Manage Categories"
msgstr "管理目录"
-#: .\views\admin\categories.html.py:8
+#: views/admin/categories.html:8
msgid "All Categories"
msgstr "所有目录"
-#: .\views\admin\categories.html.py:35
-#: .\views\admin\category.html.py:47
-#: .\views\admin\entry.html.py:257
+#: views/admin/categories.html:35 views/admin/category.html:47
+#: views/admin/entry.html:266
msgid "Slug"
msgstr "名称(slug)"
-#: .\views\admin\category.html.py:11
+#: views/admin/category.html:11
msgid "Edit category"
msgstr "编辑目录"
-#: .\views\admin\category.html.py:11
+#: views/admin/category.html:11
msgid "Add category"
msgstr "添加目录"
-#: .\views\admin\category.html.py:24
-#: .\views\admin\entry.html.py:169
-#: .\views\admin\link.html.py:24
+#: views/admin/category.html:24 views/admin/entry.html:169
+#: views/admin/link.html:24
msgid "Save"
msgstr "保存"
-#: .\views\admin\category.html.py:31
+#: views/admin/category.html:31
msgid "Manage All Categories"
msgstr "管理所有页面"
-#: .\views\admin\category.html.py:43
-msgid "The name is used to identify the category almost everywhere, for example under the post or in the category widget."
+#: views/admin/category.html:43
+msgid ""
+"The name is used to identify the category almost everywhere, for example "
+"under the post or in the category widget."
msgstr "目录的名字,将会显示在页面上"
-#: .\views\admin\category.html.py:50
-msgid "The 'slug' is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens."
-msgstr "\"slug\"是一个URL友好的名称,将会被用在生成的url链接里面,通常只包含英文,数字和下划线"
+#: views/admin/category.html:50
+msgid ""
+"The 'slug' is the URL-friendly version of the name. It is usually all "
+"lowercase and contains only letters, numbers, and hyphens."
+msgstr ""
+"\"slug\"是一个URL友好的名称,将会被用在生成的url链接里面,通常只包含英文,数"
+"字和下划线"
-#: .\views\admin\comments.html.py:7
+#: views/admin/comments.html:7
msgid "Manage Comments"
msgstr "管理评论"
-#: .\views\admin\comments.html.py:8
+#: views/admin/comments.html:8
msgid "All Comments"
msgstr "所有评论"
-#: .\views\admin\comments.html.py:11
+#: views/admin/comments.html:11
msgid "Filter:"
msgstr "过滤:"
-#: .\views\admin\comments.html.py:13
-#: .\views\admin\comments.html.py:46
-#: .\views\admin\plugins.html.py:7
-#: .\views\admin\posts.html.py:37
+#: views/admin/comments.html:13 views/admin/comments.html.py:46
+#: views/admin/plugins.html:7 views/admin/posts.html:37
msgid "Author"
msgstr "作者"
-#: .\views\admin\comments.html.py:18
+#: views/admin/comments.html:18
msgid "Do"
msgstr "确定"
-#: .\views\admin\comments.html.py:46
-#: .\views\admin\pages.html.py:34
-#: .\views\admin\posts.html.py:37
+#: views/admin/comments.html:46 views/admin/pages.html:34
+#: views/admin/posts.html:37
msgid "Date"
msgstr "日期"
-#: .\views\admin\comments.html.py:46
+#: views/admin/comments.html:46
msgid "Content"
msgstr "内容"
-#: .\views\admin\comments.html.py:46
+#: views/admin/comments.html:46
msgid "Email"
msgstr "邮件"
-#: .\views\admin\comments.html.py:46
+#: views/admin/comments.html:46
msgid "IP"
msgstr ""
-#: .\views\admin\comments.html.py:46
+#: views/admin/comments.html:46
msgid "Entry"
msgstr "文章/页面"
-#: .\views\admin\entry.html.py:131
+#: views/admin/entry.html:131
msgid "New Post"
msgstr "新建文章"
-#: .\views\admin\entry.html.py:131
+#: views/admin/entry.html:131
msgid "New Page"
msgstr "新建页面"
-#: .\views\admin\entry.html.py:143
+#: views/admin/entry.html:143
msgid "Write Post"
msgstr "写文章"
-#: .\views\admin\entry.html.py:145
+#: views/admin/entry.html:145
msgid "Write Page"
msgstr "写页面"
-#: .\views\admin\entry.html.py:155
+#: views/admin/entry.html:155
msgid "Category"
msgstr "目录"
-#: .\views\admin\entry.html.py:170
-#: .\views\admin\pages.html.py:42
-#: .\views\admin\posts.html.py:46
-msgid "Published"
+#: views/admin/entry.html:171
+msgid "UnPublish"
+msgstr "取消发布"
+
+#: views/admin/entry.html:173
+msgid "Publish"
msgstr "发布"
-#: .\views\admin\entry.html.py:174
-#: .\views\admin\posts.html.py:37
+#: views/admin/entry.html:180
+msgid "Sticky it."
+msgstr "置顶"
+
+#: views/admin/entry.html:182 views/admin/posts.html:37
msgid "allow comment"
msgstr "允许评论"
-#: .\views\admin\entry.html.py:176
+#: views/admin/entry.html:184
msgid "allow trackback"
msgstr "允许 Trackback"
-#: .\views\admin\entry.html.py:182
+#: views/admin/entry.html:191
msgid "Manage All Posts"
msgstr "管理所有文章"
-#: .\views\admin\entry.html.py:183
+#: views/admin/entry.html:192
msgid "Manage All Pages"
msgstr "管理所有页面"
-#: .\views\admin\entry.html.py:194
+#: views/admin/entry.html:203
msgid "Use as external page"
msgstr "用作外链接"
-#: .\views\admin\entry.html.py:198
-#: .\views\admin\pages.html.py:34
-#: .\views\admin\posts.html.py:37
+#: views/admin/entry.html:207 views/admin/pages.html:34
+#: views/admin/posts.html:37
msgid "Title"
msgstr "标题"
-#: .\views\admin\entry.html.py:211
+#: views/admin/entry.html:220
msgid "External page address"
msgstr "外链接地址"
-#: .\views\admin\entry.html.py:215
+#: views/admin/entry.html:224
msgid "Target"
msgstr "目标"
-#: .\views\admin\entry.html.py:227
+#: views/admin/entry.html:236
msgid "Post"
msgstr "文章"
-#: .\views\admin\entry.html.py:229
+#: views/admin/entry.html:238
msgid "Page"
msgstr "页面"
-#: .\views\admin\entry.html.py:265
+#: views/admin/entry.html:274
msgid "Tag"
msgstr "标签"
-#: .\views\admin\entry.html.py:273
+#: views/admin/entry.html:283
+msgid "Password"
+msgstr "密码"
+
+#: views/admin/entry.html:293
msgid "Options"
msgstr "选项"
-#: .\views\admin\entry.html.py:276
+#: views/admin/entry.html:296
msgid "Page level:"
msgstr "页面级别:"
-#: .\views\admin\entry.html.py:278
+#: views/admin/entry.html:298
msgid "Page order:"
msgstr "页面顺序:"
-#: .\views\admin\entry.html.py:288
+#: views/admin/entry.html:308
msgid "Excerpt"
msgstr "摘要"
-#: .\views\admin\filemanager.html.py:31
+#: views/admin/filemanager.html:31
msgid "Upload a file"
msgstr "上传一个文件"
-#: .\views\admin\filemanager.html.py:37
+#: views/admin/filemanager.html:37
msgid "Upload"
msgstr "上传"
-#: .\views\admin\filemanager.html.py:46
+#: views/admin/filemanager.html:46
msgid "Manage Files"
msgstr "管理文件"
-#: .\views\admin\filemanager.html.py:47
+#: views/admin/filemanager.html:47
msgid "All Files"
msgstr "所有文件"
-#: .\views\admin\filemanager.html.py:72
+#: views/admin/filemanager.html:72
msgid "File Name"
msgstr "文件名"
-#: .\views\admin\filemanager.html.py:73
-#: .\views\admin\upload.html.py:98
+#: views/admin/filemanager.html:73 views/admin/upload.html:98
msgid "Size"
msgstr "大小"
-#: .\views\admin\filemanager.html.py:74
+#: views/admin/filemanager.html:74
msgid "Upload Date"
msgstr "上传日期"
-#: .\views\admin\filemanager.html.py:76
+#: views/admin/filemanager.html:76
msgid "Url"
msgstr ""
-#: .\views\admin\filemanager.html.py:77
+#: views/admin/filemanager.html:77
msgid "Download"
msgstr "下载"
-#: .\views\admin\import.html.py:34
-#: .\views\admin\setup.html.py:11
-#: .\views\admin\sitemap.html.py:6
-#: .\views\admin\tools.html.py:68
+#: views/admin/import.html:34 views/admin/setup.html:11
+#: views/admin/sitemap.html:6 views/admin/tools.html:68
msgid "Basic"
msgstr "基本配置"
-#: .\views\admin\import.html.py:35
-#: .\views\admin\setup.html.py:12
-#: .\views\admin\sitemap.html.py:7
-#: .\views\admin\tools.html.py:69
+#: views/admin/import.html:35 views/admin/setup.html:12
+#: views/admin/sitemap.html:7 views/admin/tools.html:69
msgid "Import/Export"
msgstr "导入/导出"
-#: .\views\admin\import.html.py:36
-#: .\views\admin\setup.html.py:13
-#: .\views\admin\sitemap.html.py:8
-#: .\views\admin\tools.html.py:70
+#: views/admin/import.html:36 views/admin/setup.html:13
+#: views/admin/sitemap.html:8 views/admin/tools.html:70
msgid "Sitemap"
msgstr "网站地图"
-#: .\views\admin\import.html.py:37
-#: .\views\admin\setup.html.py:14
-#: .\views\admin\sitemap.html.py:9
-#: .\views\admin\tools.html.py:71
-#: .\views\admin\tools.html.py:79
+#: views/admin/import.html:37 views/admin/setup.html:14
+#: views/admin/sitemap.html:9 views/admin/tools.html:71
+#: views/admin/tools.html.py:79
msgid "Tools"
msgstr "工具"
-#: .\views\admin\import.html.py:44
+#: views/admin/import.html:44
msgid "Export/Import for wordpress"
msgstr "导入/导出"
-#: .\views\admin\import.html.py:45
-#: .\views\admin\import.html.py:60
+#: views/admin/import.html:45 views/admin/import.html.py:60
msgid "Export"
msgstr "导出"
-#: .\views\admin\import.html.py:46
+#: views/admin/import.html:46
msgid "Export as WordPress eXtended RSS file"
msgstr "导出为 wordpress 文件格式"
-#: .\views\admin\import.html.py:48
+#: views/admin/import.html:48
msgid "Export from Date:"
msgstr "导出日期: 从"
-#: .\views\admin\import.html.py:49
+#: views/admin/import.html:49
msgid "to Date:"
msgstr "到"
-#: .\views\admin\import.html.py:49
+#: views/admin/import.html:49
msgid "'s posts"
msgstr "的文章"
-#: .\views\admin\import.html.py:59
+#: views/admin/import.html:59
msgid "Export all posts"
msgstr "导出所有文章"
-#: .\views\admin\link.html.py:11
+#: views/admin/link.html:11
msgid "Edit link"
msgstr "编辑链接"
-#: .\views\admin\link.html.py:11
+#: views/admin/link.html:11
msgid "Add Link"
msgstr "添加链接"
-#: .\views\admin\link.html.py:31
+#: views/admin/link.html:31
msgid "Manage All Links"
msgstr "管理所有链接"
-#: .\views\admin\link.html.py:43
+#: views/admin/link.html:43
msgid "Example: Nifty blogging software"
msgstr "例如:关于GAE的博客"
-#: .\views\admin\link.html.py:47
+#: views/admin/link.html:47
msgid "Web Address"
msgstr "网址"
-#: .\views\admin\link.html.py:50
-msgid "Example: <code>http://xuming.net</code> - don't forget the <code>http://</code>"
+#: views/admin/link.html:50
+msgid ""
+"Example: <code>http://xuming.net</code> - don't forget the <code>http://</"
+"code>"
msgstr "例如: <code>http://xuming.net</code> - 请不要忘记 <code>http://</code>"
-#: .\views\admin\link.html.py:54
-#: .\views\admin\links.html.py:22
+#: views/admin/link.html:54 views/admin/links.html:22
msgid "LinkComment"
msgstr "链接描述"
-#: .\views\admin\link.html.py:57
+#: views/admin/link.html:57
msgid "Example: Xuming's Blog"
msgstr ""
-#: .\views\admin\links.html.py:7
+#: views/admin/links.html:7
msgid "Manage Links"
msgstr "管理链接"
-#: .\views\admin\links.html.py:22
+#: views/admin/links.html:22
msgid "URL"
msgstr "URL"
-#: .\views\admin\pages.html.py:7
+#: views/admin/pages.html:7
msgid "Manage Pages"
msgstr "管理页面"
-#: .\views\admin\pages.html.py:8
+#: views/admin/pages.html:8
msgid "All Pages"
msgstr "所有页面"
-#: .\views\admin\pages.html.py:34
-#: .\views\admin\posts.html.py:37
+#: views/admin/pages.html:34 views/admin/posts.html:37
msgid "Status"
msgstr "状态"
-#: .\views\admin\pages.html.py:42
-#: .\views\admin\posts.html.py:46
+#: views/admin/pages.html:40 views/admin/posts.html:43
+msgid "edit"
+msgstr "编辑"
+
+#: views/admin/pages.html:42 views/admin/posts.html:46
+msgid "Published"
+msgstr "发布"
+
+#: views/admin/pages.html:42 views/admin/posts.html:46
msgid "Unpublished"
msgstr "未发布"
-#: .\views\admin\plugins.html.py:5
+#: views/admin/plugins.html:5
msgid "Manage Plugins"
msgstr "管理插件"
-#: .\views\admin\plugins.html.py:7
+#: views/admin/plugins.html:7
msgid "Plugin"
msgstr "插件"
-#: .\views\admin\plugins.html.py:7
+#: views/admin/plugins.html:7
msgid "Version"
msgstr "版本"
-#: .\views\admin\plugins.html.py:7
+#: views/admin/plugins.html:7
msgid "Description"
msgstr "描述"
-#: .\views\admin\plugins.html.py:7
+#: views/admin/plugins.html:7
msgid "Active Status"
msgstr "激活状态"
-#: .\views\admin\plugins.html.py:17
+#: views/admin/plugins.html:17
msgid "Deactivate"
msgstr "取消激活"
-#: .\views\admin\plugins.html.py:20
+#: views/admin/plugins.html:20
msgid "Activate"
msgstr "激活"
-#: .\views\admin\posts.html.py:7
+#: views/admin/posts.html:7
msgid "Manage Posts"
msgstr "管理文章"
-#: .\views\admin\posts.html.py:9
+#: views/admin/posts.html:9
msgid "All Posts"
msgstr "所有文章"
-#: .\views\admin\setup.html.py:24
+#: views/admin/setup.html:24
msgid "Setup and Configuraiton for this Blog"
msgstr "博客设置/系统配置"
-#: .\views\admin\setup.html.py:28
+#: views/admin/setup.html:28
msgid "Blog Title:"
msgstr "博客标题"
-#: .\views\admin\setup.html.py:34
+#: views/admin/setup.html:34
msgid "Sub Title:"
msgstr "子标题"
-#: .\views\admin\setup.html.py:37
+#: views/admin/setup.html:37
msgid "In a few words, explain what this blog is about."
msgstr "关于这个博客的简单介绍"
-#: .\views\admin\setup.html.py:41
+#: views/admin/setup.html:41
msgid "Blog notice:"
msgstr "公告"
-#: .\views\admin\setup.html.py:47
+#: views/admin/setup.html:47
msgid "Default Link Structure:"
msgstr "默认结构化链接 "
-#: .\views\admin\setup.html.py:50
-#: .\views\admin\setup.html.py:57
+#: views/admin/setup.html:50 views/admin/setup.html.py:57
msgid "Allowed variants: "
msgstr "允许使用的变量:"
-#: .\views\admin\setup.html.py:54
+#: views/admin/setup.html:54
msgid "Permalink Structure:"
msgstr "结构化链接(Permalink) "
-#: .\views\admin\setup.html.py:61
+#: views/admin/setup.html:61
msgid "Domain:"
msgstr "域名:"
-#: .\views\admin\setup.html.py:67
+#: views/admin/setup.html:67
msgid "Micolog Address(URL):"
msgstr "博客网址(URL):"
-#: .\views\admin\setup.html.py:73
+#: views/admin/setup.html:73
msgid "RSS Feed URL:"
msgstr "RSS/Atom Feed地址:"
-#: .\views\admin\setup.html.py:78
+#: views/admin/setup.html:78
msgid "Time delta:(Hours)"
msgstr "时间差调整(单位:小时):"
-#: .\views\admin\setup.html.py:85
+#: views/admin/setup.html:85
msgid "Theme:"
msgstr "应用主题:"
-#: .\views\admin\setup.html.py:96
+#: views/admin/setup.html:96
msgid "Posts per page:"
msgstr "每页文章数:"
-#: .\views\admin\setup.html.py:101
+#: views/admin/setup.html:101
msgid "Comments order:"
msgstr "评论顺序"
-#: .\views\admin\setup.html.py:103
+#: views/admin/setup.html:103
msgid "ASC"
msgstr "升序"
-#: .\views\admin\setup.html.py:104
+#: views/admin/setup.html:104
msgid "DESC"
msgstr "降序"
-#: .\views\admin\setup.html.py:108
+#: views/admin/setup.html:108
msgid "Comment Check Type:"
msgstr "评论验证类型:"
-#: .\views\admin\setup.html.py:111
+#: views/admin/setup.html:111
msgid "Arithmetic"
msgstr "算术"
-#: .\views\admin\setup.html.py:112
+#: views/admin/setup.html:112
msgid "Graph"
msgstr "图形"
-#: .\views\admin\setup.html.py:113
+#: views/admin/setup.html:113
msgid "Client Arithmetic"
msgstr "客户端算术题(兼容0.6以下版本)"
-#: .\views\admin\setup.html.py:117
+#: views/admin/setup.html:117
msgid "Comments per page:"
msgstr "每页评论数:"
-#: .\views\admin\setup.html.py:124
+#: views/admin/setup.html:124
msgid "Enable comment notify by mail:"
msgstr "允许将评论发送到你的邮箱:"
-#: .\views\admin\setup.html.py:129
+#: views/admin/setup.html:129
msgid "Enable memcache:"
msgstr "启用缓存:"
-#: .\views\admin\setup.html.py:134
+#: views/admin/setup.html:134
msgid "Allow Trackback:"
msgstr "允许 Trackback"
-#: .\views\admin\setup.html.py:140
+#: views/admin/setup.html:140
msgid "Allow Pingback:"
msgstr "允许 Pingback"
-#: .\views\admin\setup.html.py:145
+#: views/admin/setup.html:145
msgid "Xmlrpc setting"
msgstr "客户端(Xmlrpc)调用设置:"
-#: .\views\admin\setup.html.py:146
-msgid "Setup the username and password for RPC call. These will be used by client tools (e.g. Windows live writer). "
-msgstr "为了您可以通过客户端工具(如Windows live writer)进行写作,请在这里设置用户名和密码"
+#: views/admin/setup.html:146
+msgid ""
+"Setup the username and password for RPC call. These will be used by client "
+"tools (e.g. Windows live writer). "
+msgstr ""
+"为了您可以通过客户端工具(如Windows live writer)进行写作,请在这里设置用户名"
+"和密码"
-#: .\views\admin\setup.html.py:149
+#: views/admin/setup.html:149
msgid "User name:"
msgstr "用户名:"
-#: .\views\admin\setup.html.py:155
+#: views/admin/setup.html:155
msgid "Password:"
msgstr "密码:"
-#: .\views\admin\setup.html.py:162
-#: .\views\admin\sitemap.html.py:52
+#: views/admin/setup.html:162 views/admin/sitemap.html:52
msgid "Save Changes"
msgstr "保 存"
-#: .\views\admin\sitemap.html.py:19
+#: views/admin/sitemap.html:19
msgid "Sitemap Setup"
msgstr "设置Sitemap"
-#: .\views\admin\sitemap.html.py:23
+#: views/admin/sitemap.html:23
msgid "Entries in sitemap:"
msgstr "文章或页面数量:"
-#: .\views\admin\sitemap.html.py:31
+#: views/admin/sitemap.html:31
msgid "Include category:"
msgstr "包含目录:"
-#: .\views\admin\sitemap.html.py:37
+#: views/admin/sitemap.html:37
msgid "Include tag:"
msgstr "包含标签(tag):"
-#: .\views\admin\sitemap.html.py:42
+#: views/admin/sitemap.html:42
msgid "Pinging Search Engine (Google):"
msgstr "Ping搜索引擎(Google)"
-#: .\views\admin\status.html.py:23
+#: views/admin/status.html:23
msgid "Cache status"
msgstr "缓存状态"
-#: .\views\admin\status.html.py:25
-#: .\views\admin\status.html.py:28
+#: views/admin/status.html:25 views/admin/status.html.py:28
msgid "Clear cache"
msgstr "清除缓存"
-#: .\views\admin\status.html.py:28
+#: views/admin/status.html:28
msgid "Clear cache data."
msgstr "清除缓存数据"
-#: .\views\admin\status.html.py:31
+#: views/admin/status.html:31
msgid "Environ"
msgstr "环境"
-#: .\views\admin\tools.html.py:81
+#: views/admin/tools.html:81
msgid "Careless use of it will be dangerous!"
msgstr "该页面提供的工具请谨慎使用!"
-#: .\views\admin\tools.html.py:84
-#: .\views\admin\tools.html.py:90
-#: .\views\admin\tools.html.py:97
-#: .\views\admin\tools.html.py:105
-#: .\views\admin\tools.html.py:116
+#: views/admin/tools.html:84 views/admin/tools.html.py:90
+#: views/admin/tools.html:97 views/admin/tools.html.py:105
+#: views/admin/tools.html:116
msgid "Run"
msgstr "执行"
-#: .\views\admin\tools.html.py:85
+#: views/admin/tools.html:85
msgid "Update tags"
msgstr "更新标签"
-#: .\views\admin\tools.html.py:86
+#: views/admin/tools.html:86
msgid "It will refresh all tags for each entry."
msgstr "该操作将会更新所有文章和页面的标签"
-#: .\views\admin\tools.html.py:92
+#: views/admin/tools.html:92
msgid "Init datas"
msgstr "初始化数据"
-#: .\views\admin\tools.html.py:93
+#: views/admin/tools.html:93
msgid "It will delete all posts, pages and comments."
msgstr "该操作将会删除所有文章,页面和评论"
-#: .\views\admin\tools.html.py:99
+#: views/admin/tools.html:99
msgid "Update comments"
msgstr "更新评论数"
-#: .\views\admin\tools.html.py:100
+#: views/admin/tools.html:100
msgid "It will refresh the number of comments for each entry."
msgstr "该操作将会更新所有文章的评论数"
-#: .\views\admin\tools.html.py:107
+#: views/admin/tools.html:107
msgid "Rebuild URL"
msgstr "重建文章链接"
-#: .\views\admin\tools.html.py:108
+#: views/admin/tools.html:108
msgid "The URL of all entries (post or page) will be rebuild."
msgstr "该操作将会按照指定的Permalink重置所有文章的URL链接"
-#: .\views\admin\tools.html.py:110
+#: views/admin/tools.html:110
msgid "Permalink"
msgstr "结构化链接(Permalink) "
-#: .\views\admin\tools.html.py:112
+#: views/admin/tools.html:112
msgid "Available parameters:"
msgstr "可用的参数:"
-#: .\views\admin\tools.html.py:119
+#: views/admin/tools.html:119
msgid "Update archives"
msgstr "更新归档"
-#: .\views\admin\tools.html.py:120
+#: views/admin/tools.html:120
msgid "It will update the monthyear of entries."
msgstr "该操作将更新归档"
-#: .\views\admin\upload.html.py:29
+#: views/admin/upload.html:29
msgid "Error: invalid file extension"
msgstr "错误:不支持的文件格式"
-#: .\views\admin\upload.html.py:53
-#: .\views\admin\upload.html.py:101
+#: views/admin/upload.html:53 views/admin/upload.html.py:101
msgid "Add"
msgstr "添加"
-#: .\views\admin\upload.html.py:92
+#: views/admin/upload.html:92
msgid "New file"
msgstr "添加文件"
-#: .\views\admin\upload.html.py:98
+#: views/admin/upload.html:98
msgid "Filename"
msgstr "文件名"
-#: .\views\admin\upload.html.py:98
+#: views/admin/upload.html:98
msgid "Operater"
msgstr "操作"
+#~ msgid ""
+#~ "New comment on your post \"%s\"\n"
+#~ "Author : %s\n"
+#~ "E-mail : %s\n"
+#~ "URL\t: %s\n"
+#~ "Comment:\n"
+#~ "%s\n"
+#~ "You can see all comments on this post here:\n"
+#~ "%s\n"
+#~ msgstr ""
+#~ "关于\"%s\"的新评论\n"
+#~ "作者 : %s\n"
+#~ "E-mail : %s\n"
+#~ "网址 : %s\n"
+#~ "内容:\n"
+#~ "%s\n"
+#~ "查看所有评论:\n"
+#~ "%s\n"
+
+#~ msgid ""
+#~ "Hi~ New reference on your comment for post \"%s\"\n"
+#~ "Author : %s\n"
+#~ "URL\t: %s\n"
+#~ "Comment:\n"
+#~ "%s\n"
+#~ "You can see all comments on this post here:\n"
+#~ "%s\n"
+#~ msgstr ""
+#~ "Hi~ New reference on your comment for post \"%s\"\n"
+#~ "Author : %s\n"
+#~ "URL\t: %s\n"
+#~ "Comment:\n"
+#~ "%s\n"
+#~ "You can see all comments on this post here:\n"
+#~ "%s\n"
+
#~ msgid "Insert"
#~ msgstr "插入"
#, fuzzy
#~ msgid "Web Comment"
#~ msgstr "评论"
+
#~ msgid "Advance"
#~ msgstr "高级"
-
112 model.py
View
@@ -235,6 +235,9 @@ def get_langs(self):
def cur_language(self):
return self.get_langs().getlang(self.language)
+ def rootpath(self):
+ return rootpath
+
@vcache("blog.hotposts")
def hotposts(self):
return Entry.all().filter('entrytype =','post').filter("published =", True).order('-readtimes').fetch(8)
@@ -591,63 +594,7 @@ def save(self,is_publish=False):
g_blog.tigger_action("save_post",self,is_publish)
-## def publish(self,newval=True):
-## g_blog.tigger_action("pre_publish_post",self)
-## update_ar=0
-## if newval:
-## if not self.is_saved():
-## self.save()
-##
-## if not self.is_wp:
-## self.post_id=self.key().id()
-##
-## #fix for old version
-## if not self.postname:
-## self.setpostname(self.slug)
-##
-##
-## vals={'year':self.date.year,'month':str(self.date.month).zfill(2),'day':self.date.day,
-## 'postname':self.postname,'post_id':self.post_id}
-##
-##
-## if self.entrytype=='page':
-## if self.slug:
-## self.link=self.postname
-## else:
-## #use external page address as link
-## if self.is_external_page:
-## self.link=self.external_page_address
-## else:
-## self.link=g_blog.default_link_format%vals
-## else:
-## if g_blog.link_format and self.postname:
-## self.link=g_blog.link_format.strip()%vals
-## else:
-## self.link=g_blog.default_link_format%vals
-##
-##
-##
-## if not self.published:
-## g_blog.entrycount+=1
-## update_ar=1
-## self.published=True
-## g_blog.save()
-## self.save()
-## else:
-## self.published=false
-## if self.published:
-## g_blog.entrycount-=1
-## update_ar=-1
-##
-## g_blog.save()
-## self.save()
-##
-## if update_ar!=0:
-## self.update_archive(update_ar)
-## self.removecache()
-## if g_blog.sitemap_ping:
-## Sitemap_NotifySearch()
-## g_blog.tigger_action("publish_post",self)
+
def removecache(self):
memcache.delete('/')
@@ -773,23 +720,24 @@ def notify(self):
You can see all comments on this post here:
%s
''')
+
sbody=sbody.decode('utf-8')
- bbody=_('''Hi~ New reference on your comment for post "%s"
+ bbody='''Hi~ New reference on your comment for post "%s"
Author : %s
URL : %s
Comment:
%s
You can see all comments on this post here:
%s
-''')
+'''
bbody=bbody.decode('utf-8')
if g_blog.comment_notify_mail and g_blog.owner and not users.is_current_user_admin() :
sbody=sbody%(self.entry.title,self.author,self.email,self.weburl,self.content,
g_blog.baseurl+"/"+self.entry.link+"#comment-"+str(self.key().id()))
mail.send_mail_to_admins(g_blog.owner.email(),'Comments:'+self.entry.title, sbody,reply_to=self.email)
- logging.info('send %s . entry: %s'%(g_blog.owner.email(),self.entry.title))
+
#reply comment mail notify
refers = re.findall(r'@[\S]+-(\d+)[:]', self.content)
if len(refers)!=0:
@@ -820,6 +768,17 @@ def put(self):
def delete(self):
db.Model.delete(self)
g_blog.tigger_action("delete_comment",self)
+
+ def children(self):
+ children=[]
+ key=self.key()
+ comments=Comment.all().ancestor(self)
+ for c in comments:
+ if c.parent_key()==key:
+ children.append(c)
+
+ return children
+
class Media(db.Model):
name =db.StringProperty()
@@ -855,13 +814,17 @@ def setValue(cls,name,value):
opt.value=pickle.dumps(value)
opt.put()
+ @classmethod
+ def remove(cls,name):
+ opt= OptionSet.get_by_key_name(name)
+ if opt:
+ opt.delete()
+
NOTIFICATION_SITES = [
('http', 'www.google.com', 'webmasters/sitemaps/ping', {}, '', 'sitemap')
]
-
-
def Sitemap_NotifySearch():
""" Send notification of the new Sitemap(s) to the search engines. """
@@ -876,11 +839,6 @@ def Sitemap_NotifySearch():
query_map[query_attr] = url
query = urllib.urlencode(query_map)
notify = urlparse.urlunsplit((ping[0], ping[1], ping[2], query, ping[4]))
-
- # Send the notification
- logging.info('Notifying search engines. %s'%ping[1])
- logging.info('url: %s'%notify)
-
try:
urlfetch.fetch(notify)
@@ -929,18 +887,16 @@ def gblog_init():
g_blog.rootdir=os.path.dirname(__file__)
return g_blog
+try:
+ g_blog=gblog_init()
-g_blog=gblog_init()
-
-os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
-from django.utils.translation import activate
-from django.conf import settings
-settings._target = None
-activate(g_blog.language)
+ os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
+ from django.utils.translation import activate
+ from django.conf import settings
+ settings._target = None
+ activate(g_blog.language)
+except:
+ pass
-if __name__=='__main__':
- lk = Link()
- lk.href = 'http://micolog.xuming.net'
- print lk.get_icon_url()
227 plugins/wordpress/wordpress.py
View
@@ -5,6 +5,124 @@
from model import *
import logging,math
from django.utils import simplejson
+from base import BaseRequestHandler,urldecode
+
+
+class waphandler(BaseRequestHandler):
+ def get(self):
+ if not self.is_login:
+ self.redirect(users.create_login_url(self.request.uri))
+
+ action=self.param('action')
+
+ if action=='stop':
+ memcache.delete("imt")
+ #OptionSet.remove('wpimport_data')
+ self.write('"ok"')
+ return
+
+ imt=memcache.get('imt')
+ #imt=OptionSet.getValue('wpimport_data')
+ if imt and imt.cur_do:
+ process=100-math.ceil(imt.count()*100/imt.total)
+ if imt.cur_do[0]=='cat':
+ msg="importing category '%s'"%imt.cur_do[1]['name']
+ elif imt.cur_do[0]=='entry':
+ msg="importing entry '%s'"%imt.cur_do[1]['title']
+ else:
+ msg="start importing..."
+ self.write(simplejson.dumps((process,msg,not process==100)))
+ else:
+ self.write(simplejson.dumps((-1,"Have no data to import!",False)))
+
+ def post(self):
+ if not self.is_login:
+ self.redirect(users.create_login_url(self.request.uri))
+
+
+ try:
+ #global imt
+ imt=memcache.get("imt")
+ #imt=OptionSet.getValue('wpimport_data')
+ import_data=imt.pop()
+ #if tdata=='men':
+ memcache.set('imt',imt)
+ #else:
+ # OptionSet.setValue('wpimport_data',imt)
+
+ if import_data:
+ try:
+ if import_data[0]=='cat':
+
+ _cat=import_data[1]
+ nicename=_cat['slug']
+ cat=Category.get_by_key_name(nicename)
+ if not cat:
+ cat=Category(key_name=nicename)
+ cat.name=_cat['name']
+ cat.slug=nicename
+ cat.put()
+ elif import_data[0]=='entry':
+ _entry=import_data[1]
+ logging.debug('importing:'+_entry['title'])
+ hashkey=str(hash(_entry['title']))
+ entry=Entry.get_by_key_name(hashkey)
+ if not entry:
+ entry=Entry(key_name=hashkey)
+
+ entry.title=_entry['title']
+ entry.author=self.login_user
+ entry.is_wp=True
+ #entry.date=datetime.strptime( _entry['pubDate'],"%a, %d %b %Y %H:%M:%S +0000")
+ try:
+ entry.date=datetime.strptime( _entry['pubDate'][:-6],"%a, %d %b %Y %H:%M:%S")
+ except:
+ try:
+ entry.date=datetime.strptime( _entry['pubDate'][0:19],"%Y-%m-%d %H:%M:%S")
+ except:
+ entry.date=datetime.now()
+ entry.entrytype=_entry['post_type']
+ entry.content=_entry['content']
+
+ entry.excerpt=_entry['excerpt']
+ entry.post_id=_entry['post_id']
+ entry.slug=urldecode(_entry['post_name'])
+ entry.entry_parent=_entry['post_parent']
+ entry.menu_order=_entry['menu_order']
+
+ for cat in _entry['categories']:
+ c=Category.get_by_key_name(cat['slug'])
+ if c:
+ entry.categorie_keys.append(c.key())
+ entry.settags(','.join(_entry['tags']))
+ ## for tag in _entry['tags']:
+ ## entry.tags.append(tag)
+ if _entry['published']:
+ entry.save(True)
+ else:
+ entry.save()
+ for com in _entry['comments']:
+ try:
+ date=datetime.strptime(com['date'][0:19],"%Y-%m-%d %H:%M:%S")
+ except:
+ date=datetime.now()
+ comment=Comment(author=com['author'],
+ content=com['content'],
+ entry=entry,
+ date=date
+ )
+ try:
+ comment.email=com['email']
+ comment.weburl=com['weburl']
+ except:
+ pass
+ comment.save()
+ finally:
+ queue=taskqueue.Queue("import")
+ queue.add(taskqueue.Task( url="/admin/wp_import"))
+ except Exception,e :
+ logging.info("import error: %s"%e.message)
+
class wordpress(Plugin_importbase):
def __init__(self):
@@ -15,7 +133,7 @@ def __init__(self):
self.description="Plugin for import wxr file."
self.name="Wordpress Import"
self.version="0.5"
- self.register_urlmap('wp_import',self.wp_import)
+ self.register_urlhandler('/admin/wp_import',waphandler)
def get(self,page):
return self.render_content("wpimport.html",{'name':self.name})
@@ -28,113 +146,12 @@ def post(self,page):
#global imt
imt=import_wordpress(wpfile)
imt.parse()
+ #OptionSet.setValue('wpimport_data',imt)
+
memcache.set("imt",imt)
- queue.add(taskqueue.Task( url="/e/wp_import"))
+ queue.add(taskqueue.Task( url="/admin/wp_import"))
return self.render_content("wpimport.html",{'postback':True})
except Exception , e:
return self.error("Import Error:<p style='color:red;font-size:11px;font-weight:normal'>%s</p>"%e.message)
-
- def wp_import(self,page=None,*arg1,**arg2):
- if not page.is_login:
- page.redirect(users.create_login_url(page.request.uri))
-
- if page.request.method=='GET':
- action=page.param('action')
-
- if action=='stop':
- memcache.delete("imt")
- page.write('"ok"')
- return
-
- imt=memcache.get('imt')
- if imt and imt.cur_do:
- process=100-math.ceil(imt.count()*100/imt.total)
- if imt.cur_do[0]=='cat':
- msg="importing category '%s'"%imt.cur_do[1]['name']
- elif imt.cur_do[0]=='entry':
- msg="importing entry '%s'"%imt.cur_do[1]['title']
- else:
- msg="start importing..."
- page.write(simplejson.dumps((process,msg,not process==100)))
- else:
- page.write(simplejson.dumps((-1,"Have no data to import!",False)))
- else:
- try:
- #global imt
- imt=memcache.get("imt")
- import_data=imt.pop()
- memcache.set('imt',imt)
- if import_data:
- try:
- if import_data[0]=='cat':
-
- _cat=import_data[1]
- nicename=_cat['slug']
- cat=Category.get_by_key_name(nicename)
- if not cat:
- cat=Category()
- cat.name=_cat['name']
- cat.slug=nicename
- cat.put()
- elif import_data[0]=='entry':
- _entry=import_data[1]
- logging.debug('importing:'+_entry['title'])
- hashkey=str(hash(_entry['title']))
- entry=Entry.get_by_key_name(hashkey)
- if not entry:
- entry=Entry(key_name=hashkey)
-
- entry.title=_entry['title']
- entry.author=self.login_user
- entry.is_wp=True
- #entry.date=datetime.strptime( _entry['pubDate'],"%a, %d %b %Y %H:%M:%S +0000")
- try:
- entry.date=datetime.strptime( _entry['pubDate'][:-6],"%a, %d %b %Y %H:%M:%S")
- except:
- try:
- entry.date=datetime.strptime( _entry['pubDate'][0:19],"%Y-%m-%d %H:%M:%S")
- except:
- entry.date=datetime.now()
- entry.entrytype=_entry['post_type']
- entry.content=_entry['content']
-
- entry.excerpt=_entry['excerpt']
- entry.post_id=_entry['post_id']
- entry.slug=_entry['post_name']
- entry.entry_parent=_entry['post_parent']
- entry.menu_order=_entry['menu_order']
-
- for cat in _entry['categories']:
- c=Category.get_by_key_name('cat_'+cat['slug'])
- if c:
- entry.categorie_keys.append(c.key())
- entry.settags(','.join(_entry['tags']))
- ## for tag in _entry['tags']:
- ## entry.tags.append(tag)
- if _entry['published']:
- entry.save(True)
- else:
- entry.save()
- for com in _entry['comments']:
- try:
- date=datetime.strptime(com['date'][0:19],"%Y-%m-%d %H:%M:%S")
- except:
- date=datetime.now()
- comment=Comment(author=com['author'],
- content=com['content'],
- entry=entry,
- date=date
- )
- try:
- comment.email=com['email']
- comment.weburl=com['weburl']
- except:
- pass
- comment.save()
- finally:
- queue=taskqueue.Queue("import")
- queue.add(taskqueue.Task( url="/e/wp_import"))
- except:
- logging.info("import error")
250 plugins/wordpress/wp_import.py
View
@@ -3,113 +3,145 @@
import logging
###import from wxr file
class import_wordpress:
- def __init__(self,source):
- self.categories=[]
- self.tags=[]
- self.entries=[]
-
- self.source=source
- self.doc=et.fromstring(source)
- #use namespace
- self.wpns='{http://wordpress.org/export/1.0/}'
-
- self.contentns="{http://purl.org/rss/1.0/modules/content/}"
- self.excerptns="{http://wordpress.org/export/1.0/excerpt/}"
- et._namespace_map[self.wpns]='wp'
- et._namespace_map[self.contentns]='content'
- et._namespace_map[self.excerptns]='excerpt'
- self.channel=self.doc.find('channel')
- self.dict={'category':self.wpns+'category','tag':self.wpns+'tag','item':'item'}
- self.cur_do=None
-
- def parse(self):
- categories=self.channel.findall(self.wpns+'category')
- #parse categories
-
- for cate in categories:
- slug=cate.findtext(self.wpns+'category_nicename')
- name=cate.findtext(self.wpns+'cat_name')
- self.categories.append({'slug':slug,'name':name})
- #parse tags
- tags=self.channel.findall(self.wpns+'tag')
-
- for tag in tags:
- slug=tag.findtext(self.wpns+'tag_slug')
- name=tag.findtext(self.wpns+'tag_name')
- self.tags.append({'slug':slug,'name':name})
-
- #parse entries
- items=self.channel.findall('item')
-
- for item in items:
- title=item.findtext('title')
- try:
- entry={}
- entry['title']=item.findtext('title')
- logging.info(title)
- entry['pubDate']=item.findtext('pubDate')
- entry['post_type']=item.findtext(self.wpns+'post_type')
- entry['content']= item.findtext(self.contentns+'encoded')
- entry['excerpt']= item.findtext(self.excerptns+'encoded')
- entry['post_id']=int(item.findtext(self.wpns+'post_id'))
- entry['post_name']=item.findtext(self.wpns+'post_name')
- entry['post_parent']=int(item.findtext(self.wpns+'post_parent'))
- entry['menu_order']=int(item.findtext(self.wpns+'menu_order'))
-
- entry['tags']=[]
- entry['categories']=[]
-
- cats=item.findall('category')
-
- for cat in cats:
- if cat.attrib.has_key('nicename'):
- nicename=cat.attrib['nicename']
- cat_type=cat.attrib['domain']
- if cat_type=='tag':
- entry['tags'].append(cat.text)
- else:
- entry['categories'].append({'slug':nicename,'name':cat.text})
-
- pub_status=item.findtext(self.wpns+'status')
- if pub_status=='publish':
- entry['published']=True
- else:
- entry['published']=False
-
- entry['comments']=[]
-
- comments=item.findall(self.wpns+'comment')
-
- for com in comments:
- try:
- comment_approved=int(com.findtext(self.wpns+'comment_approved'))
- except:
- comment_approved=0
- if comment_approved:
- comment=dict(author=com.findtext(self.wpns+'comment_author'),
- content=com.findtext(self.wpns+'comment_content'),
- email=com.findtext(self.wpns+'comment_author_email'),
- weburl=com.findtext(self.wpns+'comment_author_url'),
- date=com.findtext(self.wpns+'comment_date')
- )
- self.entries.append(entry)
- except:
- logging.info("parse wordpress file error")
- self.total=self.count()
- self.cur_do=("begin","begin")
-
- def count(self):
- return len(self.categories)+len(self.entries)
-
- def pop(self):
- if len(self.categories)>0:
- self.cur_do=('cat',self.categories.pop())
- return self.cur_do
-
- if len(self.entries)>0:
- self.cur_do=('entry', self.entries.pop())
- return self.cur_do
- return None
-
-
+ def __init__(self,source):
+ self.categories=[]
+ self.tags=[]
+ self.entries=[]
+
+ self.source=source
+ self.doc=et.fromstring(source)
+ #use namespace
+ self.wpns='{http://wordpress.org/export/1.0/}'
+
+ self.contentns="{http://purl.org/rss/1.0/modules/content/}"
+ self.excerptns="{http://wordpress.org/export/1.0/excerpt/}"
+ et._namespace_map[self.wpns]='wp'
+ et._namespace_map[self.contentns]='content'
+ et._namespace_map[self.excerptns]='excerpt'
+ self.channel=self.doc.find('channel')
+ self.dict={'category':self.wpns+'category','tag':self.wpns+'tag','item':'item'}
+ self.cur_do=None
+
+ def parse(self):
+ categories=self.channel.findall(self.wpns+'category')
+ #parse categories
+
+ for cate in categories:
+ slug=cate.findtext(self.wpns+'category_nicename')
+ name=cate.findtext(self.wpns+'cat_name')
+ self.categories.append({'slug':slug,'name':name})
+ #parse tags
+ tags=self.channel.findall(self.wpns+'tag')
+
+ for tag in tags:
+ slug=tag.findtext(self.wpns+'tag_slug')
+ name=tag.findtext(self.wpns+'tag_name')
+ self.tags.append({'slug':slug,'name':name})
+
+ #parse entries
+ items=self.channel.findall('item')
+
+ for item in items:
+ title=item.findtext('title')
+ try:
+ entry={}
+ entry['title']=item.findtext('title')
+ logging.info(title)
+ entry['pubDate']=item.findtext('pubDate')
+ entry['post_type']=item.findtext(self.wpns+'post_type')
+ entry['content']= item.findtext(self.contentns+'encoded')
+ entry['excerpt']= item.findtext(self.excerptns+'encoded')
+ entry['post_id']=int(item.findtext(self.wpns+'post_id'))
+ entry['post_name']=item.findtext(self.wpns+'post_name')
+ entry['post_parent']=int(item.findtext(self.wpns+'post_parent'))
+ entry['menu_order']=int(item.findtext(self.wpns+'menu_order'))
+
+ entry['tags']=[]
+ entry['categories']=[]
+
+ cats=item.findall('category')
+
+ for cat in cats:
+ if cat.attrib.has_key('nicename'):
+ nicename=cat.attrib['nicename']
+ cat_type=cat.attrib['domain']
+ if cat_type=='tag':
+ entry['tags'].append(cat.text)
+ else:
+ entry['categories'].append({'slug':nicename,'name':cat.text})
+
+ pub_status=item.findtext(self.wpns+'status')
+ if pub_status=='publish':
+ entry['published']=True
+ else:
+ entry['published']=False
+
+ entry['comments']=[]
+
+ comments=item.findall(self.wpns+'comment')
+
+ for com in comments:
+ try:
+ comment_approved=int(com.findtext(self.wpns+'comment_approved'))
+ except:
+ comment_approved=0
+ if comment_approved:
+ comment=dict(author=com.findtext(self.wpns+'comment_author'),
+ content=com.findtext(self.wpns+'comment_content'),
+ email=com.findtext(self.wpns+'comment_author_email'),
+ weburl=com.findtext(self.wpns+'comment_author_url'),
+ date=com.findtext(self.wpns+'comment_date')
+ )
+ self.entries.append(entry)
+ except:
+ logging.info("parse wordpress file error")
+ self.total=self.count()
+ self.cur_do=("begin","begin")
+ self.source=None
+ self.doc=None
+
+ def count(self):
+ return len(self.categories)+len(self.entries)
+
+ def pop(self):
+ if len(self.categories)>0:
+ self.cur_do=('cat',self.categories.pop())
+ return self.cur_do
+
+ if len(self.entries)>0:
+ self.cur_do=('