Skip to content

Commit de4f1a8

Browse files
committed
More ruff fixes
1 parent 9bf7d7c commit de4f1a8

24 files changed

+28
-37
lines changed

omv/autogen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def read_option(options, default=0):
2727
opt = None
2828
while opt is None:
2929
try:
30-
sel = int(raw_input("Select option number [default: %s]: " % default))
30+
sel = int(input("Select option number [default: %s]: " % default))
3131
opt = options[sel]
3232
except IndexError:
3333
print("invalid index!")

omv/common/inout.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def check_output(cmds, cwd=".", shell=False, verbosity=0, env=None):
103103
if env:
104104
joint_env.update(env)
105105
for k in os.environ:
106-
if not k in joint_env:
106+
if k not in joint_env:
107107
joint_env[k] = os.environ[k]
108108

109109
try:

omv/engines/engine.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from os.path import realpath
22
from os import environ
3-
import sys
43
from omv.common.inout import inform
54
import platform
65

@@ -78,8 +77,8 @@ def build_query_string(self, name, cmd):
7877
def set_environment(self):
7978
if self.environment_vars:
8079
for name, val in self.environment_vars.items():
81-
if name in environ and not "HOME" in name:
82-
if not ":%s:" % val in environ[name]:
80+
if name in environ and "HOME" not in name:
81+
if ":%s:" % val not in environ[name]:
8382
environ[name] = "%s:%s" % (environ[name], val)
8483
else:
8584
environ[name] = val

omv/engines/getarbor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def install_arbor(version=None):
88
pip_install("arbor==%s" % version)
99
import arbor
1010

11-
m = "Successfully installed Arbor..."
11+
m = "Successfully installed Arbor %s..."%arbor.__version__
1212
except Exception as e:
1313
m = "ERROR installing Arbor: " + str(e)
1414
finally:

omv/engines/getbrian1.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import os
2-
import pip
32
from omv.common.inout import inform, check_output
43
from omv.engines.utils.wdir import working_dir
54

omv/engines/getbrian2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def install_brian2(version):
1010
pip_install("brian2", version)
1111
import brian2
1212

13-
m = "Successfully installed Brian2..."
13+
m = "Successfully installed Brian2 %s..."%brian2.__version__
1414
except Exception as e:
1515
m = "ERROR installing Brian2: " + str(e)
1616
finally:

omv/engines/getxpp.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33

44
from omv.engines.utils.wdir import working_dir
55
from sysconfig import get_paths
6-
import sys
76

8-
import fileinput
97

108

119
def install_xpp(version="latest"):

omv/engines/jneuroml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def get_environment():
2424
jnmlhome = os.path.join(
2525
os.environ["XDG_DATA_HOME"], "jnml/jNeuroMLJar"
2626
)
27-
except KeyError as e:
27+
except KeyError:
2828
localsharepath = os.path.join(os.environ["HOME"], ".local/share")
2929
if os.path.isdir(localsharepath):
3030
jnmlhome = os.path.join(

omv/engines/moose_.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from omv.engines.pyneuroml_ import PyNeuroMLEngine
55

6-
from omv.common.inout import inform, trim_path, check_output, is_verbose
6+
from omv.common.inout import inform, trim_path, check_output
77
from omv.engines.engine import OMVEngine, EngineExecutionError
88

99

omv/engines/nestsli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def is_installed():
4242
if "-" in ret:
4343
ret = "v%s" % ret.split("-")[-1]
4444

45-
if not "v" in ret:
45+
if "v" not in ret:
4646
ret = "v%s" % ret
4747

4848
inform("NEST %s is correctly installed..." % ret, indent=2, verbosity=1)

0 commit comments

Comments
 (0)