stalker.models.auth.LocalSession

Inheritance diagram of stalker.models.auth.LocalSession
class stalker.models.auth.LocalSession[source]

Bases: object

A simple temporary session object which simple stores session data.

This class will later be removed, it is here because we need a login window for the Qt user interfaces.

On initialize it will load the SessionData from the users .strc folder

__init__()[source]

Methods

__init__()
datetime_to_millis(dt) Default JSON serializer for datetime objects.
default_json_serializer(obj) default serializer for json data
delete() removes the cache file
load() loads the data from the saved local session
millis_to_datetime(millis)
param int millis:
 an int value showing the millis from unix EPOCH
save() remembers the data in user local file system
session_file_full_path()
return str:the session file full path
store_user(user) stores the given user instance

Attributes

logged_in_user returns the logged in user
classmethod default_json_serializer(obj)[source]

default serializer for json data

classmethod datetime_to_millis(dt)[source]

Default JSON serializer for datetime objects.

code is based on the answer of Jay Taylor in http://stackoverflow.com/questions/11875770/how-to-overcome-datetime-datetime-not-json-serializable-in-python

Parameters:dt – datetime.datetime instance
classmethod millis_to_datetime(millis)[source]
Parameters:millis (int) – an int value showing the millis from unix EPOCH
Returns:
load()[source]

loads the data from the saved local session

logged_in_user

returns the logged in user

store_user(user)[source]

stores the given user instance

Parameters:user – The user instance.
save()[source]

remembers the data in user local file system

delete()[source]

removes the cache file

classmethod session_file_full_path()[source]
Return str:the session file full path