Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: client/common_lib/sys_power.py

Issue 3516004: Exported utility functions for RTC and system sleep (Closed) Base URL: ssh://gitrw.chromium.org/autotest.git
Patch Set: Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « client/common_lib/rtc.py ('k') | client/site_tests/power_Resume/power_Resume.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 import os
2
3
4 def set_state(state):
5 """
6 Set the system power state to 'state'.
7 """
8 file('/sys/power/state', 'w').write("%s\n" % state)
9
10
11 def suspend_to_ram():
12 """
13 Suspend the system to RAM (S3)
14 """
15 if os.path.exists('/usr/bin/powerd_suspend'):
16 os.system('/usr/bin/powerd_suspend')
17 else:
18 set_power_state('mem')
19
20
21 def suspend_to_disk():
22 """
23 Suspend the system to disk (S4)
24 """
25 set_power_state('disk')
26
27 def standby():
28 """
29 Power-on suspend (S1)
30 """
31 set_power_state('standby')
32
OLDNEW
« no previous file with comments | « client/common_lib/rtc.py ('k') | client/site_tests/power_Resume/power_Resume.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698