# pylint: skip-file

import os
from assimilator import *
from Boinc import boinc_project_path

class SlimeClustersAssimilator(Assimilator):
    def __init__(self):
        Assimilator.__init__(self)

    def assimilate_handler(self, wu, results, canonical_result):
        if canonical_result == None:
            return
        
        src_file = self.get_file_path(canonical_result)
        dst_dir = boinc_project_path.project_path('slime-clusters')
        dst_file = os.path.join(dst_dir, 'results.txt')

        if not os.path.exists(dst_dir):
            os.makedirs(dst_dir)
        
        with open(src_file, 'r') as src, open(dst_file, 'a') as dst:
            dst.writelines(src.readlines())

if __name__ == "__main__":
    SlimeClustersAssimilator().run()
[((16, 18, 16, 67), 'Boinc.boinc_project_path.project_path', 'boinc_project_path.project_path', ({(16, 50, 16, 66): '"""slime-clusters"""'}, {}), "('slime-clusters')", False, 'from Boinc import boinc_project_path\n'), ((17, 19, 17, 55), 'os.path.join', 'os.path.join', ({(17, 32, 17, 39): 'dst_dir', (17, 41, 17, 54): '"""results.txt"""'}, {}), "(dst_dir, 'results.txt')", False, 'import os\n'), ((19, 15, 19, 38), 'os.path.exists', 'os.path.exists', ({(19, 30, 19, 37): 'dst_dir'}, {}), '(dst_dir)', False, 'import os\n'), ((20, 12, 20, 32), 'os.makedirs', 'os.makedirs', ({(20, 24, 20, 31): 'dst_dir'}, {}), '(dst_dir)', False, 'import os\n')]