Module Expr Str ImportFrom alias Import alias Import alias ImportFrom alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad ClassDef bases AttributeLoad NameLoad attr body Expr Str Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad Num NameLoad body Expr Str Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr BoolOpOr NameLoad Call NameLoad Assign AttributeStore NameLoad attr BoolOpOr NameLoad Call NameLoad Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Raise NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Raise NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Raise NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Expr Str Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr If Call AttributeLoad NameLoad attr Str NameLoad body Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Raise NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr If Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str TryExcept body With Call NameLoad AttributeLoad NameLoad attr Str NameStore body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr Str NameLoad Raise NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str For NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr If CompareLt BinOpAdd NameLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad Num decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Assign NameStore AttributeLoad NameLoad attr If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad If BoolOpOr UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Raise Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr Str decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore NameLoad Assign NameStore Num Assign NameStore Str Assign NameStore Num FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str If UnaryOpNot AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return BinOpMod Str AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareNotIn Str Call NameLoad body Import alias Assign NameStore Dict Str Str Str Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Yield Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Raise Call AttributeLoad NameLoad attr NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Assign NameStore Yield Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr If NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Raise Call AttributeLoad NameLoad attr NameLoad orelse Raise Call AttributeLoad NameLoad attr NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Yield Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr NameLoad Raise Call AttributeLoad NameLoad attr NameLoad decorator_list AttributeLoad NameLoad attr decorator_list
N/A N/A 
Tinman session classes for the management of session data

 tornado gen N/A logging N/A os os path N/A tempfile N/A time N/A uuid tinman config tinman exceptions tinman mapping N/A LOGGER N/A N/A logging getLogger __name__ Session N/A N/A mapping Mapping N/A N/A Session provides a base interface for session management and should be
    extended by storage objects that are used by the SessionHandlerMixin.

     N/A id None N/A ip_address None N/A last_request_at None N/A last_request_uri None __init__ N/A N/A self session_id duration settings N/A None 3600 None N/A N/A Create a new session instance. If no id is passed in, a new ID is
        created. If an id is passed in, load the session data from storage.

        :param str session_id: The session ID
        :param dict settings: Session object configuration

         N/A N/A N/A N/A super Session self __init__ N/A N/A self _duration duration N/A N/A self _settings N/A settings N/A dict N/A N/A self id N/A session_id N/A str N/A N/A uuid uuid4 N/A fetch N/A N/A self N/A N/A N/A Fetch the contents of the session from storage.

        :raises: NotImplementedError

         N/A NotImplementedError N/A delete N/A N/A self N/A N/A N/A Extend to the delete the session from storage

        :raises: NotImplementedError

         N/A NotImplementedError N/A save N/A N/A self N/A N/A N/A Save the session for later retrieval

        :raises: NotImplementedError

         N/A NotImplementedError N/A N/A FileSession N/A Session N/A N/A Session data is stored on disk using the FileSession object.

    Configuration in the application settings is as follows::

        Application:
          session:
            adapter:
              name: file
              cleanup: false
              directory: /tmp/sessions
            cookie:
              name: session
              duration: 3600

     N/A DEFAULT_SUBDIR tinman __init__ N/A N/A self session_id duration settings N/A None None None N/A N/A Create a new session instance. If no id is passed in, a new ID is
        created. If an id is passed in, load the session data from storage.

        :param str session_id: The session ID
        :param dict settings: Session object configuration

         N/A N/A N/A N/A super FileSession self __init__ session_id duration settings N/A N/A self _storage_dir N/A N/A self _setup_storage_dir N/A N/A N/A settings get cleanup True N/A N/A N/A N/A self _cleanup N/A fetch N/A N/A self N/A N/A N/A Fetch the contents of the session from storage.

        :raises: NotImplementedError

         N/A NotImplementedError N/A delete N/A N/A self N/A N/A N/A Extend to the delete the session from storage

         N/A N/A N/A self clear N/A N/A N/A N/A os path isfile N/A self _filename N/A N/A N/A N/A os unlink N/A self _filename N/A N/A N/A N/A LOGGER debug Session file did not exist: %s N/A self _filename N/A save N/A N/A self N/A N/A N/A Save the session for later retrieval

        :raises: IOError

         N/A N/A N/A N/A open N/A self _filename wb session_file N/A N/A N/A N/A session_file write N/A N/A self dumps N/A N/A N/A IOError N/A error N/A N/A N/A N/A LOGGER error Session file error: %s error N/A error N/A _cleanup N/A N/A self N/A N/A N/A Remove any stale files from the session storage directory N/A filename N/A N/A os listdir N/A self _storage_dir N/A N/A file_path N/A N/A path join N/A self _storage_dir filename N/A file_stat N/A N/A os stat file_path N/A evaluate N/A max N/A file_stat st_ctime N/A file_stat st_mtime N/A N/A N/A evaluate N/A self _duration N/A N/A time time N/A N/A N/A N/A LOGGER debug Removing stale file: %s file_path N/A N/A N/A os unlink file_path N/A _default_path N/A N/A self N/A N/A N/A Return the default path for session data

        :rtype: str

         N/A N/A N/A path join N/A N/A tempfile gettempdir N/A self DEFAULT_SUBDIR N/A property _filename N/A N/A self N/A N/A N/A Returns the filename for the session file.

        :rtype: str

         N/A N/A N/A path join N/A self _storage_dir N/A self id N/A property _make_path N/A N/A dir_path N/A N/A N/A Create the full path specified.

        :param str dir_path: The path to make

         N/A N/A N/A os makedirs dir_path 1877 N/A staticmethod _setup_storage_dir N/A N/A self N/A N/A N/A Setup the storage directory path value and ensure the path exists.

        :rtype: str
        :raises: tinman.exceptions.ConfigurationException

         N/A dir_path N/A N/A N/A self _settings get N/A config DIRECTORY N/A N/A dir_path None N/A N/A dir_path N/A self _default_path N/A N/A N/A N/A N/A os path exists dir_path N/A N/A N/A N/A self _make_path dir_path N/A N/A dir_path N/A N/A path abspath dir_path N/A N/A N/A N/A N/A N/A os path exists dir_path N/A N/A N/A N/A os path isdir dir_path N/A N/A N/A N/A exceptions ConfigurationException N/A N/A self __class__ __name__ N/A config DIRECTORY N/A N/A N/A dir_path rstrip / N/A N/A RedisSession N/A Session N/A N/A Using the RedisSession object, session data is stored in a Redis database
    using the tornadoredis client library.

    Example configuration in the application settings is as follows::

        Application:
          session:
            adapter:
              name: redis
              host: localhost
              port: 6379
              db: 2
            cookie:
              name: session
              duration: 3600

     N/A _redis_client None N/A REDIS_DB 2 N/A REDIS_HOST localhost N/A REDIS_PORT 6379 __init__ N/A N/A self session_id duration settings N/A None None N/A N/A Create a new redis session instance. If no id is passed in, a
        new ID is created. If an id is passed in, load the session data from
        storage.

        :param str session_id: The session ID
        :param dict config: Session object configuration

         N/A N/A N/A RedisSession _redis_client N/A N/A N/A N/A RedisSession _redis_connect settings N/A N/A N/A N/A super RedisSession self __init__ session_id duration settings N/A _key N/A N/A self N/A N/A N/A N/A s:%s N/A self id N/A property _redis_connect N/A N/A cls settings N/A N/A N/A Connect to redis and assign the client to the RedisSession class
        so that it is globally available in this process.

        :param dict settings: The redis session configuration

         N/A N/A tornadoredis N/A globals N/A N/A tornadoredis N/A kwargs N/A host port selected_db N/A N/A settings get host N/A cls REDIS_HOST N/A N/A settings get port N/A cls REDIS_PORT N/A N/A settings get db N/A cls REDIS_DB N/A N/A N/A LOGGER info Connecting to %(host)s:%(port)s DB %(selected_db)s kwargs N/A N/A cls _redis_client N/A N/A tornadoredis Client kwargs N/A N/A N/A N/A cls _redis_client connect N/A classmethod delete N/A N/A self N/A N/A N/A Delete the item from storage

        :param method callback: The callback method to invoke when done

         N/A result N/A N/A N/A gen Task N/A N/A RedisSession _redis_client delete N/A self _key N/A N/A N/A LOGGER debug Deleted session %s (%r) N/A self id result N/A N/A N/A self clear N/A N/A N/A gen Return result N/A N/A gen coroutine fetch N/A N/A self N/A N/A N/A Fetch the data for the model from Redis and assign the values.

        :param method callback: The callback method to invoke when done

         N/A N/A N/A LOGGER debug Fetching session data: %s N/A self id N/A result N/A N/A N/A gen Task N/A N/A RedisSession _redis_client get N/A self _key N/A result N/A N/A N/A N/A self loads result N/A N/A N/A gen Return True N/A N/A N/A N/A gen Return False N/A N/A gen coroutine save N/A N/A self N/A N/A N/A Store the session data in redis

        :param method callback: The callback method to invoke when done

         N/A result N/A N/A N/A gen Task N/A N/A RedisSession _redis_client set N/A self _key N/A N/A self dumps N/A N/A N/A LOGGER debug Saved session %s (%r) N/A self id result N/A N/A N/A gen Return result N/A N/A gen coroutine N/A