mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-05-20 16:20:45 +02:00
Don't read config.yaml just yet in the main branch
This commit is contained in:
parent
5bc0d1f762
commit
656acafed3
@ -4,7 +4,7 @@ import sys
|
|||||||
|
|
||||||
# The config file is in the same directory as this script
|
# The config file is in the same directory as this script
|
||||||
config_directory = os.path.dirname(__file__)
|
config_directory = os.path.dirname(__file__)
|
||||||
config_yaml = os.path.join(config_directory, "config.yaml")
|
# config_yaml = os.path.join(config_directory, "config.yaml")
|
||||||
config_json = os.path.join(config_directory, "config.json")
|
config_json = os.path.join(config_directory, "config.json")
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description='Get values from config file')
|
parser = argparse.ArgumentParser(description='Get values from config file')
|
||||||
@ -16,15 +16,16 @@ parser.add_argument('key', metavar='key', nargs='+',
|
|||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
if os.path.isfile(config_yaml):
|
# if os.path.isfile(config_yaml):
|
||||||
import yaml
|
# import yaml
|
||||||
with open(config_yaml, 'r') as configfile:
|
# with open(config_yaml, 'r') as configfile:
|
||||||
try:
|
# try:
|
||||||
config = yaml.safe_load(configfile)
|
# config = yaml.safe_load(configfile)
|
||||||
except Exception as e:
|
# except Exception as e:
|
||||||
print(e, file=sys.stderr)
|
# print(e, file=sys.stderr)
|
||||||
config = {}
|
# config = {}
|
||||||
elif os.path.isfile(config_json):
|
# el
|
||||||
|
if os.path.isfile(config_json):
|
||||||
import json
|
import json
|
||||||
with open(config_json, 'r') as configfile:
|
with open(config_json, 'r') as configfile:
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user