def __init__(self,space=False): LtrNode.__init__(self) LtrUri.__init__(self) self.record = False self.name = False self.space = False self.uri=False self.cwd = False #set drop in loadcookie() if space: self.setSpace(space)
def createfromUri(self,uri): LtrUri.setUri(self,uri) self.name = self.spacename cursor = self.getCursor() if self.name in cursor: print "ltr: drop old database ", self.name del cursor[self.name] print "ltr: create database ", self.name cursor.create(self.name) print "ltr: push design docs ", self.name self.records = self.getCursor()[self.name] self.records.update([couchdb.Document(_id='_design/ltrcrawler', language='javascript', views=views)]) return self
def setUri(self,uri): LtrUri.setUri(self,uri) self.name = self.spacename if self.name in self.getCursor(): self.records = self.getCursor()[self.name] return self
def setUri(self,uri): LtrUri.setUri(self,uri) return self
def createfromUri(cls,uri): s = cls() LtrUri.setUri(s,uri) s.name = s.boxname s.create() return s