def __ensure_directory(self, number=0): hotspot_dir = "%s/hotspots" % self.project_config['output_dir'] bash.make_dir(hotspot_dir) config_mongo.change_config_field('hotspot_dir', hotspot_dir) directory = '%s/%s' % (hotspot_dir, number) bash.make_dir(directory) return directory
def __init__(self): self.project_config = config_mongo.get_project_config() self.logger = Logger.get_logger() self.output_files_dir = '%s/output_files' % self.project_config['output_dir'] if 'output_files_dir' not in self.project_config or not os.path.isdir(self.project_config['output_files_dir']): bash.make_dir(self.output_files_dir) config_mongo.change_config_field('output_files_dir', self.output_files_dir) else: self.output_files_dir = self.project_config['output_files_dir']
def __init__(self): """ This init method is different in that it will create the annotation_dir config parameter if it doesn't already exist. This is not necessarily the most elegant way to do this, but it works. :return: """ self.project_config = config_mongo.get_project_config() self.logger = Logger.get_logger() # Creates the annotation_dir if needed and loads it into the config file self.annotations_dir = '%s/annotations' % self.project_config['output_dir'] if 'annotation_dir' not in self.project_config or not\ os.path.isdir(self.project_config['annotation_dir']): bash.make_dir(self.annotations_dir) config_mongo.change_config_field('annotation_dir', self.annotations_dir) else: self.annotations_dir = self.project_config['annotation_dir']