Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SOHViewer
Manage
Activity
Members
Labels
Plan
Issues
11
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software Public
PASSOFT
SOHViewer
Commits
0a7dbdc5
Commit
0a7dbdc5
authored
1 year ago
by
Lan Dam
Browse files
Options
Downloads
Patches
Plain Diff
add get_total_riles to controller/util.py
parent
5c47aceb
No related branches found
No related tags found
1 merge request
!122
allow to select multi folder to load
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sohstationviewer/controller/util.py
+19
-1
19 additions, 1 deletion
sohstationviewer/controller/util.py
with
19 additions
and
1 deletion
sohstationviewer/controller/util.py
+
19
−
1
View file @
0a7dbdc5
...
...
@@ -24,7 +24,6 @@ def validate_file(path2file: Union[str, Path], file_name: str):
:param file_name: name of the file
:return: True if pass checking, False if not.
"""
if
file_name
.
startswith
(
'
.
'
):
# skip info file
return
False
...
...
@@ -49,6 +48,25 @@ def validate_dir(path: str):
raise
Exception
(
f
"
Skip info folder:
{
path
}
"
)
def
get_total_files
(
list_of_dir
:
Path
)
->
int
:
"""
Get total number of valid files in valid directories from the list_of_dir
:param list_of_dir:
:return total: total number of valid files
"""
total
=
0
for
folder
in
list_of_dir
:
for
path
,
_
,
files
in
os
.
walk
(
folder
):
try
:
validate_dir
(
path
)
except
Exception
:
continue
total
+=
len
([
f
for
f
in
files
if
validate_file
(
Path
(
path
).
joinpath
(
f
),
f
)])
return
total
@QtCore.Slot
()
def
display_tracking_info
(
tracking_box
:
QTextBrowser
,
text
:
str
,
type
:
LogType
=
LogType
.
INFO
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment