• R/O
  • SSH
  • HTTPS

mail2weblog: Commit


Commit MetaInfo

Revision750 (tree)
Time2012-06-26 22:43:43
Authortoy_dev

Log Message

リファクタリングを行い情報の整理を行った。また、tDiary のブログ記事の削除にも対応した。

Change Summary

Incremental Difference

--- trunk/main/plugin/weblog/t_diary/t_diary_delete.rb (nonexistent)
+++ trunk/main/plugin/weblog/t_diary/t_diary_delete.rb (revision 750)
@@ -0,0 +1,21 @@
1+# coding: UTF-8
2+
3+require 'plugin/weblog/meta_weblog/meta_weblog_delete'
4+
5+#=tDiary のブログ記事削除用ウェブログプラグイン
6+#
7+# 最初の著者:: トゥイー
8+# リポジトリ情報:: $Id: meta_weblog_delete.rb 621 2012-03-17 02:36:35Z toy_dev $
9+# 著作権:: Copyright (C) Ownway.info, 2011. All rights reserved.
10+# ライセンス:: CPL(Common Public Licence)
11+class TDiaryDelete_WeblogPlugin < MetaWeblogDelete_WeblogPlugin
12+
13+ def delete_article(client, postid)
14+ M2W_LOGGER.debug("Start blogger.deletePost ... postid = #{postid}")
15+ result = client.call("blogger.deletePost", "", postid, @parent.username, @parent.password)
16+ M2W_LOGGER.debug("Finish blogger.deletePost ... result = #{result}")
17+
18+ return result
19+ end
20+
21+end
--- trunk/main/plugin/weblog/t_diary/t_diary.rb (revision 749)
+++ trunk/main/plugin/weblog/t_diary/t_diary.rb (revision 750)
@@ -1,12 +1,10 @@
11 # coding: UTF-8
22
3-require 'plugin/weblog/movable_type/movable_type'
3+require 'plugin/weblog/meta_weblog/meta_weblog'
4+require 'plugin/weblog/t_diary/t_diary_delete'
45 require 'plugin/weblog/t_diary/t_diary_get'
56 require 'plugin/weblog/t_diary/t_diary_formatter'
67
7-M2W_WEBLOG_TDIARY_ATTACHMENT_ROOT_PATH = 'attrs'
8-M2W_WEBLOG_TDIARY_THUMBNAIL_ROOT_PATH = 'thumbs'
9-
108 #=tDiary のためのウェブログプラグイン
119 #
1210 # 最初の著者:: トゥイー
@@ -13,19 +11,8 @@
1311 # リポジトリ情報:: $Id: seesaa.rb 615 2012-03-16 23:57:45Z toy_dev $
1412 # 著作権:: Copyright (C) Ownway.info, 2011. All rights reserved.
1513 # ライセンス:: CPL(Common Public Licence)
16-class TDiary_WeblogPlugin < MovableType_WeblogPlugin
14+class TDiary_WeblogPlugin < MetaWeblog_WeblogPlugin
1715
18- def initialize(
19- endpoint = M2W_WEBLOG_ENDPOINT,
20- username = M2W_WEBLOG_USERNAME,
21- password = M2W_WEBLOG_PASSWORD,
22- encoding = M2W_WEBLOG_WORDPRESS_DEFAULT_ENCODING,
23- default_blogid = M2W_WEBLOG_DEFAULT_BLOGID,
24- attachment_root_path = M2W_WEBLOG_TDIARY_ATTACHMENT_ROOT_PATH,
25- thumbnail_root_path = M2W_WEBLOG_TDIARY_THUMBNAIL_ROOT_PATH)
26- super
27- end
28-
2916 def formatter
3017 return TDiaryFormatter.new(@plugin_manager)
3118 end
@@ -34,19 +21,14 @@
3421 return {}
3522 end
3623
37- # 添付ファイルのデフォルトのパスを取得します。
38- def get_attachment_default_filepath(postid, dateCreated, attachment_index, attachment_filename)
39- return "#{@attachment_root_path}#{postid}_#{attachment_index}#{File.extname(attachment_filename)}"
40- end
41-
42- # サムネイルのデフォルトのパスを取得します。
43- def get_thumbnail_default_filepath(postid, dateCreated, attachment_index, attachment_filename)
44- return "#{@thumbnail_root_path}#{postid}_#{attachment_index}#{File.extname(attachment_filename)}"
45- end
46-
4724 # ブログ記事投稿用のプラグインを取得します。
4825 def get_get_plugin()
4926 return TDiaryGet_WeblogPlugin.new(self)
5027 end
5128
29+ # ブログ記事削除用のプラグインを取得します。
30+ def get_delete_plugin()
31+ return TDiaryDelete_WeblogPlugin.new(self)
32+ end
33+
5234 end
Show on old repository browser