Sugar.env
From OLPC
For Developers: activities · trac · cgit · build index · repository · firmware · Fedora: packages · Sugar Labs: activities · almanac · api · bugs · gitorious · download · people · wiki
|
Sugar Almanac for Developers |
|---|
|
Sugar Almanac Main Page Package: sugar |
|
sugar.env |
|
Package: sugar.activity |
|
Package: sugar.graphics |
|
Package: sugar.datastore |
|
Logging |
|
Notes on using Python Standard Logging in Sugar |
|
Internationalization |
[edit] Environment Helper Functions
[edit] How do I get the profile path, where datastore, logging and other files are all located?
You can use the env.get_profile_path() method, which returns the base directory from which you can find other directories related to the datastore, logging, and activity-specific files.
from sugar import env
...
print env.get_profile_path()
[edit] = How do I get the log path?
Use env.get_logs_path to get the specific path for logging.
from sugar import env
...
print env.get_logs_path()

