Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Stable Diffusion Webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Stable Diffusion Webui
Commits
36ecff71
Commit
36ecff71
authored
Aug 20, 2023
by
w-e-w
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
catch error when loading config_states
and save config_states with indent
parent
9d2299ed
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
modules/config_states.py
modules/config_states.py
+7
-4
modules/ui_extensions.py
modules/ui_extensions.py
+1
-1
No files found.
modules/config_states.py
View file @
36ecff71
...
...
@@ -28,10 +28,13 @@ def list_config_states():
for
filename
in
os
.
listdir
(
config_states_dir
):
if
filename
.
endswith
(
".json"
):
path
=
os
.
path
.
join
(
config_states_dir
,
filename
)
with
open
(
path
,
"r"
,
encoding
=
"utf-8"
)
as
f
:
j
=
json
.
load
(
f
)
j
[
"filepath"
]
=
path
config_states
.
append
(
j
)
try
:
with
open
(
path
,
"r"
,
encoding
=
"utf-8"
)
as
f
:
j
=
json
.
load
(
f
)
j
[
"filepath"
]
=
path
config_states
.
append
(
j
)
except
Exception
as
e
:
print
(
f
'[ERROR]{path}, {e}'
)
config_states
=
sorted
(
config_states
,
key
=
lambda
cs
:
cs
[
"created_at"
],
reverse
=
True
)
...
...
modules/ui_extensions.py
View file @
36ecff71
...
...
@@ -65,7 +65,7 @@ def save_config_state(name):
filename
=
os
.
path
.
join
(
config_states_dir
,
f
"{timestamp}_{name}.json"
)
print
(
f
"Saving backup of webui/extension state to {filename}."
)
with
open
(
filename
,
"w"
,
encoding
=
"utf-8"
)
as
f
:
json
.
dump
(
current_config_state
,
f
)
json
.
dump
(
current_config_state
,
f
,
indent
=
4
)
config_states
.
list_config_states
()
new_value
=
next
(
iter
(
config_states
.
all_config_states
.
keys
()),
"Current"
)
new_choices
=
[
"Current"
]
+
list
(
config_states
.
all_config_states
.
keys
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment