comparison src/server/session_iface.py @ 919:7b267496da1d

server: moved session interfaces to session_iface module + added SATGuestSession
author Goffi <goffi@goffi.org>
date Wed, 29 Mar 2017 19:46:04 +0200
parents
children 92f0eeb6dc72
comparison
equal deleted inserted replaced
918:96a56856d357 919:7b267496da1d
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3
4 # Libervia: a SAT frontend
5 # Copyright (C) 2009-2016 Jérôme Poisson (goffi@goffi.org)
6
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU Affero General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
11
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU Affero General Public License for more details.
16
17 # You should have received a copy of the GNU Affero General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 from zope.interface import Interface, Attribute, implements
20 import shortuuid
21
22 class ISATSession(Interface):
23 profile = Attribute("Sat profile")
24 jid = Attribute("JID associated with the profile")
25 uuid = Attribute("uuid associated with the profile session")
26
27
28 class SATSession(object):
29 implements(ISATSession)
30
31 def __init__(self, session):
32 self.profile = None
33 self.jid = None
34 self.uuid = unicode(shortuuid.uuid())
35
36
37 class ISATGuestSession(Interface):
38 id = Attribute("UUID of the guest")
39 data = Attribute("data associated with the guest")
40
41
42 class SATGuestSession(object):
43 implements(ISATGuestSession)
44
45 def __init__(self, session):
46 self.id = None
47 self.data = None