Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
irods-clients
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
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
RDM Infrastructure
irods-clients
Commits
a9820c9c
Commit
a9820c9c
authored
3 years ago
by
Staiger, Christine
Browse files
Options
Downloads
Patches
Plain Diff
- Enabling and disabling of buttons ans filesystem trees
- Returning file sizes as string from qt thread
parent
1e785bb4
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gui/dataTransfer.py
+14
-7
14 additions, 7 deletions
gui/dataTransfer.py
gui/irodsUpDownload.py
+6
-0
6 additions, 0 deletions
gui/irodsUpDownload.py
with
20 additions
and
7 deletions
gui/dataTransfer.py
+
14
−
7
View file @
a9820c9c
...
...
@@ -116,13 +116,14 @@ class dataTransfer(QDialog):
# Callback for the getDataSize worker
def
updateUiWithDataState
(
self
,
addFiles
,
diff
,
addSize
,
updateSize
):
self
.
updateSize
=
updateSize
print
(
int
(
addSize
),
int
(
updateSize
))
#checksumSizeStr = self.bytesToStr(updateSize)
self
.
ChecksumSizeLbl
.
setText
(
self
.
bytesToStr
(
updateSize
))
self
.
ChecksumSizeLbl
.
setText
(
self
.
bytesToStr
(
int
(
updateSize
))
)
self
.
diff
=
diff
self
.
addSize
=
addSize
#newSizeStr = self.bytesToStr(addSize)
self
.
newFSizeLbl
.
setText
(
self
.
bytesToStr
(
addSize
))
self
.
newFSizeLbl
.
setText
(
self
.
bytesToStr
(
int
(
addSize
))
)
self
.
addFiles
=
addFiles
self
.
loading_movie
.
stop
()
...
...
@@ -132,7 +133,7 @@ class dataTransfer(QDialog):
def
bytesToStr
(
self
,
bytes
):
bytes
=
bytes
/
(
10
24
**
3
)
bytes
=
bytes
/
(
10
00
**
3
)
if
bytes
<
1000
:
bytesStr
=
f
"
{
round
(
bytes
,
3
)
}
GB
"
else
:
...
...
@@ -158,7 +159,7 @@ class dataTransfer(QDialog):
class
getDataState
(
QObject
):
# Signals
updLabels
=
pyqtSignal
(
int
,
int
)
# Num files
finished
=
pyqtSignal
(
list
,
list
,
int
,
int
)
# Lists with size in bytes
finished
=
pyqtSignal
(
list
,
list
,
str
,
str
)
# Lists with size in bytes
def
__init__
(
self
,
ic
,
localFsPath
,
coll
,
upload
):
super
(
getDataState
,
self
).
__init__
()
...
...
@@ -208,8 +209,14 @@ class getDataState(QObject):
if
self
.
upload
==
True
:
fsDiffFiles
=
[
d
[
1
]
for
d
in
diff
]
updateSize
=
getSize
(
fsDiffFiles
)
addSize
=
getSize
(
onlyFS
)
self
.
finished
.
emit
(
onlyFS
,
diff
,
addSize
,
updateSize
)
fullOnlyFsPaths
=
[
self
.
localFsPath
+
os
.
sep
+
d
for
d
in
onlyFS
if
not
d
.
startswith
(
'
/
'
)
or
'
:
'
not
in
d
]
fullOnlyFsPaths
.
extend
([
d
for
d
in
onlyFS
if
d
.
startswith
(
'
/
'
)
or
'
:
'
in
d
])
addSize
=
getSize
(
fullOnlyFsPaths
)
print
(
str
(
fsDiffFiles
)
+
"
"
+
str
(
updateSize
))
print
(
str
(
onlyFS
)
+
"
"
+
str
(
addSize
))
self
.
finished
.
emit
(
onlyFS
,
diff
,
str
(
addSize
),
str
(
updateSize
))
else
:
irodsDiffFiles
=
[
d
[
0
]
for
d
in
diff
]
updateSize
=
self
.
ic
.
getSize
(
irodsDiffFiles
)
...
...
@@ -218,7 +225,7 @@ class getDataState(QObject):
if
not
onlyIrods
[
i
].
startswith
(
self
.
coll
.
path
):
onlyIrodsFullPath
[
i
]
=
self
.
coll
.
path
+
'
/
'
+
onlyIrods
[
i
]
addSize
=
self
.
ic
.
getSize
(
onlyIrodsFullPath
)
self
.
finished
.
emit
(
onlyIrods
,
diff
,
addSize
,
updateSize
)
self
.
finished
.
emit
(
onlyIrods
,
diff
,
str
(
addSize
)
,
str
(
updateSize
)
)
# Background worker for the up/download
...
...
This diff is collapsed.
Click to expand it.
gui/irodsUpDownload.py
+
6
−
0
View file @
a9820c9c
...
...
@@ -102,6 +102,8 @@ class irodsUpDownload():
self
.
widget
.
uplSetGB_2
.
setEnabled
(
enable
)
self
.
widget
.
createFolderButton
.
setEnabled
(
enable
)
self
.
widget
.
createCollButton
.
setEnabled
(
enable
)
self
.
widget
.
localFsTreeView
.
setEnabled
(
enable
)
self
.
widget
.
localFsTreeView
.
setEnabled
(
enable
)
def
infoPopup
(
self
,
message
):
...
...
@@ -158,10 +160,12 @@ class irodsUpDownload():
if
fsSource
==
None
or
irodsDestPath
==
None
:
self
.
widget
.
errorLabel
.
setText
(
"
ERROR Up/Download: Please select source and destination.
"
)
self
.
enableButtons
(
True
)
return
if
not
self
.
ic
.
session
.
collections
.
exists
(
irodsDestPath
):
self
.
widget
.
errorLabel
.
setText
(
"
ERROR UPLOAD: iRODS destination is file, must be collection.
"
)
self
.
enableButtons
(
True
)
return
destColl
=
self
.
ic
.
session
.
collections
.
get
(
irodsDestPath
)
#if os.path.isdir(fsSource):
...
...
@@ -191,10 +195,12 @@ class irodsUpDownload():
if
fsDest
==
None
or
irodsSourcePath
==
None
:
self
.
widget
.
errorLabel
.
setText
(
"
ERROR Up/Download: Please select source and destination.
"
)
self
.
enableButtons
(
True
)
return
if
os
.
path
.
isfile
(
fsDest
):
self
.
widget
.
errorLabel
.
setText
(
"
ERROR DOWNLOAD: Local Destination is file, must be folder.
"
)
self
.
enableButtons
(
True
)
return
# File
if
self
.
ic
.
session
.
data_objects
.
exists
(
irodsSourcePath
):
...
...
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