Skip to content

Commit f3f9ead

Browse files
switch to dict
1 parent 086672d commit f3f9ead

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

smodels/base/runtime.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
1111
"""
1212

13-
from typing import Union
13+
from typing import Union, Text, Dict
14+
import os
1415

1516
## place to keep the pointer to the model file (default = mssm)
1617
modelFile="smodels.share.models.mssm"
@@ -20,11 +21,11 @@
2021

2122
_deltas_rel_default = .2 ## the default relative error on the signal strength
2223

23-
def printEnvironmentInfo( args ):
24+
def printEnvironmentInfo( args : Dict ):
2425
""" very simple method that prints out info relevant to debugging
2526
machine-dependent problems """
2627
from smodels.base.smodelsLogging import colors
27-
colors.on = True if args.colors == True else False
28+
colors.on = True if "colors" in args and args["colors"] == True else False
2829
import importlib, platform
2930

3031
modules = [ "scipy", "sympy", "numpy",
@@ -45,7 +46,7 @@ def printEnvironmentInfo( args ):
4546
except ImportError:
4647
print(f"{module_name:<12}: Not installed")
4748

48-
def filetype ( filename ):
49+
def filetype ( filename : os.PathLike ) -> Union[Text,None]:
4950
""" obtain information about the filetype of an input file,
5051
currently only used to discriminate between slha and lhe
5152
files.

smodels/tools/smodelsTools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def main():
157157

158158
if args.subparser_name == "environ-info":
159159
from smodels.base.runtime import printEnvironmentInfo
160-
printEnvironmentInfo( args )
160+
printEnvironmentInfo( vars(args) )
161161

162162
if args.subparser_name == 'installation':
163163
import sys, os

0 commit comments

Comments
 (0)