OLD | NEW |
---|---|
(Empty) | |
1 import sys | |
M-A Ruel
2011/09/27 23:21:33
Copyright header
M-A Ruel
2011/09/27 23:21:33
shebang
M-A Ruel
2011/09/27 23:21:33
chmod +x
scottmg
2011/09/28 00:19:38
Done.
scottmg
2011/09/28 00:19:38
Done.
scottmg
2011/09/28 00:19:38
Is this possible from a Windows git cl?
M-A Ruel
2011/09/28 00:33:27
Ah no, don't bother. :)
| |
2 | |
3 def main(): | |
4 if sys.platform != 'win32': | |
5 sys.stdout.write('0') | |
6 return | |
M-A Ruel
2011/09/27 23:21:33
return 0
scottmg
2011/09/28 00:19:38
Done.
| |
7 | |
8 import _winreg | |
9 import os | |
M-A Ruel
2011/09/27 23:21:33
file level import for 'os'.
scottmg
2011/09/28 00:19:38
Done.
| |
10 | |
11 try: | |
12 val = _winreg.QueryValue(_winreg.HKEY_CURRENT_USER, | |
13 'Software\\Chromium\\supalink_installed') | |
14 if os.path.exists(val): | |
15 # Apparently gyp thinks this means there was an error? | |
16 #sys.stderr.write('Supalink enabled.\n') | |
17 sys.stdout.write('1') | |
18 return | |
M-A Ruel
2011/09/27 23:21:33
return 0
scottmg
2011/09/28 00:19:38
Done.
| |
19 except WindowsError: | |
20 pass | |
21 | |
22 sys.stdout.write('0') | |
23 | |
M-A Ruel
2011/09/27 23:21:33
return 0
scottmg
2011/09/28 00:19:38
Done.
| |
24 if __name__ == '__main__': | |
M-A Ruel
2011/09/27 23:21:33
2 lines between file level "symbols"
scottmg
2011/09/28 00:19:38
Done.
| |
25 main() | |
26 sys.exit(0) | |
M-A Ruel
2011/09/27 23:21:33
sys.exit(main())
scottmg
2011/09/28 00:19:38
Done.
| |
OLD | NEW |