Skip to content

Commit

Permalink
Bugfixes in default handling of CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
d-wortmann committed May 29, 2024
1 parent 05e1a2d commit f234ae0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 2 additions & 0 deletions aiida_fleur/cmdline/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ def cmd_defaults():
dict["fleur"]=get_code_interactive("fleur.fleur",dict["fleur"])
dict["inpgen"]=get_code_interactive("fleur.inpgen",dict["inpgen"])

import os
HOME=os.getenv("HOME")
try:
os.mkdir(f"{HOME}/.aiida-fleur")
except:
Expand Down
17 changes: 8 additions & 9 deletions aiida_fleur/cmdline/util/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,17 @@ def get_fept_film_structure():
# Codes
def get_inpgen():
"""Return a `Code` node of the latest added inpgen executable in the database."""
try:
return get_default_dict()["inpgen"]
except:
return get_last_code('fleur.inpgen')

inpgen=get_default_dict()["inpgen"]
if inpgen==None:
inpgen=get_last_code("fleur.inpgen")
return inpgen

def get_fleur():
"""Return a `Code` node of the latest added inpgen executable in the database."""
try:
return get_default_dict()["fleur"]
except:
return get_last_code('fleur.fleur')
fleur=fleur=get_default_dict()["fleur"]
if fleur==None:
fleur=get_last_code('fleur.fleur')
return fleur



Expand Down

0 comments on commit f234ae0

Please sign in to comment.