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

Unified Diff: tools/win/supalink/check_installed.py

Issue 8059024: Mostly automatic incremental link enabling (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: { wrong line, reinterpret instead of C-style, banish capitals, del owners Created 9 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: tools/win/supalink/check_installed.py
diff --git a/tools/win/supalink/check_installed.py b/tools/win/supalink/check_installed.py
new file mode 100644
index 0000000000000000000000000000000000000000..88ce3fb0dc8f909f7dbd1c7980ccfac525287eb9
--- /dev/null
+++ b/tools/win/supalink/check_installed.py
@@ -0,0 +1,26 @@
+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. :)
+
+def main():
+ if sys.platform != 'win32':
+ sys.stdout.write('0')
+ return
M-A Ruel 2011/09/27 23:21:33 return 0
scottmg 2011/09/28 00:19:38 Done.
+
+ import _winreg
+ import os
M-A Ruel 2011/09/27 23:21:33 file level import for 'os'.
scottmg 2011/09/28 00:19:38 Done.
+
+ try:
+ val = _winreg.QueryValue(_winreg.HKEY_CURRENT_USER,
+ 'Software\\Chromium\\supalink_installed')
+ if os.path.exists(val):
+ # Apparently gyp thinks this means there was an error?
+ #sys.stderr.write('Supalink enabled.\n')
+ sys.stdout.write('1')
+ return
M-A Ruel 2011/09/27 23:21:33 return 0
scottmg 2011/09/28 00:19:38 Done.
+ except WindowsError:
+ pass
+
+ sys.stdout.write('0')
+
M-A Ruel 2011/09/27 23:21:33 return 0
scottmg 2011/09/28 00:19:38 Done.
+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.
+ main()
+ sys.exit(0)
M-A Ruel 2011/09/27 23:21:33 sys.exit(main())
scottmg 2011/09/28 00:19:38 Done.

Powered by Google App Engine
This is Rietveld 408576698