Changeset 36537

Show
Ignore:
Timestamp:
01/26/10 18:43:38 (3 years ago)
Author:
rezoo
Message:

更新した際に番号が初期化されてしまうバグの修正.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/python/twopy/trunk/twopy/thread.py

    r36525 r36537  
    131131      self.__isBroken   = False 
    132132      self.__res = len(self.__comments) 
    133     if response.code == 203: 
     133    elif response.code == 203: 
    134134      # Dat落ちと判断(10/01/24現在のanydat.soモジュールの仕様より) 
    135135      raise twopy.DatoutError, twopy.Message(["203 Non-Authoritative Information", "203レスポンスヘッダが返されました。このスレッドはDat落ちになったものと考えられます。"]) 
     
    138138   
    139139  def __appendComments(self, dat): 
    140     no_tag = re.compile("<.*?>") 
    141     nt = re.compile("(?P<name>.*)</b>(?P<trip>.*)<b>") 
    142     di = re.compile("(?P<date>.*) ID:(?P<id>.*)") 
    143      
    144140    num = 0 
    145     for (i, line) in enumerate(dat.split("\n")): 
     141    for line in dat.split("\n"): 
    146142      if len(self.__comments) == 0 : 
    147143        columns = line.split("<>") 
    148144        self.__title = columns[4] 
    149145      if line != "": 
    150         self.__comments.append( twopy.Comment(self, line, i+1) ) 
     146        self.__res += 1 
    151147        num += 1 
     148        self.__comments.append( twopy.Comment(self, line, self.__res) ) 
    152149    return num 
    153150 
     
    178175        # datが壊れている場合 
    179176        self.__isBroken = True 
     177      elif response.code == 203: 
     178        # dat落ちと判断 
     179        raise twopy.DatoutError, twopy.Message(["203 Non-Authoritative Information", "203レスポンスヘッダが返されました。このスレッドはDat落ちになったものと考えられます。"]) 
    180180      else: raise TypeError 
    181181