X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.main.git;a=blobdiff_plain;f=yoweb-scrape;fp=yoweb-scrape;h=a2add1001aa0d25e6a047f1f472353eb259a5a72;hp=53da06e2a7d98847055a8e14d2d83b867726b508;hb=c6872f2d692d1a4cc990cd0e46631e765760141b;hpb=4488c88f213df763a009306203e2318e06647c18 diff --git a/yoweb-scrape b/yoweb-scrape index 53da06e..a2add10 100755 --- a/yoweb-scrape +++ b/yoweb-scrape @@ -590,6 +590,19 @@ class IslandExtendedInfo(IslandBasicInfo): return `(self.ocean, self.islandid, self.name, self.yoweb_url, self.flagid)` +class IslandFlagInfo(IslandExtendedInfo): + def __init__(self, ocean, islename): + IslandExtendedInfo.__init__(self, ocean, islename) + self.flag = None + self._collect_flag() + + def _collect_flag(self): + if self.flagid is None: return + self.flag = FlagInfo(self.flagid, 1800) + + def __str__(self): + return IslandExtendedInfo.__str__(self) + '; ' + str(self.flag) + class OceanInfo(): # Public data attributes: # oi.islands[islename] = IslandInfo(...) @@ -1326,7 +1339,7 @@ def do_standings_crew_of(args, bu): def do_ocean(args, bu): if (len(args)): bu('ocean takes no further arguments') fetcher.default_ocean() - oi = OceanInfo(IslandExtendedInfo) + oi = OceanInfo(IslandFlagInfo) print oi for islename in sorted(oi.islands.keys()): isle = oi.islands[islename]