Development Team/Almanac: Difference between revisions
| Line 70: | Line 70: | ||
=== How do I know whether my activity is running on a physical XO? === | === How do I know whether my activity is running on a physical XO? === | ||
While your activity is typically going to be run on a real XO, there might be circumstances (such as for development through sugar-jhbuild) that you will not be running on an XO machine. The easiest way to tell if you are on a physical XO is to check whether /sys/power/olpc-pm, an essential power management file for the XO, exists. <ref>[http://lists.laptop.org/pipermail/devel/2008-June/015923.html reliably detecting if running on an XO]</ref> <ref>[http://wiki.laptop.org/go/Power_Management_Interface OLPC Power Management Interface]</ref> | While your activity is typically going to be run on a real XO, there might be circumstances (such as for development through sugar-jhbuild) that you will not be running on an XO machine. The easiest way to tell if you are on a physical XO is to check whether /sys/power/olpc-pm, an essential power management file for the XO, exists. <ref>[http://lists.laptop.org/pipermail/devel/2008-June/015923.html reliably detecting if running on an XO]</ref> <ref>[http://wiki.laptop.org/go/Power_Management_Interface OLPC Power Management Interface]</ref> | ||
<pre> | |||
import os | |||
... | |||
#Print out a boolean value that tells us whether we are on an XO or not. | |||
print os.path.exists('/sys/power/olpc-pm') | |||
</pre> | |||
= Notes = | = Notes = | ||
<references /> | <references /> | ||