mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
RubarBE: Integration of the solver in the list
This commit is contained in:
1 parent
ab95f06700
commit
ed2ed0ac2a
2 files changed
+28
-7
No files matched your search
+26
-5
@@ -37,7 +37,7 @@ logger = logging.getLogger()
|
||||
|
||||
class Config(SQL):
|
||||
def __init__(self):
|
||||
self._version = '0.0.9'
|
||||
self._version = '0.0.10'
|
||||
self.filename = Config.filename()
|
||||
self.set_default_value()
|
||||
|
||||
@@ -221,6 +221,26 @@ class Config(SQL):
|
||||
"VALUES ('display_manning', 'False')"
|
||||
)
|
||||
|
||||
if int(release) < 10:
|
||||
posix = os.name == 'posix'
|
||||
ext = "" if posix else ".exe"
|
||||
path = os.path.join("@install_dir",
|
||||
"rubar", f"rubarbe{ext}")
|
||||
|
||||
self.execute(f"""
|
||||
INSERT OR IGNORE INTO solver VALUES (
|
||||
'rubarbe',
|
||||
'default-RubarBE',
|
||||
'Default Pamhyr2 RubarBE version',
|
||||
|
||||
'', '', '',
|
||||
|
||||
'',
|
||||
'"{path}" @args @input',
|
||||
''
|
||||
)
|
||||
""")
|
||||
|
||||
self.execute(
|
||||
f"UPDATE info SET value='{self._version}' " +
|
||||
"WHERE key='version'"
|
||||
@@ -417,11 +437,12 @@ class Config(SQL):
|
||||
new._cmd_solver = f""""{path}" @args @input"""
|
||||
self._solvers.append(new)
|
||||
|
||||
# Rubar3
|
||||
ctor = solver_type_list["rubar3"]
|
||||
new = ctor("default-Rubar3")
|
||||
# RubarBE (same executable as Rubar3, see notice §10.3)
|
||||
ctor = solver_type_list["rubarbe"]
|
||||
new = ctor("default-RubarBE")
|
||||
new._description = "Default Pamhyr2 RubarBE version"
|
||||
new._cmd_solver = f""""@install_dir/rubar/rubarbe{ext}" @args @input"""
|
||||
path = os.path.join("@install_dir", "rubar", f"rubarbe{ext}")
|
||||
new._cmd_solver = f""""{path}" @args @input"""
|
||||
self._solvers.append(new)
|
||||
|
||||
# Mage fake 7
|
||||
|
||||
Reference in new issue
Block a user