Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
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
mesonium
gajim
Commits
854cee83
Commit
854cee83
authored
3 years ago
by
Philipp Hörist
Browse files
Options
Downloads
Patches
Plain Diff
FileTransferJingle: Add asserts to help pyright
parent
4f76a5b1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gajim/gtk/conversation/rows/file_transfer_jingle.py
+10
-0
10 additions, 0 deletions
gajim/gtk/conversation/rows/file_transfer_jingle.py
with
10 additions
and
0 deletions
gajim/gtk/conversation/rows/file_transfer_jingle.py
+
10
−
0
View file @
854cee83
...
...
@@ -210,10 +210,13 @@ def _show_file_infos(self) -> None:
else
:
self
.
_ui
.
file_description
.
hide
()
assert
self
.
_file_props
.
size
is
not
None
self
.
_ui
.
file_size
.
set_text
(
GLib
.
format_size_full
(
self
.
_file_props
.
size
,
self
.
_units
))
def
process_event
(
self
,
event
:
TransferEventT
)
->
None
:
assert
self
.
_file_props
is
not
None
if
isinstance
(
event
,
JingleErrorReceived
):
if
event
.
sid
!=
self
.
_file_props
.
sid
:
return
...
...
@@ -261,6 +264,7 @@ def _update_progress(self, file_props: FileProp) -> None:
time_now
=
time
.
time
()
full_size
=
file_props
.
size
assert
full_size
is
not
None
if
file_props
.
type_
==
'
s
'
:
# We're sending a file
...
...
@@ -273,6 +277,7 @@ def _update_progress(self, file_props: FileProp) -> None:
else
:
# We're receiving a file
transferred_size
=
file_props
.
received_len
assert
transferred_size
is
not
None
if
full_size
==
0
:
return
...
...
@@ -321,15 +326,20 @@ def _on_accept_file_request(self, _button: Gtk.Button) -> None:
def
_on_reject_file_request
(
self
,
_button
:
Gtk
.
Button
)
->
None
:
self
.
_client
.
get_module
(
'
Bytestream
'
).
send_file_rejection
(
self
.
_file_props
)
assert
self
.
_file_props
is
not
None
self
.
_file_props
.
stopped
=
True
self
.
_ui
.
action_stack
.
set_visible_child_name
(
'
rejected
'
)
self
.
_ui
.
transfer_action
.
set_text
(
_
(
'
File Transfer Cancelled
'
))
def
_on_open_file
(
self
,
_button
:
Gtk
.
Button
)
->
None
:
assert
self
.
_file_props
is
not
None
assert
self
.
_file_props
.
file_name
is
not
None
if
os
.
path
.
exists
(
self
.
_file_props
.
file_name
):
open_file
(
self
.
_file_props
.
file_name
)
def
_on_open_folder
(
self
,
_button
:
Gtk
.
Button
)
->
None
:
assert
self
.
_file_props
is
not
None
assert
self
.
_file_props
.
file_name
is
not
None
path
=
os
.
path
.
split
(
self
.
_file_props
.
file_name
)[
0
]
if
os
.
path
.
exists
(
path
)
and
os
.
path
.
isdir
(
path
):
open_file
(
path
)
...
...
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