Show
Ignore:
Timestamp:
08/27/08 01:48:08 (4 months ago)
Author:
dunker@…
Branch:
default
Message:

add gozernet/infoitem/+searchdescr to the cloud

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gozerbot/net/cloud.py

    r2259 r2262  
    3838        return "name=%s url=<%s> seen=%s" % (self.name, self.url, self.regtime) 
    3939 
     40    def doget(self, mount, cb, *args, **kwargs): 
     41        self.client = Client(self.url + mount, self.name).addcb(cb) 
     42        self.client.get() 
     43 
     44    def dopost(self, mount, cb, *args, **kwargs): 
     45        self.client = Client(self.url + mount, self.name).addcb(cb) 
     46        self.client.post(**kwargs) 
     47 
    4048    def query(self, what, cb): 
    4149        if what.startswith('/'): 
     
    5664self.name).addcb(cb) 
    5765        self.client.get() 
     66 
     67    def infoitemsearchdescr(self, item, cb): 
     68        self.client = Client(self.url + 'gozernet/infoitem/+searchdescr/', \ 
     69self.name).addcb(cb) 
     70        self.client.post(searchitem=item) 
    5871 
    5972    def join(self, cb): 
     
    166179        start_new_thread(asyncore.loop, (), {'use_poll': True }) 
    167180 
     181    def doget(self, mount, *args, **kwargs): 
     182        for url, node in self.nodes.iteritems(): 
     183            node.doget(mount, *args, **kwargs) 
     184        start_new_thread(asyncore.loop, (), {'use_poll': True }) 
     185 
     186    def dopost(self, mount, *args, **kwargs): 
     187        for url, node in self.nodes.iteritems(): 
     188            node.dopost(mount, *args, **kwargs) 
     189        start_new_thread(asyncore.loop, (), {'use_poll': True }) 
     190 
    168191    def getnodes(self): 
    169192        result = []