mirror of https://gitlab.com/pamhyr/pamhyr2
41 lines
746 B
Python
41 lines
746 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
import os
|
|
import subprocess
|
|
from enum import Enum
|
|
|
|
class STATUS(Enum):
|
|
STOPED = 0
|
|
RUNNING = 1
|
|
FAILED = 2
|
|
CONF_ERROR = 3
|
|
|
|
class AbstractSolver(object):
|
|
def __init__(self, name):
|
|
super(AbstractSolver, self).__init__()
|
|
|
|
self.name = name
|
|
self.status = STATUS.STOPED
|
|
|
|
def nb_proc(self):
|
|
"""
|
|
Return the number of processor used by solver (usefull for
|
|
multiple solver run on same time).
|
|
"""
|
|
return 1
|
|
|
|
def status(self):
|
|
return self.status
|
|
|
|
def set_status(self, status):
|
|
self.status = status
|
|
|
|
def run(self):
|
|
return False
|
|
|
|
def kill(self):
|
|
return False
|
|
|
|
def readline(self):
|
|
return ""
|