Mercurial > repos > in_silico > cravat_annotate_mutations
view cravat_convert/base_converter.py @ 27:a7e641d146f5 draft
Uploaded
author | in_silico |
---|---|
date | Wed, 18 Jul 2018 10:25:44 -0400 |
parents | 4b860b1f92fa |
children |
line wrap: on
line source
class BaseConverter(object): def __init__(self): self.format_name = None def check_format(self,*args,**kwargs): err_msg = 'Converter for %s format has no method check_format' %\ self.format_name raise NotImplementedError(err_msg) def setup(self,*args,**kwargs): err_msg = 'Converter for %s format has no method setup' %\ self.format_name raise NotImplementedError(err_msg) def convert_line(self,*args,**kwargs): err_msg = 'Converter for %s format has no method convert_line' %\ self.format_name raise NotImplementedError(err_msg) class BadFormatError(Exception): def __init__(self, message, errors=None): super(BadFormatError, self).__init__(message) # Support for custom error codes, if added later self.errors = errors