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
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
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:
-
logged_in_user
¶ returns the logged in user
-
classmethod