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
4debd4d3
Commit
4debd4d3
authored
Jul 09, 2024
by
w-e-w
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compact get_info_from_repo_path
parent
3f6dcda3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
17 deletions
+10
-17
modules/sysinfo.py
modules/sysinfo.py
+10
-17
No files found.
modules/sysinfo.py
View file @
4debd4d3
...
...
@@ -5,6 +5,7 @@ import subprocess
import
platform
import
hashlib
import
re
from
pathlib
import
Path
from
modules
import
paths_internal
,
timer
,
shared
,
extensions
,
errors
,
launch_utils
...
...
@@ -162,20 +163,19 @@ def get_torch_sysinfo():
def
run_git
(
path
,
*
args
):
try
:
if
os
.
path
.
isdir
(
os
.
path
.
join
(
path
,
'.git'
)):
return
subprocess
.
check_output
([
launch_utils
.
git
,
'-C'
,
path
,
*
args
],
shell
=
False
,
encoding
=
'utf8'
)
.
strip
()
return
None
except
Exception
as
e
:
return
str
(
e
)
def
get_info_from_repo_path
(
path
):
def
get_info_from_repo_path
(
path
:
Path
):
is_repo
=
(
path
/
'.git'
)
.
is_dir
()
return
{
'name'
:
os
.
path
.
basename
(
path
)
,
'path'
:
path
,
'commit'
:
run_git
(
path
,
'rev-parse'
,
'HEAD'
),
'branch'
:
run_git
(
path
,
'branch'
,
'--show-current'
),
'remote'
:
run_git
(
path
,
'remote'
,
'get-url'
,
'origin'
)
'name'
:
path
.
name
,
'path'
:
str
(
path
)
,
'commit'
:
run_git
(
path
,
'rev-parse'
,
'HEAD'
)
if
is_repo
else
None
,
'branch'
:
run_git
(
path
,
'branch'
,
'--show-current'
)
if
is_repo
else
None
,
'remote'
:
run_git
(
path
,
'remote'
,
'get-url'
,
'origin'
)
if
is_repo
else
None
,
}
...
...
@@ -192,14 +192,7 @@ def get_extensions(*, enabled, fallback_disabled_extensions=None):
}
return
[
to_json
(
x
)
for
x
in
extensions
.
extensions
if
not
x
.
is_builtin
and
x
.
enabled
==
enabled
]
else
:
extensions_list
=
[]
for
extension_dirname
in
sorted
(
os
.
listdir
(
paths_internal
.
extensions_dir
)):
path
=
os
.
path
.
join
(
paths_internal
.
extensions_dir
,
extension_dirname
)
if
enabled
==
(
extension_dirname
in
fallback_disabled_extensions
):
continue
if
os
.
path
.
isdir
(
path
):
extensions_list
.
append
(
get_info_from_repo_path
(
path
))
return
extensions_list
return
[
get_info_from_repo_path
(
d
)
for
d
in
Path
(
paths_internal
.
extensions_dir
)
.
iterdir
()
if
d
.
is_dir
()
and
enabled
!=
(
str
(
d
.
name
)
in
fallback_disabled_extensions
)]
except
Exception
as
e
:
return
str
(
e
)
...
...
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