Skip to content

Commit

Permalink
Use file transfer constants
Browse files Browse the repository at this point in the history
Hard coded integer constants were used instead of enums imported from
TelepathyGLib.

Reported-by: Saumya Mishra <[email protected]>
  • Loading branch information
quozl committed May 25, 2020
1 parent b740323 commit 881ed15
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions collabwrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,20 +409,25 @@ def owner(self):
return self._owner


FT_STATE_NONE = 0
FT_STATE_PENDING = 1
FT_STATE_ACCEPTED = 2
FT_STATE_OPEN = 3
FT_STATE_COMPLETED = 4
FT_STATE_CANCELLED = 5

FT_REASON_NONE = 0
FT_REASON_REQUESTED = 1
FT_REASON_LOCAL_STOPPED = 2
FT_REASON_REMOTE_STOPPED = 3
FT_REASON_LOCAL_ERROR = 4
FT_REASON_LOCAL_ERROR = 5
FT_REASON_REMOTE_ERROR = 6
FT_STATE_NONE = TelepathyGLib.FileTransferState.NONE
FT_STATE_PENDING = TelepathyGLib.FileTransferState.PENDING
FT_STATE_ACCEPTED = TelepathyGLib.FileTransferState.ACCEPTED
FT_STATE_OPEN = TelepathyGLib.FileTransferState.OPEN
FT_STATE_COMPLETED = TelepathyGLib.FileTransferState.COMPLETED
FT_STATE_CANCELLED = TelepathyGLib.FileTransferState.CANCELLED

FT_REASON_NONE = \
TelepathyGLib.FileTransferStateChangeReason.NONE
FT_REASON_REQUESTED = \
TelepathyGLib.FileTransferStateChangeReason.REQUESTED
FT_REASON_LOCAL_STOPPED = \
TelepathyGLib.FileTransferStateChangeReason.LOCAL_STOPPED
FT_REASON_REMOTE_STOPPED = \
TelepathyGLib.FileTransferStateChangeReason.REMOTE_STOPPED
FT_REASON_LOCAL_ERROR = \
TelepathyGLib.FileTransferStateChangeReason.LOCAL_ERROR
FT_REASON_REMOTE_ERROR = \
TelepathyGLib.FileTransferStateChangeReason.REMOTE_ERROR


class _BaseFileTransfer(GObject.GObject):
Expand Down

0 comments on commit 881ed15

Please sign in to comment.