diff -urN saku-3.6.1/file/sample.ini saku-3.6.1-moonlight/file/sample.ini --- saku-3.6.1/file/sample.ini 2007-10-06 21:37:14.000000000 +0900 +++ saku-3.6.1-moonlight/file/sample.ini 2009-12-12 15:55:44.000000000 +0900 @@ -92,6 +92,9 @@ # Address available span. (seconds) tmpaddr_span: 3600 +# Auto get new threads mode. (yes/no) +moonlight: no + [Application Thread] # Time range for saving records. (seconds) # 0 for infinity diff -urN saku-3.6.1/shingetsu/client_cgi.py saku-3.6.1-moonlight/shingetsu/client_cgi.py --- saku-3.6.1/shingetsu/client_cgi.py 2007-10-06 21:37:15.000000000 +0900 +++ saku-3.6.1-moonlight/shingetsu/client_cgi.py 2009-12-12 16:54:30.000000000 +0900 @@ -123,6 +123,9 @@ if int(time()) - status["sync"] >= config.sync_cycle: self.do_sync() + if config.moonlight: + self.do_moonlight() + def check(self, key): status = Status() status.check(key) @@ -184,3 +187,19 @@ cachelist.getall(timelimit=self.timelimit) self.stderr.write("shingetsu.cache.CacheList.getall() finished\n") + + def do_moonlight(self): + """Auto get new threads. + """ + recentlist = RecentList()[:] + check = [] + for rec in recentlist: + cache = Cache(rec.datfile) + if rec.datfile not in check: + if not cache.exists(): + result = cache.search() + if result: + self.stderr.write("shingetsu moonlight: %s\n" % rec.datfile) + else: + self.stderr.write("shingetsu moonlight failed: %s\n" % rec.datfile) + check.append(rec.datfile) diff -urN saku-3.6.1/shingetsu/config.py saku-3.6.1-moonlight/shingetsu/config.py --- saku-3.6.1/shingetsu/config.py 2009-03-01 19:10:27.000000000 +0900 +++ saku-3.6.1-moonlight/shingetsu/config.py 2009-12-12 15:54:26.000000000 +0900 @@ -103,6 +103,7 @@ re_friend = re.compile(friend) re_visitor = re.compile(visitor) template_suffix = '.txt' +moonlight = _get_value(_extconf, 'Gateway', 'moonlight', False, 'boolean') tklog = _get_value(_extconf, 'Interface', 'tklog', 100, 'int')