mirror of
https://github.com/Xevion/fusion-fission-choices.git
synced 2025-12-17 16:12:05 -06:00
custom json setup
This commit is contained in:
10
fusion.py
10
fusion.py
@@ -1,7 +1,7 @@
|
||||
import os, sys, json, re, mendeleev as mdv
|
||||
|
||||
# Configuration reading
|
||||
path = os.path.join(sys.path[0], 'config.json')
|
||||
path = os.path.join(sys.path[0], 'custom.json')
|
||||
config = json.load(open(path, 'r'))
|
||||
|
||||
# Constants
|
||||
@@ -10,7 +10,8 @@ noElements = '\t{No elements matched the configuration specified}'
|
||||
# Lambdas
|
||||
score = lambda element : config['elements'][str(element)]
|
||||
scoreSum = lambda item : ((score(item[0]) + score(item[1])), item)
|
||||
hasNegatives = lambda item : score(item[0]) < 0 or score(item[1]) < 0
|
||||
def hasNegatives(item):
|
||||
return score(item[0]) > 0 and score(item[1]) > 0
|
||||
|
||||
def getScoreFormat(item):
|
||||
score = str(scoreSum(item)[0])
|
||||
@@ -80,4 +81,7 @@ def main():
|
||||
reverse=not config['reverseOrder'])
|
||||
)
|
||||
)
|
||||
))
|
||||
))
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user