Changes

Jump to navigation Jump to search
no edit summary
Line 1: Line 1:  
<noinclude>
 
<noinclude>
[[Category:Feature|Optional Adhoc Autoconnect]]
+
[[Category:FeatureLanded|Optional Adhoc Autoconnect]]
[[Category:Feature Page Incomplete]]
   
</noinclude>
 
</noinclude>
   Line 33: Line 32:  
This feature is already implemented and working on Australian au1c images. The implementation requires a small modification to sugar-toolkit and sugar-toolkit-gtk3 [https://github.com/tchx84/sugar-toolkit-gtk3-1/commits/spent-time-3 see initial implementation].
 
This feature is already implemented and working on Australian au1c images. The implementation requires a small modification to sugar-toolkit and sugar-toolkit-gtk3 [https://github.com/tchx84/sugar-toolkit-gtk3-1/commits/spent-time-3 see initial implementation].
   −
The change consist in modifying the base Activity class, using the launch time timestamp in conjuction with "set_active" and "save" methods, to calculate and accumulate the seconds for when the activity was "active". The spent time is stored as an array of accumulated seconds, each for each time the entry was launched.
+
The change consist in modifying the base Activity class, using the launch time timestamp in conjuction with "set_active" and "save" methods, to calculate and accumulate the seconds for when the activity was "active". The spent time is stored as a string of comma separated integers, each for each time the entry was launched. The new metadata array is called "spent_times".
   −
The new metadata array is called "spent_times".
+
The scope of this feature is the time accumulation and metadata storage.
    +
== How to access this metadata ==
 +
 +
from sugar3.datastore import datastore
 +
 +
entries, count = datastore.find(self._query())
 +
for entry in entries:
 +
    raw_data = entry.metadata.get('spent-times', None)
 +
 +
    if raw_data is not None:
 +
        spent_times = map(int, raw_data.split(', '))
 
== User Experience ==
 
== User Experience ==
 
The user experienced is untouched.
 
The user experienced is untouched.
628

edits

Navigation menu