OSDN Git Service

support yy kakiko.
authorAiwota Programmer <aiwotaprog@tetteke.tk>
Fri, 8 Sep 2006 00:08:12 +0000 (09:08 +0900)
committerAiwota Programmer <aiwotaprog@tetteke.tk>
Fri, 8 Sep 2006 00:08:12 +0000 (09:08 +0900)
src/FukuiNoNamari/BbsType/bbs_type_judge_uri.py
src/FukuiNoNamari/BbsType/bbs_type_yy.py [new file with mode: 0644]

index f09e8a2..6eb20d8 100644 (file)
 import traceback
 
 from bbs_type_2ch import Type2ch
+from bbs_type_yy import TypeYY
 from bbs_type_exception import BbsTypeError
 
-_typelist = [Type2ch]
+_typelist = [Type2ch, TypeYY]
 
 def get_type(uri):
     for type_class in _typelist:
diff --git a/src/FukuiNoNamari/BbsType/bbs_type_yy.py b/src/FukuiNoNamari/BbsType/bbs_type_yy.py
new file mode 100644 (file)
index 0000000..b4cdc5a
--- /dev/null
@@ -0,0 +1,36 @@
+# Copyright (C) 2006 by Aiwota Programmer
+# aiwotaprog@tetteke.tk
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+import re
+import copy
+
+from bbs_type_exception import BbsTypeError
+from bbs_type_2ch import Type2ch
+
+_base_reg_expr = re.compile("http://(?P<host>yy\d{2}\.(?:kakiko\.com|60\.kg))/(?P<board>[^/]+)/$")
+_cgi_reg_expr = re.compile("http://(?P<host>yy\d{2}\.(?:kakiko\.com|60\.kg))/test/read.cgi/(?P<board>[^/]+)/(?P<thread>[^/]+)/.*")
+
+
+class TypeYY(Type2ch):
+    bbs_type = "yy"
+    _base_reg = _base_reg_expr
+    _cgi_reg = _cgi_reg_expr
+
+    def get_board_dir_path(self):
+        """Returns board dir path from logs dir downward, not full path"""
+
+        return self.bbs_type + "/" + self.host + "/" + self.board