-
Notifications
You must be signed in to change notification settings - Fork 15
DataStore
The DataStore
class implements simple persistent memory for applications. If used in an app, it creates a file in the res/
directory called app_name.ds
, which contains JSON text. The class acts like a dict, with values being automatically saved as they are modified. Each app object has a dataStore
attribute which lets it access its own DataStore. However, the actual file will not be created until data is written.
DataStore ( Application app )
Accessible via app.dataStore
.
Object Variables
-
Application application
The application object that the DataStore is for. -
str dsPath
The path to the file. -
dict data
The data in the store. Note that this is only created if a value is read from the store, so always do a "get" operation before writing data.
Methods
-
getStore ()
An internal method that initializes the file. -
saveStore ()
An internal method that saves the data to the file. -
get ( str key, default=None )
Read a value from the store, returningdefault
if it does not exist. -
set ( str key, value )
Sets a value.
Note that the DataStore class also supports reading and writing via __getitem__
and __setitem__
.
Wiki and documentation by Adam Furman. Find an error or have a suggestion? Send it to furmada (at) gmail dot com.
Documentation
-
Application
class -
ApplicationList
class -
Notification
class-
PermanentNotification
class
-
-
NotificationQueue
class -
DataStore
class -
ImmersionUI
class
-
State
class
-
GUI
class
The following classes are all under the GUI class, e.g. Font
is actually accessed as GUI.Font
.
-
Font
class -
Icons
class -
ColorPalette
class -
LongClickEvent
class -
IntermediateUpdateEvent
class -
EventQueue
class -
FunctionBar
class -
Keyboard
class -
Overlay
class -
Dialog
class-
OKDialog
dialog -
ErrorDialog
dialog -
WarningDialog
dialog -
YNDialog
dialog -
OKCancelDialog
dialog -
AskDialog
dialog -
CustomContentDialog
dialog
-
-
NotificationMenu
overlay-
RecentAppSwitcher
overlay -
Selector
overlay
-
-
Component
class
The following classes are all Components
, they inherit from that class.
-
Container
component -
AppContainer
container -
Button
container -
KeyboardButton
container -
TextEntryField
container -
PagedContainer
container-
GriddedPagedContainer
container -
ListedPagedContainer
container
-
-
ButtonRow
container -
ScrollableContainer
container-
ListScrollableContainer
container -
TextScrollableContainer
container -
MultiLineTextEntryField
container
-
-
Text
component -
MultiLineText
component -
ExpandingMultiLineText
component -
Image
component -
Slider
component -
Checkbox
component -
Switch
component -
Canvas
component -
ScrollIndicator
component