OSDN Git Service

Use strict thread uri for windowlist.
authorAiwota Programmer <aiwotaprog@tetteke.tk>
Sat, 26 Aug 2006 10:38:52 +0000 (19:38 +0900)
committerAiwota Programmer <aiwotaprog@tetteke.tk>
Sat, 26 Aug 2006 10:38:52 +0000 (19:38 +0900)
src/Hage1/thread_window.py

index 53f96cf..b6bd9ca 100644 (file)
@@ -32,6 +32,8 @@ import idxfile
 import session
 import board_window
 from http_sub import HTTPRedirectHandler302
+from BbsType import bbs_type_judge_uri
+from BbsType import bbs_type_exception
 
 GLADE_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                          "..", "data")
@@ -41,13 +43,19 @@ def open_thread(uri):
     if not uri:
         raise ValueError, "parameter must not be empty"
 
+    bbs_type = bbs_type_judge_uri.get_type(uri)
+    if not bbs_type.is_thread():
+        raise bbs_type_exception.BbsTypeError, \
+              "the uri does not represent thread: " + uri
+    uri = bbs_type.get_thread_uri()  # use strict thread uri
+
     winwrap = session.get_window(uri)
     if winwrap:
         # already opened
         winwrap.window.present()
         pass
     else:
-        win_wrap = WinWrap(uri)
+        win_wrap = WinWrap(bbs_type.uri)  # pass original uri
         session.window_created(uri, win_wrap)