Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vmj-qt
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
vmj-qt
Commits
992f561e
Commit
992f561e
authored
Feb 03, 2016
by
Dan Pascu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Post the session creation notifications after instantiation only
parent
97aa8903
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
sessions.py
blink/sessions.py
+19
-2
No files found.
blink/sessions.py
View file @
992f561e
...
@@ -411,7 +411,21 @@ class SessionItemsDescriptor(object):
...
@@ -411,7 +411,21 @@ class SessionItemsDescriptor(object):
raise
AttributeError
(
"Attribute cannot be deleted"
)
raise
AttributeError
(
"Attribute cannot be deleted"
)
class
BlinkSession
(
object
):
class
BlinkSessionType
(
type
):
def
__call__
(
cls
,
*
args
,
**
kw
):
instance
=
super
(
BlinkSessionType
,
cls
)
.
__call__
(
*
args
,
**
kw
)
instance
.
__establish__
()
return
instance
class
BlinkSessionBase
(
object
):
__metaclass__
=
BlinkSessionType
def
__establish__
(
self
):
pass
class
BlinkSession
(
BlinkSessionBase
):
implements
(
IObserver
)
implements
(
IObserver
)
streams
=
StreamListDescriptor
()
streams
=
StreamListDescriptor
()
...
@@ -419,6 +433,8 @@ class BlinkSession(object):
...
@@ -419,6 +433,8 @@ class BlinkSession(object):
def
__init__
(
self
):
def
__init__
(
self
):
self
.
_initialize
()
self
.
_initialize
()
def
__establish__
(
self
):
notification_center
=
NotificationCenter
()
notification_center
=
NotificationCenter
()
notification_center
.
post_notification
(
'BlinkSessionWasCreated'
,
sender
=
self
)
notification_center
.
post_notification
(
'BlinkSessionWasCreated'
,
sender
=
self
)
...
@@ -3514,7 +3530,7 @@ class FileSizeFormatter(object):
...
@@ -3514,7 +3530,7 @@ class FileSizeFormatter(object):
return
"
%
d bytes"
%
size
return
"
%
d bytes"
%
size
class
BlinkFileTransfer
(
object
):
class
BlinkFileTransfer
(
BlinkSessionBase
):
implements
(
IObserver
)
implements
(
IObserver
)
def
__init__
(
self
):
def
__init__
(
self
):
...
@@ -3535,6 +3551,7 @@ class BlinkFileTransfer(object):
...
@@ -3535,6 +3551,7 @@ class BlinkFileTransfer(object):
self
.
_uri
=
None
self
.
_uri
=
None
self
.
_stat
=
None
self
.
_stat
=
None
def
__establish__
(
self
):
notification_center
=
NotificationCenter
()
notification_center
=
NotificationCenter
()
notification_center
.
post_notification
(
'BlinkFileTransferWasCreated'
,
sender
=
self
)
notification_center
.
post_notification
(
'BlinkFileTransferWasCreated'
,
sender
=
self
)
...
...
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