# HG changeset patch # User jaina01 # Date 1346096512 14400 # Mon Aug 27 15:41:52 2012 -0400 # Node ID ee03fa85b5f59a8271b9d126493170da4541ddfe # Parent 7211847c125c7f310430b401cd3ca9d7a65d8d3a run through pages if status is 1 even though last column is empty diff --git a/multisites.go b/multisites.go --- a/multisites.go +++ b/multisites.go @@ -1,43 +1,43 @@ -package autocompare - -import ( - "encoding/csv" - "io" - "log" -) - -type MultiSites struct { - *csv.Reader - *SitesBase -} - -func (s *MultiSites) CheckLinks() bool { - return true -} - -func (s *MultiSites) NextPage() Page { - line, err := s.Read() - if err == io.EOF { - return nil - } - var state int - var message string - if len(line) < 12 { - if len(line) < 11 { - log.Printf("bad input data: %v", line) - return s.NextPage() - } else { - s.counts[line[5]]++ - state = PANIC - message = "MIGRATION " + line[5] - } - } else if line[5] == "1" && line[11] != "" { - s.processed++ - state = NEW - } else { - s.counts[line[5]]++ - state = PANIC - message = "MIGRATION " + line[5] - } - return &BasePage{attempts: 0, subdomain: line[3], domain1: line[4], origPath: line[7], path: line[8], adID: line[6], origImg: "", copyImg: "", state: state, id: line[2], message: message, baseURL: s.baseURL, uat: s.uat, useDomain1: s.useDomain1} -} +package autocompare + +import ( + "encoding/csv" + "io" + "log" +) + +type MultiSites struct { + *csv.Reader + *SitesBase +} + +func (s *MultiSites) CheckLinks() bool { + return true +} + +func (s *MultiSites) NextPage() Page { + line, err := s.Read() + if err == io.EOF { + return nil + } + var state int + var message string + if len(line) < 12 { + if len(line) < 11 { + log.Printf("bad input data: %v", line) + return s.NextPage() + } else { + s.counts[line[5]]++ + state = PANIC + message = "MIGRATION " + line[5] + } + } else if line[5] == "1" { + s.processed++ + state = NEW + } else { + s.counts[line[5]]++ + state = PANIC + message = "MIGRATION " + line[5] + } + return &BasePage{attempts: 0, subdomain: line[3], domain1: line[4], origPath: line[7], path: line[8], adID: line[6], origImg: "", copyImg: "", state: state, id: line[2], message: message, baseURL: s.baseURL, uat: s.uat, useDomain1: s.useDomain1} +}