comparison src/server/server.py @ 924:94f88277c2e7

libervia (pages): getSessionData return one session if used with one argument, else an iterator
author Goffi <goffi@goffi.org>
date Mon, 03 Apr 2017 01:00:29 +0200
parents edb322c87ea4
children e00151140f77
comparison
equal deleted inserted replaced
923:edb322c87ea4 924:94f88277c2e7
1901 @param request(server.Request): request linked to the session 1901 @param request(server.Request): request linked to the session
1902 @param *args(zope.interface.Interface): interface of the session to get 1902 @param *args(zope.interface.Interface): interface of the session to get
1903 @return (iterator(data)): requested session data 1903 @return (iterator(data)): requested session data
1904 """ 1904 """
1905 session = request.getSession() 1905 session = request.getSession()
1906 return (iface(session) for iface in args) 1906 if len(args) == 1:
1907 return args[0](session)
1908 else:
1909 return (iface(session) for iface in args)
1907 1910
1908 ## TLS related methods ## 1911 ## TLS related methods ##
1909 1912
1910 def _TLSOptionsCheck(self): 1913 def _TLSOptionsCheck(self):
1911 """Check options coherence if TLS is activated, and update missing values 1914 """Check options coherence if TLS is activated, and update missing values