stalker.models.auth.LocalSession¶
-
class
stalker.models.auth.
LocalSession
¶ 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__
()¶ x.__init__(…) initializes x; see help(type(x)) for signature
Methods
__init__
()x.__init__(…) initializes x; see help(type(x)) for signature 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)¶ 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
default_json_serializer
(obj)¶ default serializer for json data
-
delete
()¶ removes the cache file
-
load
()¶ loads the data from the saved local session
-
logged_in_user
¶ returns the logged in user
-
classmethod
millis_to_datetime
(millis)¶ Parameters: millis (int) – an int value showing the millis from unix EPOCH Returns:
-
save
()¶ remembers the data in user local file system
-
classmethod
session_file_full_path
()¶ Return str: the session file full path
-
store_user
(user)¶ stores the given user instance
Parameters: user – The user instance.
-