Ejemplo n.º 1
0
 def get_rules(self):
     """Read the rules from a file"""
     rules_file = self.rules_file_name.value
     rules_directory = self.rules_directory.get_absolute_path()
     path = os.path.join(rules_directory, rules_file)
     if not os.path.isfile(path):
         raise ValidationError("No such rules file: %s" % path, self.rules_file_name)
     else:
         rules = cellprofiler.utilities.rules.Rules()
         rules.parse(path)
         return rules
Ejemplo n.º 2
0
 def get_rules(self):
     '''Read the rules from a file'''
     rules_file = self.rules_file_name.value
     rules_directory = self.rules_directory.get_absolute_path()
     path = os.path.join(rules_directory, rules_file)
     if not os.path.isfile(path):
         raise cellprofiler.setting.ValidationError("No such rules file: %s" % path,
                                                    self.rules_file_name)
     else:
         rules = cellprofiler.utilities.rules.Rules()
         rules.parse(path)
         return rules