def generate_protos_first(original_cmd):
    try:
        import gen_protos

        class cmd(original_cmd, object):

            def run(self):
                gen_protos.generate_proto_files()
                super(cmd, self).run()
        return cmd
    except ImportError:
        warnings.warn('Could not import gen_protos, skipping proto generation.')
        return original_cmd
def generate_protos_first(original_cmd):
    try:
        import gen_protos

        class cmd(original_cmd, object):

            def run(self):
                gen_protos.generate_proto_files()
                super(cmd, self).run()
        return cmd
    except ImportError:
        warnings.warn('Could not import gen_protos, skipping proto generation.')
        return original_cmd