<s> """<STR_LIT>""" <EOL> import calendar <EOL> from datetime import datetime <EOL> import sys <EOL> import cherrypy <EOL> from cherrypy . lib import sessions <EOL> from cherrypy . _cpcompat import copyitems <EOL> page = """<STR_LIT>""" <EOL> class Root ( object ) : <EOL> def page ( self ) : <EOL> changemsg = [ ] <EOL> if cherrypy . session . id != cherrypy . session . originalid : <EOL> if cherrypy . session . originalid is None : <EOL> changemsg . append ( '<STR_LIT>' ) <EOL> if cherrypy . session . missing : <EOL> changemsg . append ( '<STR_LIT>' ) <EOL> if cherrypy . session . regenerated : <EOL> changemsg . append ( '<STR_LIT>' ) <EOL> try : <EOL> expires = cherrypy . response . cookie [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> except KeyError : <EOL> expires = '<STR_LIT>' <EOL> return page % { <EOL> '<STR_LIT>' : cherrypy . session . id , <EOL> '<STR_LIT>' : '<STR_LIT>' . join ( changemsg ) , <EOL> '<STR_LIT>' : cherrypy . response . cookie . output ( ) , <EOL> '<STR_LIT>' : cherrypy . request . cookie . output ( ) , <EOL> '<STR_LIT>' : copyitems ( cherrypy . session ) , <EOL> '<STR_LIT>' : datetime . utcnow ( ) . strftime ( "<STR_LIT>" ) + "<STR_LIT>" , <EOL> '<STR_LIT>' : calendar . timegm ( datetime . utcnow ( ) . timetuple ( ) ) , <EOL> '<STR_LIT>' : cherrypy . __version__ , <EOL> '<STR_LIT>' : sys . version , <EOL> '<STR_LIT>' : expires , <EOL> } <EOL> def index ( self ) : <EOL> cherrypy . session [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> return self . page ( ) <EOL> index . exposed = True <EOL> def expire ( self ) : <EOL> sessions . expire ( ) <EOL> return self . page ( ) <EOL> expire . exposed = True <EOL> def regen ( self ) : <EOL> cherrypy . session . regenerate ( ) <EOL> cherrypy . session [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> return self . page ( ) <EOL> regen . exposed = True <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> cherrypy . config . update ( { <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : True , <EOL> } ) <EOL> cherrypy . quickstart ( Root ( ) ) </s>
