Esempio n. 1
0
def parse_file(filename):
    f = open(filename)
    pkg = SeedsPackage()
    pkg.ID = 'FileSeedsLoader'
    pkg.seeds = []
    while 1:
        line = f.readline()
        #print line
        
        if not line:
            break

        if line.find("#")==0:
            print "ignore line[%s]" % line
            continue
        
        seed = parse_line(line)
        if seed:
            pkg.seeds.append(seed)
    return pkg
Esempio n. 2
0
def parse_file(filename):
    f = open(filename)
    pkg = SeedsPackage()
    pkg.ID = 'FileSeedsLoader'
    pkg.seeds = []
    while 1:
        line = f.readline()
        #print line

        if not line:
            break

        if line.find("#") == 0:
            print "ignore line[%s]" % line
            continue

        seed = parse_line(line)
        if seed:
            pkg.seeds.append(seed)
    return pkg
Esempio n. 3
0
 def excute(self, seed_frequency):
     pkg = SeedsPackage()
     pkg.ID = self.name
     pkg.seeds = self.time_shared_seeds[seed_frequency] 
     self.seed_service.add_seeds(self.name, pkg)
     self.loop_calls[seed_frequency].schedule(seed_frequency)
Esempio n. 4
0
 def execute(self, seed_frequency):
     pkg = SeedsPackage()
     pkg.ID = self.name
     pkg.seeds = self.timeslice_seeds[seed_frequency]
     self.seed_service.add_seeds(self.name, pkg)
     self.loop_calls[seed_frequency].schedule(seed_frequency)