X-Git-Url: http://git.sourceforge.jp/view?p=fukui-no-namari%2Ffukui-no-namari.git;a=blobdiff_plain;f=src%2FFukuiNoNamari%2FBbsType%2Fbbs_type_other.py;h=f82150572de89d1020fe0e739c9cf3bfd48c6007;hp=75f77839ffdad6d2e9e22d7af5889617763042db;hb=aa40f6b555876e25dbb245e57bee914a40fa59ca;hpb=c127dd7ca54ed21dfc2fcbb0d2d47f4527bf0e92 diff --git a/src/FukuiNoNamari/BbsType/bbs_type_other.py b/src/FukuiNoNamari/BbsType/bbs_type_other.py index 75f7783..f821505 100644 --- a/src/FukuiNoNamari/BbsType/bbs_type_other.py +++ b/src/FukuiNoNamari/BbsType/bbs_type_other.py @@ -20,6 +20,7 @@ import os.path import traceback from bbs_type_2ch import BaseType +from bbs_type_exception import BbsTypeError _whitelist = [] @@ -48,14 +49,15 @@ class TypeOther(BaseType): self.board = board return else: - match = re.match( - "http://%s/test/read.cgi/%s/(?P[^/]+)/" \ - % (host, board), uri) - if match: - self.host = host - self.board = board - self.thread = match.group("thread") - return + cgi_base = "http://%s/test/read.cgi/%s/" % (host, board) + if uri.startswith(cgi_base): + match = re.match( + "(?P[^/]+)/", uri[len(cgi_base):]) + if match: + self.host = host + self.board = board + self.thread = match.group("thread") + return else: print "%s in whitelist is not supported" % iru